aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorJoosep Alviste <joosep.alviste@gmail.com>2021-01-08 20:37:26 +0200
committerJoosep Alviste <joosep.alviste@gmail.com>2021-01-27 20:21:15 +0200
commit14386b6da178582b709d1c79eef30c7771db1114 (patch)
tree3c20994cfad79538d6c66e89ddc526df7076dc75 /lua
parent[docgen] Update CONFIG.md (diff)
downloadnvim-lspconfig-14386b6da178582b709d1c79eef30c7771db1114.tar
nvim-lspconfig-14386b6da178582b709d1c79eef30c7771db1114.tar.gz
nvim-lspconfig-14386b6da178582b709d1c79eef30c7771db1114.tar.bz2
nvim-lspconfig-14386b6da178582b709d1c79eef30c7771db1114.tar.lz
nvim-lspconfig-14386b6da178582b709d1c79eef30c7771db1114.tar.xz
nvim-lspconfig-14386b6da178582b709d1c79eef30c7771db1114.tar.zst
nvim-lspconfig-14386b6da178582b709d1c79eef30c7771db1114.zip
Add GraphQL Language Service
Diffstat (limited to 'lua')
-rw-r--r--lua/lspconfig/graphql.lua31
1 files changed, 31 insertions, 0 deletions
diff --git a/lua/lspconfig/graphql.lua b/lua/lspconfig/graphql.lua
new file mode 100644
index 00000000..05fecf87
--- /dev/null
+++ b/lua/lspconfig/graphql.lua
@@ -0,0 +1,31 @@
+local configs = require 'lspconfig/configs'
+local util = require 'lspconfig/util'
+
+local server_name = 'graphql'
+local bin_name = 'graphql-lsp'
+
+configs[server_name] = {
+ default_config = {
+ cmd = {bin_name, 'server', '-m', 'stream'},
+ filetypes = {'graphql'},
+ root_dir = util.root_pattern('.git', '.graphqlrc'),
+ },
+
+ docs = {
+ package_json = 'https://raw.githubusercontent.com/graphql/graphiql/main/packages/graphql-language-service-cli/package.json',
+ description = [[
+https://github.com/graphql/graphiql/tree/main/packages/graphql-language-service-cli
+
+`graphql-lsp` can be installed via `npm`:
+
+```sh
+npm install -g graphql-language-service-cli
+```
+]],
+ default_config = {
+ root_dir = [[root_pattern('.git', '.graphqlrc')]],
+ },
+ },
+}
+
+-- vim:et ts=2 sw=2