neoclide / coc-vetur

Vue language server extension for coc.nvim
219 stars 7 forks source link

New Release (1.2.4) Breaks SFC Integration #68

Closed phobetron closed 2 years ago

phobetron commented 3 years ago

After upgrading to the latest release of coc-vetur, I've started receiving errors such as:

[vetur 6133] [H] 'name' is declared but its value is never read.

This error is displayed for props, computed properties, and watcher methods, while using vue-property-decorator in a SFC.

This issue can be mitigated by downgrading coc-vetur to version 1.2.3.

Edit: I am also using a local eslint configuration for my project, which works as expected on 1.2.3.

yaegassy commented 3 years ago

@phobetron It is a diagnostic message at the "hint level" ([Vetur] [H] ...). It is not an Error message.

The same will be displayed in VSCode's vetur.

coc-vetur-issue68

This is a feature added in this release of vetur v0.32.0 and vls v0.7.0. https://github.com/vuejs/vetur/releases/tag/v0.32.0

Show deprecated hint in script block.

If you want to hide this message, set diagnostic.showDeprecated or diagnostic.showUnused to false in coc-settings.json.

{
  // ...snip
  "diagnostic.showDeprecated": false,
  "diagnostic.showUnused": false,
  // ...snip
}
yaegassy commented 3 years ago

Alternatively, it can be suppressed by setting diagnostic.level (default: "hint") to a value higher than infomation.

{
  // ...snip
  "diagnostic.level": "information",
  // ...snip
}
phobetron commented 3 years ago

@yaegassy Do you know why those messages are displayed, even for props and computed properties that are verifiably referenced within the template? They are not deprecated, and the hints do not disappear when deprecation diagnostics are disabled.

I would like to see hints for unused variables, but these are not unused.

yaegassy commented 3 years ago

@phobetron If the problem is also reproduced in VSCode, it would be better to ask the question in vetur's itself issue.

phobetron commented 3 years ago

I use coc-vetur because I do not use VSCode, so I can not verify in VSCode. In the screen-shot you had posted, it is unclear whether the variable in question is actually referenced.

I'd be shocked if I'm the only one with this issue, unless I'm the only person who uses Vue, TS, vue-property-decorator, and NeoVim together.

chemzqm commented 3 years ago

I'd be shocked if I'm the only one with this issue, unless I'm the only person who uses Vue, TS, vue-property-decorator, and NeoVim together.

Most vue users use VSCode without TS I think.

You can check the output https://github.com/neoclide/coc.nvim/wiki/Debug-language-server#using-output-channel

yaegassy commented 3 years ago

@phobetron I have also tried other LSP client plugins.

The situation is the same for "vim-lsp" and "Neovim built-in lsp" with the latest version of vls.

You may find something related to the "vetur" issue. For example, this issue. https://github.com/vuejs/vetur/issues/2646

Since you seem to think it is a big issue, I still think you should ask the question in the vetur's issue.

phobetron commented 3 years ago

False positives triggered by default are a pretty big issue, especially if the solution to remove them may also remove meaningful messages. I'll ask the vetur maintainers.