Move lsp config to local file structure
This commit is contained in:
parent
e5c3bb2492
commit
20801272fc
383 changed files with 11829 additions and 114 deletions
55
.config/nvim/lsp/glint.lua
Normal file
55
.config/nvim/lsp/glint.lua
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
---@brief
|
||||
---
|
||||
--- 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
|
||||
--- yarn add -D @glint/core
|
||||
---
|
||||
--- This configuration uses the local installation of `glint-language-server`
|
||||
--- (found in the `node_modules` directory of your project).
|
||||
---
|
||||
--- To use a global installation of `glint-language-server`,
|
||||
--- set the `init_options.glint.useGlobal` to `true`.
|
||||
---
|
||||
--- vim.lsp.config('glint', {
|
||||
--- init_options = {
|
||||
--- glint = {
|
||||
--- useGlobal = true,
|
||||
--- },
|
||||
--- },
|
||||
--- })
|
||||
|
||||
---@type vim.lsp.Config
|
||||
return {
|
||||
cmd = function(dispatchers, config)
|
||||
---@diagnostic disable-next-line: undefined-field
|
||||
local cmd = (config.init_options.glint.useGlobal or not config.root_dir) and { 'glint-language-server' }
|
||||
or { config.root_dir .. '/node_modules/.bin/glint-language-server' }
|
||||
return vim.lsp.rpc.start(cmd, dispatchers)
|
||||
end,
|
||||
init_options = {
|
||||
glint = {
|
||||
useGlobal = false,
|
||||
},
|
||||
},
|
||||
filetypes = {
|
||||
'html.handlebars',
|
||||
'handlebars',
|
||||
'typescript',
|
||||
'typescript.glimmer',
|
||||
'javascript',
|
||||
'javascript.glimmer',
|
||||
},
|
||||
root_markers = {
|
||||
'.glintrc.yml',
|
||||
'.glintrc',
|
||||
'.glintrc.json',
|
||||
'.glintrc.js',
|
||||
'glint.config.js',
|
||||
'package.json',
|
||||
},
|
||||
workspace_required = true,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue