diff options
| author | Ibrahim Muftee <ibrahim@muftee.net> | 2025-08-04 07:45:42 -0500 |
|---|---|---|
| committer | Ibrahim Muftee <ibrahim@muftee.net> | 2026-07-01 00:23:31 -0400 |
| commit | 23d53b5d7bc2f31eed672c0a8d26dc608fb6d0ba (patch) | |
| tree | 7b23cd20340dd0984bb1a9616744ef81c69d3b4c /dot_config/nvim_new/lsp/glint.lua | |
| parent | 1227ae992f4494d6a3d82d70d0bb9cb01dd50847 (diff) | |
feat(nvim) slim down new config
Diffstat (limited to 'dot_config/nvim_new/lsp/glint.lua')
| -rw-r--r-- | dot_config/nvim_new/lsp/glint.lua | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/dot_config/nvim_new/lsp/glint.lua b/dot_config/nvim_new/lsp/glint.lua new file mode 100644 index 0000000..2ed30bb --- /dev/null +++ b/dot_config/nvim_new/lsp/glint.lua @@ -0,0 +1,53 @@ +---@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, +--- }, +--- }, +--- }) + +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, +} |
