Reputation:
I've started using Visual Studio Code on El Capitan for javascript development and am really enjoying it so far, especially the code hinting, but I am encountering some behavior that I don't understand and hope someone can explain.
I'm working on a Backbone project, and if I'm in an object literal and add a new method, I get a popup/code hint that I don't understand and have to hit 'escape' to get out of. It's quite annoying as it comes up frequently. The popup looks like a function signature but I don't understand why it's there. It looks like:
(newNode: Node, offset: number): void
Can someone explain what this means and how I can get rid of it?
Thanks in advance.
Upvotes: 1
Views: 926
Reputation: 16795
I got bitten by this myself, very annoying bug. You can disable it with the following setting:
"editor.parameterHints": false
this will of course disable all hints even the useful ones. To me that's an acceptable tradeoff.
Upvotes: 0
Reputation: 1095
this is called IntelliSense. It gives you more information about the function you are about to call.
In your example: 1/2 (newNode: Node, offSet: number) void
1/2 - This indicates that there are 2 overloads for the function you are trying to call (You can click on the arrow or use ARROW KEY UP / ARROW KEY DOWN to navigate through all overloads)
newNode: Node - newNode is the name of the first parameter, Node is the class expected
offSet: number - offSet is the name of the second parameter, number is the type expected
void - indicates the return type, in this case, no return.
IntelliSense is one of the strengths of Static Typed / Pre compiled language such as C# or Java. I'd argue that one of the great features of Visual Studio Code is, that it provides you IntelliSense (to an extend) to a language such as JavaScript. (Dynamic, compiled on runtime). Visual Studio Code achieves this by using TypeScript files such as .d.ts and JSDocs (I believe).
Regarding deactivating it... I looked through the settings.json file and found only 2 commands regarding IntelliSense:
// Always include all words from the current document. (default: false)
"javascript.suggest.alwaysAllWords": false,
// Complete functions with their parameter signature. (default: false)
"javascript.suggest.useCodeSnippetsOnMethodSuggest": false,
You are able to access this file on Code -> Preferences -> User Settings. You can also see the file referenced on Visual Studio Codes Homepage.
Both do not achieve what you are looking for. This makes me think that you are not able to deactivate it.(SEE EDIT) You could look for a typings folder and remove/exclude it from your project.
EDIT: After further research, I believe I found the settings you are looking for: Editing Evolved.
You want to set:
editor.quickSuggestions: false,
editor.suggestOnTriggerCharacters: false
in the settings.json file.
Upvotes: 1