diff options
| author | awy <awy@awy.one> | 2025-10-20 20:55:26 +0300 | 
|---|---|---|
| committer | awy <awy@awy.one> | 2025-10-20 20:55:26 +0300 | 
| commit | 662dafc52b2c8a9426bb2197ab9246a8cda318e4 (patch) | |
| tree | f9d1f20e3864360bf941fd6bc02848ed77b037a8 /.config/nvim/lsp/glint.lua | |
| parent | 8131d9f2898b991a2d2c7a2ac601ce9e07cc9c9f (diff) | |
| download | hyprdots-662dafc52b2c8a9426bb2197ab9246a8cda318e4.tar.gz | |
nvqw
Diffstat (limited to '.config/nvim/lsp/glint.lua')
| -rw-r--r-- | .config/nvim/lsp/glint.lua | 54 | 
1 files changed, 54 insertions, 0 deletions
diff --git a/.config/nvim/lsp/glint.lua b/.config/nvim/lsp/glint.lua new file mode 100644 index 0000000..7da9414 --- /dev/null +++ b/.config/nvim/lsp/glint.lua @@ -0,0 +1,54 @@ +---@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) +    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, +}  |