aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/servers/graphql/init.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2021-09-17 16:05:20 +0200
committerGitHub <noreply@github.com>2021-09-17 16:05:20 +0200
commit9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6 (patch)
tree58da4fff57cc3aff4380f501b1845310dff4f2e8 /lua/nvim-lsp-installer/servers/graphql/init.lua
parenttexlab: fix ensure_executables (diff)
downloadmason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.tar
mason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.tar.gz
mason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.tar.bz2
mason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.tar.lz
mason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.tar.xz
mason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.tar.zst
mason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.zip
optimize io (70%+ startup speedups) (#93)
Diffstat (limited to 'lua/nvim-lsp-installer/servers/graphql/init.lua')
-rw-r--r--lua/nvim-lsp-installer/servers/graphql/init.lua41
1 files changed, 11 insertions, 30 deletions
diff --git a/lua/nvim-lsp-installer/servers/graphql/init.lua b/lua/nvim-lsp-installer/servers/graphql/init.lua
index 5bfac4fe..54b5cef3 100644
--- a/lua/nvim-lsp-installer/servers/graphql/init.lua
+++ b/lua/nvim-lsp-installer/servers/graphql/init.lua
@@ -1,33 +1,14 @@
-local util = require "lspconfig.util"
-
local server = require "nvim-lsp-installer.server"
local npm = require "nvim-lsp-installer.installers.npm"
-local root_dir = server.get_server_root_path "graphql"
-
-return server.Server:new {
- name = "graphql",
- root_dir = root_dir,
- installer = npm.packages { "graphql-language-service-cli@latest", "graphql" },
- default_options = {
- cmd = { npm.executable(root_dir, "graphql-lsp"), "server", "-m", "stream" },
- filetypes = { "typescriptreact", "javascriptreact", "graphql" },
- root_dir = util.root_pattern(
- -- Sourced from https://graphql-config.com/usage/ and https://git.io/Js2dt
- "package.json",
- "graphql.config.json",
- "graphql.config.js",
- "graphql.config.ts",
- "graphql.config.toml",
- "graphql.config.yaml",
- "graphql.config.yml",
- ".graphqlrc",
- ".graphqlrc.json",
- ".graphqlrc.toml",
- ".graphqlrc.yaml",
- ".graphqlrc.yml",
- ".graphqlrc.js",
- ".graphqlrc.ts"
- ),
- },
-}
+return function(name, root_dir)
+ return server.Server:new {
+ name = name,
+ root_dir = root_dir,
+ installer = npm.packages { "graphql-language-service-cli@latest", "graphql" },
+ default_options = {
+ cmd = { npm.executable(root_dir, "graphql-lsp"), "server", "-m", "stream" },
+ filetypes = { "typescriptreact", "javascriptreact", "graphql" },
+ },
+ }
+end