From 2f37b2ca07a3f89e7994b3b7f54c997e2cb3400a Mon Sep 17 00:00:00 2001 From: "Moacir P. de Sá Pereira" Date: Thu, 5 May 2022 13:32:32 -0400 Subject: feat: glint-language-server #1890 --- lua/lspconfig/server_configurations/glint.lua | 48 +++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 lua/lspconfig/server_configurations/glint.lua diff --git a/lua/lspconfig/server_configurations/glint.lua b/lua/lspconfig/server_configurations/glint.lua new file mode 100644 index 00000000..e915af67 --- /dev/null +++ b/lua/lspconfig/server_configurations/glint.lua @@ -0,0 +1,48 @@ +local util = require 'lspconfig.util' + +local bin_name = 'glint-language-server' + +-- Glint should not be installed globally. +local path_to_node_modules = util.find_node_modules_ancestor(vim.fn.getcwd()) + +local cmd = { path_to_node_modules .. '/node_modules/.bin/' .. bin_name } + +return { + default_config = { + cmd = cmd, + filetypes = { + 'html.handlebars', + 'handlebars', + 'typescript', + 'typescript.glimmer', + 'javascript', + 'javascript.glimmer', + }, + root_dir = util.root_pattern '.glintrc.yml', + }, + docs = { + description = [[ + https://github.com/typed-ember/glint + + https://typed-ember.gitbook.io/glint/ + + `glint-language-server` is installed when adding `@glint/core` to your project's devDependencies: + + ```sh + npm install @glint/core --save-dev + ``` + + or + + ```sh + yarn add -D @glint/core + ``` + + or + + ```sh + pnpm add -D @glint/core + ``` +]], + }, +} -- cgit v1.2.3-70-g09d2