diff options
| author | Chris Rawnsley <casr+ijvx@darkcog.com> | 2023-03-20 09:58:04 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-20 17:58:04 +0800 |
| commit | 064ec8bc38ec7e281fad2ee32b936583ed690f91 (patch) | |
| tree | c812cac7e7890fb7186816dce358b507449fe5d9 /lua | |
| parent | docs: recommend LspAttach in readme (#2514) (diff) | |
| download | nvim-lspconfig-064ec8bc38ec7e281fad2ee32b936583ed690f91.tar nvim-lspconfig-064ec8bc38ec7e281fad2ee32b936583ed690f91.tar.gz nvim-lspconfig-064ec8bc38ec7e281fad2ee32b936583ed690f91.tar.bz2 nvim-lspconfig-064ec8bc38ec7e281fad2ee32b936583ed690f91.tar.lz nvim-lspconfig-064ec8bc38ec7e281fad2ee32b936583ed690f91.tar.xz nvim-lspconfig-064ec8bc38ec7e281fad2ee32b936583ed690f91.tar.zst nvim-lspconfig-064ec8bc38ec7e281fad2ee32b936583ed690f91.zip | |
fix(graphql): fix crash on projects without graphql (#2517)
The GraphQL language server needs a configuration file to initialise and
the `graphql` package from NPM. Rooting on `.git` alone causes this
server to repeatedly try opening and then close for each matching file
type when it cannot find the config it is looking for.
See: https://the-guild.dev/graphql/codegen/docs/getting-started/installation#global-installation
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lspconfig/server_configurations/graphql.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lua/lspconfig/server_configurations/graphql.lua b/lua/lspconfig/server_configurations/graphql.lua index 2d586c9e..ab5b2fda 100644 --- a/lua/lspconfig/server_configurations/graphql.lua +++ b/lua/lspconfig/server_configurations/graphql.lua @@ -11,7 +11,7 @@ return { default_config = { cmd = cmd, filetypes = { 'graphql', 'typescriptreact', 'javascriptreact' }, - root_dir = util.root_pattern('.git', '.graphqlrc*', '.graphql.config.*', 'graphql.config.*'), + root_dir = util.root_pattern('.graphqlrc*', '.graphql.config.*', 'graphql.config.*'), }, docs = { @@ -24,7 +24,7 @@ https://github.com/graphql/graphiql/tree/main/packages/graphql-language-service- npm install -g graphql-language-service-cli ``` -Note that you must also have [the graphql package](https://github.com/graphql/graphql-js) installed and create a [GraphQL config file](https://www.graphql-config.com/docs/user/user-introduction). +Note that you must also have [the graphql package](https://github.com/graphql/graphql-js) installed within your project and create a [GraphQL config file](https://the-guild.dev/graphql/config/docs). ]], default_config = { root_dir = [[util.root_pattern('.git', '.graphqlrc*', '.graphql.config.*', 'graphql.config.*')]], |
