swhitlow
swhitlow

Reputation: 420

VSCode autocomplete/intellisense for strings

While working with a PHP or JavaScript file in sublime, if I type the following code:

$test = "Scott";
If($test == null) {
    $test2 = "Scott"
}

When I typed in “$test2 = ‘Sc...” Sublime would autocomplete “Scott” since it was a word it found as a string in the current document scope.

However, when I do the same test in VSCode, it doesn’t pick it up or offer any suggestions. Is this possible in VSCode? I have already turned on the quicksuggestions to all true in the preferences. I am not sure what else I could do here or if there is an additional plugin that I need to download. Thanks!

Upvotes: 15

Views: 11175

Answers (2)

bmewburn
bmewburn

Reputation: 4006

Like this?

word based suggestions

My settings:

intelephense extension enabled

{
  "editor.quickSuggestions": {
    "other": true,
    "comments": false,
    "strings": true
  },
  "editor.wordBasedSuggestions": true,
  "php.suggest.basic": false
}

Upvotes: 22

Matt Bierner
Matt Bierner

Reputation: 65223

These are word based suggestions. They are controlled by the editor.wordBasedSuggestions setting.

However, word base suggestions will only show up when no valid language based suggestions are found (see https://github.com/Microsoft/vscode/issues/21611). JS should do the right thing inside strings here:

enter image description here

But the built-in php language support will still return language based suggestions inside strings, which is why the word based suggestions do not show up

Upvotes: 10

Related Questions