Vetur: Linting/Completion is not working for custom blocks

Created on 12 Jan 2021  路  10Comments  路  Source: vuejs/vetur

  • [X] I have searched through existing issues
  • [X ] I have read through docs
  • [X ] I have read FAQ
  • Info

  • Platform: Linux

  • Vetur/VLS version:0.31.3
  • VS Code (or other LSP client) version: 1.52.1

Problem

Grammar custom block gives syntax highlighting but no completion nor linting.

Reproducible Case

Create a custom block like
test: "ts"
Generate Grammar for customBlocks and reload.

Syntax highlighting is on, but neither completion nor linting works.

discussion feature-request

All 10 comments

It is designed.

Why?

It can significantly increase maintenance costs.
Also, the current structure does not allow this.

I elaborate:
There are some frameworks (namely: Quasar) which let you add a custom <test/> block inside a vue component. This is greatly helpful to have fully contained components with unit tests. This means one can add a <test lang="jest"> block and put all testing code there. But with no autocomplete it's a PITA to write tests :-)

I can understand your thoughts.
But it may be necessary to design a complete framework.
Currently there is not enough time to do.
Welcome some PR.

I understand that tooling is hard but this is a bit disappointing, it creates a sub-par experience for custom blocks :(

Could you at least disable the default completions that are irrelevant in a custom block context? Look at this screenshot:
image

Also, a related, desirable improvement:
It's OK to declare the custom blocks in settings, but having to run obscure commands and restart VS Code is less than ideal. I would like to put those blocks in my _Workspace_ settings and have them apply correctly whenever I -- or one of my teammates -- open the project.

(If you wonder why everything's red in my screenshot, that's probably a eslint-plugin-vue bug, I reported vuejs/eslint-plugin-vue#1428)

@jods4 the cause of the second one is unrelated to the original issue. Maybe you can read this issue https://github.com/microsoft/vscode/issues/68647 for more info

@jods4 first one
I will try to fix it.
https://github.com/vuejs/vetur/issues/2111

@jasonlyu123 I upvoted that VS Code issue 馃憤. It's old, not sure it's gonna make a difference.

I understand that tooling is hard but this is a bit disappointing, it creates a sub-par experience for custom blocks :(

Could you at least disable the default completions that are irrelevant in a custom block context? Look at this screenshot:

I fix it and it will release in 0.32.1.

Was this page helpful?
0 / 5 - 0 ratings