Skip to content

Commit

Permalink
Enable suggestion sets by default
Browse files Browse the repository at this point in the history
  • Loading branch information
DanTup committed Apr 8, 2019
1 parent 4b3cc36 commit fd8cdf3
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1073,9 +1073,9 @@
"description": "Whether to call toString() on objects when rendering them in debug views (such as the Variables, Watch and Hovers views). Only applies to views of 15 or fewer values for performance reasons.",
"scope": "window"
},
"dart.previewAutoImportCompletions": {
"dart.autoImportCompletions": {
"type": "boolean",
"default": false,
"default": true,
"description": "Whether to include symbols that have not been imported in the code completion list and automatically insert the required import when selecting them.",
"scope": "window"
},
Expand Down
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class Config {
get analyzerObservatoryPort() { return this.getConfig<number>("analyzerObservatoryPort"); }
get analyzerPath() { return resolvePaths(this.getConfig<string>("analyzerPath")); }
get analyzerSshHost() { return this.getConfig<string>("analyzerSshHost"); }
get autoImportCompletions() { return this.getConfig<boolean>("autoImportCompletions"); }
get buildRunnerAdditionalArgs() { return this.getConfig<string[]>("buildRunnerAdditionalArgs"); }
get checkForSdkUpdates() { return this.getConfig<boolean>("checkForSdkUpdates"); }
public setCheckForSdkUpdates(value: boolean): Thenable<void> { return this.setConfig("checkForSdkUpdates", value, ConfigurationTarget.Global); }
Expand Down Expand Up @@ -76,7 +77,6 @@ class Config {
get previewHotReloadCoverageMarkers() { return this.getConfig<boolean>("previewHotReloadCoverageMarkers"); }
get previewBuildRunnerTasks() { return this.getConfig<boolean>("previewBuildRunnerTasks"); }
get previewToStringInDebugViews() { return this.getConfig<boolean>("previewToStringInDebugViews"); }
get previewAutoImportCompletions() { return this.getConfig<boolean>("previewAutoImportCompletions"); }

// Helpers
get useDarkTheme() { return this.theme !== "light"; }
Expand Down
2 changes: 1 addition & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ export function activate(context: vs.ExtensionContext, isRestart: boolean = fals
context.subscriptions.push(new OpenFileTracker(analyzer));

// Set up completions for unimported items.
if (analyzer.capabilities.supportsAvailableSuggestions && config.previewAutoImportCompletions) {
if (analyzer.capabilities.supportsAvailableSuggestions && config.autoImportCompletions) {
analyzer.completionSetSubscriptions({
subscriptions: ["AVAILABLE_SUGGESTION_SETS"],
});
Expand Down
4 changes: 1 addition & 3 deletions test/dart_only/providers/completion_item_provider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ main() {
assert.equal(completion.detail, "(int i) → int"); // No auto import message here
});

it("sorts completions by relevance", async () => {
throw new Error("NYI");
});
it.skip("sorts completions by relevance");

it("inserts full text for overrides", async () => {
await setTestContent(`
Expand Down
1 change: 0 additions & 1 deletion test/test_projects/hello_world/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@
"lib/excluded"
],
"dart.showIgnoreQuickFixes": true,
"dart.previewAutoImportCompletions": true,
}

0 comments on commit fd8cdf3

Please sign in to comment.