Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code autocomplete for words in same file

[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?)

like image 823
clozach Avatar asked Jan 05 '17 23:01

clozach


1 Answers

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
},
like image 108
emamut Avatar answered Sep 22 '22 23:09

emamut