VS Code autocompletion base on word in file
Asked Answered
J

3

13

I just begin with VS Code and I'm really happy with it at the moment !

I'm coming from Notepad++ and I didn't found any IDE at the same "level" of it for the things I'm doing.. Until now! I really like what VS Code is doing and how all modern integrated technology is helping me.

But I miss one thing that NPP do is the autocomplete base on word in the file. So can I do the same in VS Code ?

Thanks.

Jasonjasper answered 8/7, 2015 at 4:58 Comment(7)
Could be tough if there's no support for it in the IDE since VSCode doesn't support plugins yet. You might want to go with something higher powered like Visual Studio Community.Yokoyama
I'm good with VS Code.. I dont want a project manager just a code editor like NPP with more useful functionality. But if I can't do it.. It's okay.. I can live w/o. I hope they implement it in future !Jasonjasper
#30793837 - Seems this is only available for JavaScript at this time.Gastroscope
Maybe i do it wrong, but it doesn't work for me.Jasonjasper
Just took the VS Code survey... Exactly what I mentioned in the feedback, plus Ctrl + D to duplicate current line to the line below... Speeds up coding like crazy!Benito
Just found this... for the duplicate line function: code.visualstudio.com/docs/customization/keybindingsBenito
I have posted a solution that works on the following linkDetumescence
L
0

Add this to your settings.json, and restart vs code:

// Controls how JavaScript IntelliSense works.

// Always include all words from the current document.
"javascript.suggest.alwaysAllWords": true,

// Complete functions with their parameter signature.
"javascript.suggest.useCodeSnippetsOnMethodSuggest": true
Langmuir answered 26/11, 2015 at 10:17 Comment(4)
can confirm, mac os sierra vs code 1.21.1, adding these to my user settings json gives them a green underline, on hover it says "Unknown configuration setting" The only other auto complete support I can find is this extension: marketplace.visualstudio.com/… And the "Spaces inside braces" extension. The "indentED" extension might be good.Laconic
searching "vs code javascript autocomplete braces" gives some interesting results..Laconic
Highly recommend this matching bracket pair colorizer marketplace.visualstudio.com/…Laconic
Looks like these new settings are on by default : ``` // Controls if the editor should automatically close brackets after opening them "editor.autoClosingBrackets": true, // Controls if the editor should automatically adjust the indentation when users type, paste or move lines. Indentation rules of the language must be available. "editor.autoIndent": true, ``` code.visualstudio.com/docs/getstarted/settingsLaconic
L
10
"editor.quickSuggestions": {
        "other": true,
        "comments": true,
        "strings": true
      },
Langdon answered 17/8, 2017 at 10:8 Comment(2)
This solves why word completion was not working inside strings in ruby files.Lindholm
This solved my autocomplete issues with JavaScript too! I was getting sick of having to copy/paste or re-type my strings.Aphis
L
0

Add this to your settings.json, and restart vs code:

// Controls how JavaScript IntelliSense works.

// Always include all words from the current document.
"javascript.suggest.alwaysAllWords": true,

// Complete functions with their parameter signature.
"javascript.suggest.useCodeSnippetsOnMethodSuggest": true
Langmuir answered 26/11, 2015 at 10:17 Comment(4)
can confirm, mac os sierra vs code 1.21.1, adding these to my user settings json gives them a green underline, on hover it says "Unknown configuration setting" The only other auto complete support I can find is this extension: marketplace.visualstudio.com/… And the "Spaces inside braces" extension. The "indentED" extension might be good.Laconic
searching "vs code javascript autocomplete braces" gives some interesting results..Laconic
Highly recommend this matching bracket pair colorizer marketplace.visualstudio.com/…Laconic
Looks like these new settings are on by default : ``` // Controls if the editor should automatically close brackets after opening them "editor.autoClosingBrackets": true, // Controls if the editor should automatically adjust the indentation when users type, paste or move lines. Indentation rules of the language must be available. "editor.autoIndent": true, ``` code.visualstudio.com/docs/getstarted/settingsLaconic
P
-1

For autocomplete brackets use this setting:

// Complete functions with their parameter signature.
"javascript.suggest.completeFunctionCalls": true
Pitcher answered 20/1, 2019 at 17:51 Comment(1)
You've missed understand the question. He needs to autocomplete words that are in the file, not the function signaturesAggrieve

© 2022 - 2024 — McMap. All rights reserved.