Skip to content

Commit c68f54d

Browse files
committed
Add support for glint LSP (#4651)
Closes #4651
1 parent 69c945d commit c68f54d

File tree

7 files changed

+98
-0
lines changed

7 files changed

+98
-0
lines changed

ale_linters/glimmer/glint.vim

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
" Author: Sukima <[email protected]>
2+
" Description: glint integration for ALE
3+
4+
call ale#Set('glimmer_glint_executable', 'glint-language-server')
5+
call ale#Set('glimmer_glint_config_path', '')
6+
call ale#Set('glimmer_glint_use_global', get(g:, 'ale_use_global_executables', 0))
7+
8+
" Reusing ale#handlers#tsserver#GetProjectRoot is intentional
9+
call ale#linter#Define('glimmer', {
10+
\ 'name': 'glint',
11+
\ 'lsp': 'stdio',
12+
\ 'executable': {b -> ale#path#FindExecutable(b, 'glimmer_glint', [
13+
\ 'node_modules/.bin/glint-language-server',
14+
\ ])},
15+
\ 'command': '%e',
16+
\ 'project_root': function('ale#handlers#tsserver#GetProjectRoot'),
17+
\ 'language': '',
18+
\})

doc/ale-glint.txt

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
===============================================================================
2+
ALE Glimmer Glint Integration *ale-glint-options*
3+
4+
Glint is a language server and linter for Glimmer templates. Glimmer is a
5+
component system that supports embedding templates directly in JavaScript
6+
(`.gjs`) and TypeScript (`.gts`) files.
7+
8+
Website: https://typed-ember.gitbook.io/glint
9+
10+
11+
-------------------------------------------------------------------------------
12+
Installation
13+
14+
Install glint either globally or locally: >
15+
16+
npm install --save-dev @glint/ember-tsc @glint/template
17+
<
18+
19+
-------------------------------------------------------------------------------
20+
Options
21+
*ale-options.glimmer_glint_executable*
22+
*g:ale_glimmer_glint_executable*
23+
*b:ale_glimmer_glint_executable*
24+
glimmer_glint_executable
25+
g:ale_glimmer_glint_executable
26+
Type: |String|
27+
Default: `'glint-language-server'`
28+
29+
This variable can be changed to use a different executable for glint.
30+
31+
See |ale-integrations-local-executables|
32+
33+
*ale-options.glimmer_glint_config_path*
34+
*g:ale_glimmer_glint_config_path*
35+
*b:ale_glimmer_glint_config_path*
36+
glimmer_glint_config_path
37+
g:ale_glimmer_glint_config_path
38+
Type: |String|
39+
Default: `''`
40+
41+
This variable can be set to specify a custom configuration file path for
42+
glint.
43+
44+
*ale-options.glimmer_glint_use_global*
45+
*g:ale_glimmer_glint_use_global*
46+
*b:ale_glimmer_glint_use_global*
47+
glimmer_glint_use_global
48+
g:ale_glimmer_glint_use_global
49+
Type: |Number|
50+
Default: `get(g:, 'ale_use_global_executables', 0)`
51+
52+
See |ale-integrations-local-executables|
53+
54+
55+
===============================================================================
56+
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

doc/ale-html.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,17 @@ of them read `./.fecsrc` as the default configuration file.
7474
See: |ale-javascript-fecs|.
7575

7676

77+
===============================================================================
78+
glimmer *ale-html-glimmer*
79+
80+
The `glimmer` filetype in Vim/Neovim refers to Glimmer templates, which use
81+
the `.gjs` and `.gts` file extensions for JavaScript and TypeScript files
82+
with embedded Glimmer templates.
83+
84+
For configuration options and LSP setup, see |ale-gts-options| and
85+
|ale-gjs-options|.
86+
87+
7788
===============================================================================
7889
html-beautify *ale-html-beautify*
7990

doc/ale-supported-languages-and-tools.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ Notes:
187187
* `elm-format`
188188
* `elm-ls`
189189
* `elm-make`
190+
* Ember (filetype glimmer)
191+
* `glint`
190192
* Erb
191193
* `erb`
192194
* `erb-formatter`

doc/ale.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3566,6 +3566,7 @@ documented in additional help files.
35663566
fusion-lint...........................|ale-fuse-fusionlint|
35673567
git commit..............................|ale-gitcommit-options|
35683568
gitlint...............................|ale-gitcommit-gitlint|
3569+
glint glimmer...........................|ale-glint-options|
35693570
gleam...................................|ale-gleam-options|
35703571
gleam_format..........................|ale-gleam-gleam_format|
35713572
gleamlsp..............................|ale-gleam-gleamlsp|

supported-tools.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ formatting.
197197
* [elm-format](https://github.com/avh4/elm-format)
198198
* [elm-ls](https://github.com/elm-tooling/elm-language-server)
199199
* [elm-make](https://github.com/elm/compiler)
200+
* Ember (filetype glimmer)
201+
* [glint](https://github.com/typed-ember/glint) :speech_balloon:
200202
* Erb
201203
* [erb](https://apidock.com/ruby/ERB)
202204
* [erb-formatter](https://github.com/nebulab/erb-formatter)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Before:
2+
call ale#assert#SetUpLinterTest('glimmer', 'glint')
3+
4+
After:
5+
call ale#assert#TearDownLinterTest()
6+
7+
Execute(The default command should be correct):
8+
AssertLinter 'glint-language-server', ale#Escape('glint-language-server')

0 commit comments

Comments
 (0)