diff --git a/ale_linters/glimmer/glint.vim b/ale_linters/glimmer/glint.vim new file mode 100644 index 0000000000..cb8318936b --- /dev/null +++ b/ale_linters/glimmer/glint.vim @@ -0,0 +1,18 @@ +" Author: Sukima +" Description: glint integration for ALE + +call ale#Set('glimmer_glint_executable', 'glint-language-server') +call ale#Set('glimmer_glint_config_path', '') +call ale#Set('glimmer_glint_use_global', get(g:, 'ale_use_global_executables', 0)) + +" Reusing ale#handlers#tsserver#GetProjectRoot is intentional +call ale#linter#Define('glimmer', { +\ 'name': 'glint', +\ 'lsp': 'stdio', +\ 'executable': {b -> ale#path#FindExecutable(b, 'glimmer_glint', [ +\ 'node_modules/.bin/glint-language-server', +\ ])}, +\ 'command': '%e', +\ 'project_root': function('ale#handlers#tsserver#GetProjectRoot'), +\ 'language': '', +\}) diff --git a/doc/ale-glint.txt b/doc/ale-glint.txt new file mode 100644 index 0000000000..44c25a4003 --- /dev/null +++ b/doc/ale-glint.txt @@ -0,0 +1,56 @@ +=============================================================================== +ALE Glimmer Glint Integration *ale-glint-options* + +Glint is a language server and linter for Glimmer templates. Glimmer is a +component system that supports embedding templates directly in JavaScript +(`.gjs`) and TypeScript (`.gts`) files. + +Website: https://typed-ember.gitbook.io/glint + + +------------------------------------------------------------------------------- +Installation + +Install glint either globally or locally: > + + npm install --save-dev @glint/ember-tsc @glint/template +< + +------------------------------------------------------------------------------- +Options + *ale-options.glimmer_glint_executable* + *g:ale_glimmer_glint_executable* + *b:ale_glimmer_glint_executable* +glimmer_glint_executable +g:ale_glimmer_glint_executable + Type: |String| + Default: `'glint-language-server'` + + This variable can be changed to use a different executable for glint. + + See |ale-integrations-local-executables| + + *ale-options.glimmer_glint_config_path* + *g:ale_glimmer_glint_config_path* + *b:ale_glimmer_glint_config_path* +glimmer_glint_config_path +g:ale_glimmer_glint_config_path + Type: |String| + Default: `''` + + This variable can be set to specify a custom configuration file path for + glint. + + *ale-options.glimmer_glint_use_global* + *g:ale_glimmer_glint_use_global* + *b:ale_glimmer_glint_use_global* +glimmer_glint_use_global +g:ale_glimmer_glint_use_global + Type: |Number| + Default: `get(g:, 'ale_use_global_executables', 0)` + + See |ale-integrations-local-executables| + + +=============================================================================== + vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: diff --git a/doc/ale-html.txt b/doc/ale-html.txt index 84babc3037..7ef2b2cf41 100644 --- a/doc/ale-html.txt +++ b/doc/ale-html.txt @@ -74,6 +74,17 @@ of them read `./.fecsrc` as the default configuration file. See: |ale-javascript-fecs|. +=============================================================================== +glimmer *ale-html-glimmer* + +The `glimmer` filetype in Vim/Neovim refers to Glimmer templates, which use +the `.gjs` and `.gts` file extensions for JavaScript and TypeScript files +with embedded Glimmer templates. + +For configuration options and LSP setup, see |ale-gts-options| and +|ale-gjs-options|. + + =============================================================================== html-beautify *ale-html-beautify* diff --git a/doc/ale-supported-languages-and-tools.txt b/doc/ale-supported-languages-and-tools.txt index 8cb95b569a..2237599b84 100644 --- a/doc/ale-supported-languages-and-tools.txt +++ b/doc/ale-supported-languages-and-tools.txt @@ -187,6 +187,8 @@ Notes: * `elm-format` * `elm-ls` * `elm-make` +* Ember (filetype glimmer) + * `glint` * Erb * `erb` * `erb-formatter` diff --git a/doc/ale.txt b/doc/ale.txt index 380914bc5c..6fb19acc97 100644 --- a/doc/ale.txt +++ b/doc/ale.txt @@ -3566,6 +3566,7 @@ documented in additional help files. fusion-lint...........................|ale-fuse-fusionlint| git commit..............................|ale-gitcommit-options| gitlint...............................|ale-gitcommit-gitlint| + glint glimmer...........................|ale-glint-options| gleam...................................|ale-gleam-options| gleam_format..........................|ale-gleam-gleam_format| gleamlsp..............................|ale-gleam-gleamlsp| diff --git a/supported-tools.md b/supported-tools.md index a038acbdeb..28b046249b 100644 --- a/supported-tools.md +++ b/supported-tools.md @@ -197,6 +197,8 @@ formatting. * [elm-format](https://github.com/avh4/elm-format) * [elm-ls](https://github.com/elm-tooling/elm-language-server) * [elm-make](https://github.com/elm/compiler) +* Ember (filetype glimmer) + * [glint](https://github.com/typed-ember/glint) :speech_balloon: * Erb * [erb](https://apidock.com/ruby/ERB) * [erb-formatter](https://github.com/nebulab/erb-formatter) diff --git a/test/linter/test_glimmer_glint.vader b/test/linter/test_glimmer_glint.vader new file mode 100644 index 0000000000..882c898bd0 --- /dev/null +++ b/test/linter/test_glimmer_glint.vader @@ -0,0 +1,8 @@ +Before: + call ale#assert#SetUpLinterTest('glimmer', 'glint') + +After: + call ale#assert#TearDownLinterTest() + +Execute(The default command should be correct): + AssertLinter 'glint-language-server', ale#Escape('glint-language-server')