From 152b2cb6910d9173d75a195c5a185b7f3f8aa696 Mon Sep 17 00:00:00 2001 From: w0rp Date: Sat, 5 Sep 2020 19:06:07 +0100 Subject: Clean up embertemplatelint code Alias ember-template-lint to embertemplatelint so users can use either string to enable the linter. --- doc/ale-handlebars.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/ale-handlebars.txt b/doc/ale-handlebars.txt index 5daec5b3..4a5a3870 100644 --- a/doc/ale-handlebars.txt +++ b/doc/ale-handlebars.txt @@ -14,7 +14,8 @@ ember-template-lint *ale-handlebars-embertemplatelint* g:ale_handlebars_embertemplatelint_executable *g:ale_handlebars_embertemplatelint_executable* - Type: |String| *b:ale_handlebars_embertemplatelint_executable* + *b:ale_handlebars_embertemplatelint_executable* + Type: |String| Default: `'ember-template-lint'` See |ale-integrations-local-executables| @@ -22,7 +23,8 @@ g:ale_handlebars_embertemplatelint_executable g:ale_handlebars_embertemplatelint_use_global *g:ale_handlebars_embertemplatelint_use_global* - Type: |Number| *b:ale_handlebars_embertemplatelint_use_global* + *b:ale_handlebars_embertemplatelint_use_global* + Type: |Number| Default: `get(g:, 'ale_use_global_executables', 0)` See |ale-integrations-local-executables| -- cgit v1.2.3 From c36053d4cc28fbc5fc0ee70ccb2c9a1b349eaaa3 Mon Sep 17 00:00:00 2001 From: w0rp Date: Sun, 6 Sep 2020 22:37:37 +0100 Subject: Close #3268 - Implement :ALEImport A new command, `:ALEImport`, has been added, which lets you import words at your cursor if a completion provider can provide a completion for that word which includes some additional text changes. --- doc/ale.txt | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/ale.txt b/doc/ale.txt index d45cada7..7549dc01 100644 --- a/doc/ale.txt +++ b/doc/ale.txt @@ -526,6 +526,12 @@ completion information with Deoplete, consult Deoplete's documentation. ALE by can support automatic imports from external modules. This behavior can be enabled by setting the |g:ale_completion_autoimport| variable to `1`. +You can manually request imports for symbols at the cursor with the +|ALEImport| command. The word at the cursor must be an exact match for some +potential completion result which includes additional text to insert into the +current buffer, which ALE will assume is code for an import line. This command +can be useful when your code already contains something you need to import. + When working with TypeScript files, ALE can remove warnings from your completions by setting the |g:ale_completion_tsserver_remove_warnings| variable to 1. @@ -3052,6 +3058,23 @@ ALEHover *ALEHover* A plug mapping `(ale_hover)` is defined for this command. +ALEImport *ALEImport* + + Try to import a symbol using `tsserver` or a Language Server. + + ALE will look for completions for the word at the cursor which contain + additional text edits that possible insert lines to import the symbol. The + first match with additional text edits will be used, and may add other code + to the current buffer other than import lines. + + If linting is enabled, and |g:ale_lint_on_text_changed| is set to ever check + buffers when text is changed, the buffer will be checked again after changes + are made. + + A Plug mapping `(ale_import)` is defined for this command. This + mapping should only be bound for normal mode. + + ALEOrganizeImports *ALEOrganizeImports* Organize imports using tsserver. Currently not implemented for LSPs. @@ -3059,9 +3082,10 @@ ALEOrganizeImports *ALEOrganizeImports* ALERename *ALERename* - Rename a symbol using TypeScript server or Language Server. + Rename a symbol using `tsserver` or a Language Server. - The user will be prompted for a new name. + The symbol where the cursor is resting will be the symbol renamed, and a + prompt will open to request a new name. ALERepeatSelection *ALERepeatSelection* -- cgit v1.2.3 From 417761b4157e1ce0fa230b4da1e489379ccd0512 Mon Sep 17 00:00:00 2001 From: Andrew Haust Date: Mon, 7 Sep 2020 02:24:39 -0400 Subject: Fix typo --- doc/ale-elixir.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/ale-elixir.txt b/doc/ale-elixir.txt index 5864f728..de9daacf 100644 --- a/doc/ale-elixir.txt +++ b/doc/ale-elixir.txt @@ -6,7 +6,7 @@ ALE Elixir Integration *ale-elixir-options* mix *ale-elixir-mix* -The `mix` linter is disabled by default, as it can bee too expensive to run. +The `mix` linter is disabled by default, as it can be too expensive to run. See `:help g:ale_linters` -- cgit v1.2.3 From 7d90ff56d96d601478f00895e009ae63a7d8b4bb Mon Sep 17 00:00:00 2001 From: w0rp Date: Tue, 8 Sep 2020 21:40:10 +0100 Subject: Close #3333 - Add an ALECompletePost event Add an `ALECompletePost` event along with everything needed to make it useful for its primary purpose: fixing code after inserting completions. * `ALEFix` can now be called with a bang (`!`) to suppress errors. * A new `ALELintStop` command lets you stop linting, and start it later. --- doc/ale.txt | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'doc') diff --git a/doc/ale.txt b/doc/ale.txt index 7549dc01..e6b91be8 100644 --- a/doc/ale.txt +++ b/doc/ale.txt @@ -147,6 +147,8 @@ ALE offers several options for controlling which linters are run. * Disabling only a subset of linters. - |g:ale_linters_ignore| * Disabling LSP linters and `tsserver`. - |g:ale_disable_lsp| +You can stop ALE any currently running linters with the |ALELintStop| command. +Any existing problems will be kept. ------------------------------------------------------------------------------- 3.1 Linting On Other Machines *ale-lint-other-machines* @@ -532,6 +534,9 @@ potential completion result which includes additional text to insert into the current buffer, which ALE will assume is code for an import line. This command can be useful when your code already contains something you need to import. +You can execute other commands whenever ALE inserts some completion text with +the |ALECompletePost| event. + When working with TypeScript files, ALE can remove warnings from your completions by setting the |g:ale_completion_tsserver_remove_warnings| variable to 1. @@ -2976,6 +2981,10 @@ ALEFix *ALEFix* Fix problems with the current buffer. See |ale-fix| for more information. + If the command is run with a bang (`:ALEFix!`), all warnings will be + suppressed, including warnings about no fixers being defined, and warnings + about not being able to apply fixes to a file because it has been changed. + A plug mapping `(ale_fix)` is defined for this command. @@ -3115,6 +3124,13 @@ ALELint *ALELint* A plug mapping `(ale_lint)` is defined for this command. +ALELintStop *ALELintStop* + + Stop any currently running jobs for checking the current buffer. + + Any problems from previous linter results will continue to be shown. + + ALEPrevious *ALEPrevious* ALEPreviousWrap *ALEPreviousWrap* ALENext *ALENext* @@ -3980,6 +3996,23 @@ g:ale_want_results_buffer *g:ale_want_results_buffer* figure out which buffer other sources should lint. +ALECompletePost *ALECompletePost-autocmd* + *ALECompletePost* + + This |User| autocmd is triggered after ALE inserts an item on + |CompleteDone|. This event can be used to run commands after a buffer + is changed by ALE as the result of completion. For example, |ALEFix| can + be configured to run automatically when completion is done: > + + augroup FixAfterComplete + autocmd! + " Run ALEFix when completion items are added. + autocmd User ALECompletePost ALEFix! + " If ALE starts fixing a file, stop linters running for now. + autocmd User ALEFixPre ALELintStop + augroup END +< + ALELintPre *ALELintPre-autocmd* *ALELintPre* ALELintPost *ALELintPost-autocmd* -- cgit v1.2.3 From 4ddf74264397a0c739b1c6fd5f643505a31e1d11 Mon Sep 17 00:00:00 2001 From: w0rp Date: Wed, 9 Sep 2020 21:42:27 +0100 Subject: Close #2522 - Check pylint on the fly Newer versions of pylint will now check your code as you type. Older versions will still only check the file on disk. Co-authored-by: Oliver Wiegers --- doc/ale.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/ale.txt b/doc/ale.txt index e6b91be8..6ef137c1 100644 --- a/doc/ale.txt +++ b/doc/ale.txt @@ -179,8 +179,11 @@ script like so. > #!/usr/bin/env bash - exec docker run --rm -v "$(pwd):/data" cytopia/pylint "$@" + exec docker run -i --rm -v "$(pwd):/data" cytopia/pylint "$@" < + +You will run to run Docker commands with `-i` in order to read from stdin. + With the above script in mind, you might configure ALE to lint your Python project with `pylint` by providing the path to the script to execute, and mappings which describe how to between the two file systems in your -- cgit v1.2.3