9

[Note: I've already tried javascript.suggest.alwaysAllWords as proposed here, but the suggested settings just give me Unknown configuration setting in Code 1.8.1 for macOS.]


Autocomplete works fine for me in Visual Studio Code, but only for code in outside modules. That's great for what it's worth, but I'm really missing the buffer-based autocomplete from Sublime which essentially includes any word in a currently-open buffer as an autocomplete option.

For example, when I type this:

hashToPage : String -> Page
hashT

I want autocomplete to offer up oPage as a completion for hashT. Instead, I have to retype the entire string.

Is there a way to tweak the settings to include words from the current page?

(Or all open buffers, or any approach that indexes variable and function names that I've created?)

Community
  • 1
  • 1
clozach
  • 5,118
  • 5
  • 41
  • 54

1 Answers1

6

Searching the internet I found the following option:

"editor.quickSuggestions": {
  "other": true,
  "comments": false,
  "strings": false
},

Fix like this and that worked for me correctly:

"editor.quickSuggestions": {
  "other": true,
  "comments": true,
  "strings": true
},
emamut
  • 621
  • 7
  • 19
  • Still not working, though perhaps I'm Doing It Wrong™. Presumably "editor.quickSuggestions" is a key added to settings.json (aka USER SETTINGS)? – clozach Jun 19 '17 at 23:18
  • Yes, it is in the last version in the configuration – emamut Jun 19 '17 at 23:46
  • Not sure what I'm doing wrong, then. Strings I type in one open file are still not auto-completing in another open file. – clozach Jun 20 '17 at 00:29
  • 2
    Your question title should be changed if you are also looking for word completion from other opened files. See https://github.com/Microsoft/vscode/issues/5312#issuecomment-724717894 This is being added soon to vscode. I assume you have the `Editor: Word Based Suggestions` enabled (that is the default)? – Mark Nov 10 '20 at 18:11