Catfish
Catfish

Reputation: 19304

How to fix jsdoc autocomplete not working in vscode

I have a project where my jsdoc autocomplete doesn't work in vscode.

Any ideas why or settings I can check to figure out why hitting enter doesn't automatically add a line with a *?

enter image description here

These are my enabled extensions:

enter image description here

Upvotes: 7

Views: 6056

Answers (5)

aljgom
aljgom

Reputation: 9149

For me the culprit was the GitHub Copilot extension, like mentioned in this answer.

In summary, disable the extension,

or

open settings (f1 -> Open Settings(JSON)) and add

"editor.autoClosingBrackets": "languageDefined",
"[javascript]": {
    "editor.autoClosingBrackets": "languageDefined"
},
"[typescript]": {
  "editor.autoClosingBrackets": "languageDefined"
},

and other languages you use I guess

Upvotes: 2

aRtoo
aRtoo

Reputation: 1892

I had the same issue on my Angular project. What I did is to add "editor.autoClosingBrackets": "languageDefined" per language like this:

  "[javascript]": {
    "editor.autoClosingBrackets": "languageDefined"
  },
  "[typescript]": {
    "editor.autoClosingBrackets": "languageDefined"
  }

This works for me but it's annoying though because you have to do it per language. But I think they're working on this. github

Upvotes: 5

Vanillaboy
Vanillaboy

Reputation: 412

For everyone who has the same problem.

I found this answer useful. It looks like VSCode is treating comments on the same way like Brackets.

editor.autoClosingBrackets I had this configuration on "never" and changed it to "languageDefined".

Upvotes: 2

TheLastStark
TheLastStark

Reputation: 800

I also had the same issue, I got it fixed by setting the showWords to true

"editor.suggest.showWords": true

Kind of a bummer though, I really wanted to disable word suggestions but keep using the JSDoc, but for now I will just filter them out.

Hopefully, this will help someone having this issue.

Upvotes: 4

In my case, it was the editor.autoIndent preference setting that was set to none. Setting it to advanced or full fixes the issue with jsdoc indent autocompletion on Enter.

Upvotes: 0

Related Questions