Skip to content
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

The plugin does not work #16

Closed
dominikduda opened this issue Feb 27, 2018 · 8 comments
Closed

The plugin does not work #16

dominikduda opened this issue Feb 27, 2018 · 8 comments

Comments

@dominikduda
Copy link

dominikduda commented Feb 27, 2018

So I installed the plugin via plug.

Entering .graphql file and it looks as follows (no syntax highlight):

image

Did I forget something?

@jparise
Copy link
Owner

jparise commented Feb 28, 2018

What is the output of the set filetype? command? And which version of vim are you running?

@dominikduda
Copy link
Author

Result of vim -v:

NVIM v0.2.3-dev
Build type: RelWithDebInfo
Lua 5.1
Compilation: /usr/bin/x86_64-linux-gnu-gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -O2 -g -DMIN_LOG_LEVEL=3 -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/build/neovim-zQXPat/neovim-0.2.2ubuntu2+git201802042016-0851057-f2f288d/build/config -I/build/neovim-zQXPat/neovim-0.2.2ubuntu2+git201802042016-0851057-f2f288d/src -I/build/neovim-zQXPat/neovim-0.2.2ubuntu2+git201802042016-0851057-f2f288d/.deps/usr/include -I/build/neovim-zQXPat/neovim-0.2.2ubuntu2+git201802042016-0851057-f2f288d/.deps/usr/include -I/build/neovim-zQXPat/neovim-0.2.2ubuntu2+git201802042016-0851057-f2f288d/.deps/usr/include -I/build/neovim-zQXPat/neovim-0.2.2ubuntu2+git201802042016-0851057-f2f288d/.deps/usr/include -I/build/neovim-zQXPat/neovim-0.2.2ubuntu2+git201802042016-0851057-f2f288d/.deps/usr/include -I/build/neovim-zQXPat/neovim-0.2.2ubuntu2+git201802042016-0851057-f2f288d/.deps/usr/include -I/usr/include -I/build/neovim-zQXPat/neovim-0.2.2ubuntu2+git201802042016-0851057-f2f288d/build/src/nvim/auto -I/build/neovim-zQXPat/neovim-0.2.2ubuntu2+git201802042016-0851057-f2f288d/build/include
Compiled by buildd@lcy01-amd64-017

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

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

Run :checkhealth for more info

@jparise
Copy link
Owner

jparise commented Mar 5, 2018

I can't reproduce your problem using VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Mar 2 2018 02:50:34) or NVIM v0.2.2. I'm afraid you'll need to investigate further or provide more detail.

@johnelliott
Copy link

johnelliott commented Mar 21, 2018

I think it would be great to put in the README something saying what the file extension should be and under what circumstances the user should expect highlighting or other behavior. I've had this installed for months and it's never once worked because I expected it to work like JSX and somehow find the graphql syntax amongst my JS. Then I forgot about the plugin.

Evidently from this screenshot that's not how it works. I just now did a comand-F on the github page and searched .graphql and found a snippet of a commit message that let me to the fdetect files. I knew nothing about these until just now.

Perhaps users should read the spec or the source to understand the above, but they are probably not going to do that 🤷‍♂️ and a little hand-holding might get more people to use this.

@jparise
Copy link
Owner

jparise commented Mar 22, 2018

That's good feedback, @johnelliott. I added some more README.md documentation in c917029 and f655336 that hopefully makes the plugin's file detection and JavaScript syntax support more clear.

In terms of this issue, I see from the screenshot that @dominikduda has loaded a file with a .graphql extension, so it should have automatically selected the graphql filetype. That's also why I originally asked about the output of set filetype?, which would verify whether or not the buffer's filetype was set as expected.

@johnelliott
Copy link

@jparise looks great now. There’s no missing it.

I’ll try this out this week. I’m not totally sure if my team will end up using files with a bare query in them. At the moment we tend to use them as JavaScript template literals with substitution so they don’t end up being a .gql file. It’s usually wrapped with JavaScript.

@jparise
Copy link
Owner

jparise commented Mar 24, 2018

@johnelliott, that workflow is also supported if you use e.g. an ES6 gql tag.

Unfortunately, you'll need to also install the vim-javascript plugin because vim's built-in JavaScript syntax doesn't specifically recognized tagged template literals.

@jparise
Copy link
Owner

jparise commented Mar 31, 2018

Closing this due to lack of information. Please open when you have more details.

@jparise jparise closed this as completed Mar 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants