-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: language support for vue files #1678
Comments
@yusufkandemir yes this is a known issue! the extension supports highlighting vue files, but no language support yet. i was researching just last night - which would be the best off-the-shelf parser for such a thing? |
maybe this interface? https://github.com/mysticatea/vue-eslint-parser/blob/c627e36c57ab6607c96f995e81b8ce693ac846ef/src/index.ts#L142 I can probably have this working by next week |
The vue-template-compiler, which is the one used to compile templates AOT, also return an AST via Dunno the differences between this and the ESLint one, except that the vue-eslint-parser is probably more lightweight as it doesn't manage compilation but just analysis |
I kind of poked around on https://astexplorer.net/ with vue parsers, and figured I'd report back my results. Out of all 3 parsers they have, it seems like the
It seems like maybe you could use |
Vue support would be great! I'm not sure what exactly the parser needs to do, but if it's only to extract the graphql queries in a vue file this library may be helpful: https://www.graphql-tools.com/docs/api/modules/graphql-tag-pluck |
See #1679 for a path forward on this! note that the vscode-graphql extension changes will provide highlighting only for vscode users, but the changes we make to the language server will impact all IDEs using the server Also to note, regular expressions are too brittle for this, we’ve found |
Ok, for reference, graphql-tag-pluck first uses Maybe using |
@acao I think this can be closed now! |
@tobiasdiez indeed it can, thank you! |
Actual Behavior
All features except basic syntax highlighting and snippets don't work in
.vue
files.Expected Behavior
They should work as expected, just like they do in .js, .ts, .graphql, etc. files.
Steps to Reproduce the Problem Or Description
Just create a
.vue
file and try to write a query usinggql
tag, you will just get graphql snippets and basic syntax highlighting.Specifications
graphql.vscode-graphql v0.3.9
1.49.1
Windows 10
v2004 build 19041.450
Ubuntu 20.04.1 LTS
/proc/version
:Linux version 4.19.84-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) graphql/vscode-graphql#1 SMP Wed Nov 13 11:44:37 UTC 2019
Logs Of TS Server || GraphQL Language Service
N/A
The text was updated successfully, but these errors were encountered: