Add ALERename (tsserver & LSP), ALEOrganizeImports (tsserver) and auto import support (tsserver) (#2709)

This commit adds support for renaming symbols in tsserver and with LSP tools, and for organising imports with tsserver. Completion results for symbols that can be imported are now suggested if enabled for tsserver completion done via ALE.
This commit is contained in:
Jerko Steiner
2019-09-13 03:53:23 +07:00
committed by w0rp
parent b66d202c1d
commit 3e8c8d3ccb
20 changed files with 1633 additions and 17 deletions

View File

@@ -376,6 +376,10 @@ The |ALEComplete| command can be used to show completion suggestions manually,
even when |g:ale_completion_enabled| is set to `0`. For manually requesting
completion information with Deoplete, consult Deoplete's documentation.
When working with TypeScript files, ALE by can support automatic imports
from external modules. This behavior can be enabled by setting the
|g:ale_completion_tsserver_autoimport| variable to `1`.
*ale-completion-completeopt-bug*
ALE Automatic completion implementation replaces |completeopt| before opening
@@ -597,6 +601,16 @@ b:ale_completion_enabled *b:ale_completion_enabled*
See |ale-completion|
g:ale_completion_tsserver_autoimport *g:ale_completion_tsserver_autoimport*
Type: Number
Default: `0`
When this option is set to `0`, ALE will not try to automatically import
completion results from external modules. It can be enabled by setting it
to `1`.
g:ale_completion_excluded_words *g:ale_completion_excluded_words*
*b:ale_completion_excluded_words*
Type: |List|
@@ -1317,6 +1331,27 @@ g:ale_pattern_options_enabled *g:ale_pattern_options_enabled*
will not set buffer variables per |g:ale_pattern_options|.
g:ale_rename_tsserver_find_in_comments *g:ale_rename_tsserver_find_in_comments*
Type: |Number|
Default: `0`
If enabled, this option will tell tsserver to find and replace text in
comments when calling |ALERename|. It can be enabled by settings the value
to `1`.
g:ale_rename_tsserver_find_in_strings *g:ale_rename_tsserver_find_in_strings*
Type: |Number|
Default: `0`
If enabled, this option will tell tsserver to find and replace text in
strings when calling |ALERename|. It can be enabled by settings the value to
`1`.
g:ale_set_balloons *g:ale_set_balloons*
*b:ale_set_balloons*
@@ -2543,6 +2578,18 @@ ALEHover *ALEHover*
A plug mapping `<Plug>(ale_hover)` is defined for this command.
ALEOrganizeImports *ALEOrganizeImports*
Organize imports using tsserver. Currently not implemented for LSPs.
ALERename *ALERename*
Rename a symbol using TypeScript server or Language Server.
The user will be prompted for a new name.
ALESymbolSearch `<query>` *ALESymbolSearch*
Search for symbols in the workspace, taken from any available LSP linters.