jparise/vim-graphql

Syntax highlighting for XML-like tags (in Vue SFCs)

Charl13 opened this issue · 2 comments

Hi,

First off, much appreciation for your work on this plugin.

Question, is it possible to have syntax highlighting in Vue SFCs when GQL is defined in XML-like tags?

For example, <gql>, <page-query> or <query>?

Thanks in advance

#26 added support for GraphQL syntax within JavaScript template strings within Vue templates.

It looks like we'd need to build on top of something that provides the Vue SFC syntax, such as https://github.com/posva/vim-vue (which appears to be unmaintained). I don't use Vue myself so I'm just making an education guess / assumption here.

I don't think it would be the right decision to add first-class Vue SFC syntax support directly to vim-graphql to support this use case, but if it could be made simple enough, I'm open to considering it.

I don't think it would be the right decision to add first-class Vue SFC syntax support directly to vim-graphql to support this use case, but if it could be made simple enough, I'm open to considering it.

You're probably right. After some digging I found out that vuejs/language-tools provides that first-class Vue SFC syntax support through LSP. Parsing Vue SFCs seems a lot easier in Typescript because of the tools made available by the community.

It's even mentioned there in vuejs/language-tools#358.