From 4fbf2d0b0595f6de4e1debde67bbeeec280b3e89 Mon Sep 17 00:00:00 2001 From: William Boman Date: Sun, 4 Apr 2021 18:37:59 +0200 Subject: use same lsp server names as lspconfig --- lua/nvim-lsp-installer/installers/graphql.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 lua/nvim-lsp-installer/installers/graphql.lua (limited to 'lua/nvim-lsp-installer/installers/graphql.lua') diff --git a/lua/nvim-lsp-installer/installers/graphql.lua b/lua/nvim-lsp-installer/installers/graphql.lua new file mode 100644 index 00000000..b7d5968c --- /dev/null +++ b/lua/nvim-lsp-installer/installers/graphql.lua @@ -0,0 +1,18 @@ +local util = require('lspconfig.util') + +local installer = require('nvim-lsp-installer.installer') +local capabilities = require('nvim-lsp-installer.capabilities') + +local root_dir = installer.get_server_root_path('graphql') + +return installer.create_lsp_config_installer { + name = "graphql", + root_dir = root_dir, + install_cmd = [[npm install graphql-language-service-cli@latest graphql]], + default_options = { + cmd = { root_dir .. "/node_modules/.bin/graphql-lsp", "server", "-m", "stream" }, + filetypes = { 'typescriptreact', 'javascriptreact', 'graphql' }, + root_dir = util.root_pattern('.git', '.graphqlrc'), + capabilities = capabilities.create(), + }, +} -- cgit v1.2.3-70-g09d2