jparise / vim-graphql

A Vim plugin that provides GraphQL file detection, syntax highlighting, and indentation.
MIT License
487 stars 25 forks source link

Syntax support inside of ES2015 template literals #74

Closed app closed 3 years ago

app commented 3 years ago

Works but not always. Simple plug install with default settings.

image

Vim Version

NVIM v0.4.3
Build type: Release
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -g -O2 -fdebug-prefix-map=/build/neovim-gOb7vg/neovim-0.4.3=. -fstack-protector-strong -Wformat  
-Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=1 -DDISABLE_LOG -Wdate-time -D_FORTIFY_SOURCE=1 
-O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 
-Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=always 
-DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 
-DNVIM_UNIBI_HAS_VAR_FROM -I/build/neovim-gOb7vg/neovim-0.4.3/build/config -I/build/neovim-gOb7vg/neovim-0.4.3/src 
-I/usr/include -I/usr/include/lua5.1 -I/build/neovim-gOb7vg/neovim-0.4.3/build/src/nvim/auto 
-I/build/neovim-gOb7vg/neovim-0.4.3/build/include
Compiled by team+vim@tracker.debian.org

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info
jparise commented 3 years ago

From your example, it looks like you're having trouble with the comment-based syntax (schema1 above). Is that correct?

Support for that syntax was adding about a month ago in #69 (262dee0). Can you double-check that your copy of vim-graphql includes that commit?

Could you also let me know if you're using a JavaScript syntax plugin in addition to (neo)vim's built-in JavaScript language support?

app commented 3 years ago

Thanks for quick replay! Yes I use vim-javascript plugin this way Plug 'pangloss/vim-javascript', { 'for': ['javascript', 'javascript.jsx'] } And I run :PlugUpdate today There is a git command runned inside ~/.config/nvim/plugged/vim-graphql image

I see https://github.com/jparise/vim-graphql/blob/master/after/syntax/javascript/graphql.vim#L41 differ from the same line of file/commit you pointed https://github.com/jparise/vim-graphql/commit/262dee0f4a85099669af16d0f77c61897daff55e

Does it matter?

jparise commented 3 years ago

I can reproduce this now. It only seems to misbehave when the pangloss/vim-javascript plugin is also present. I'll hopefully have a fix for this soon.

jparise commented 3 years ago

@app This should be fixed now (by #75). Let me know if you're still seeing a problem after you update.

app commented 3 years ago

Thanks, @jparise ! This fix works for me too.

raine commented 2 years ago

The # gql comment for triggering graphql syntax highlighting does not work for me.

NVIM v0.4.3 Latest vim-graphql from vim-plug

I have pangloss/vim-javascript and HerringtonDarkholme/yats.vim but tried disabling both and it had no effect.

https://user-images.githubusercontent.com/11027/136661630-53c0e55c-bbcd-4b0c-8b10-1367c186a622.mp4

app commented 2 years ago

@raine, it still works for me. Yesterday I upgraded nvim to 0.5.1

:PlugUpdate ?

You may clone and try my nvim config here https://github.com/app/nvim