Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions ale_linters/glimmer/glint.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
" Author: Sukima <[email protected]>
" 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': '',
\})
12 changes: 12 additions & 0 deletions doc/ale-gjs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
===============================================================================
ALE GJS Integration *ale-gjs-options*


===============================================================================
glint *ale-gjs-glint*

See |ale-gts-glint|


===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
60 changes: 60 additions & 0 deletions doc/ale-gts.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
===============================================================================
ALE GTS Integration *ale-gts-option*


===============================================================================
glint *ale-gts-glint*

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:
11 changes: 11 additions & 0 deletions doc/ale-html.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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*

Expand Down
2 changes: 2 additions & 0 deletions doc/ale-supported-languages-and-tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ Notes:
* `elm-format`
* `elm-ls`
* `elm-make`
* Ember (filetype glimmer)
* `glint`
* Erb
* `erb`
* `erb-formatter`
Expand Down
2 changes: 2 additions & 0 deletions supported-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 8 additions & 0 deletions test/linter/test_glimmer_glint.vader
Original file line number Diff line number Diff line change
@@ -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')
Loading