From 14386b6da178582b709d1c79eef30c7771db1114 Mon Sep 17 00:00:00 2001 From: Joosep Alviste Date: Fri, 8 Jan 2021 20:37:26 +0200 Subject: Add GraphQL Language Service --- lua/lspconfig/graphql.lua | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 lua/lspconfig/graphql.lua (limited to 'lua/lspconfig/graphql.lua') 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 -- cgit v1.2.3-70-g09d2