summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2020-09-06 22:37:37 +0100
committerw0rp <devw0rp@gmail.com>2020-09-06 22:37:37 +0100
commitc36053d4cc28fbc5fc0ee70ccb2c9a1b349eaaa3 (patch)
tree88d99ac08c11166e9849d869351374005f615465 /doc
parent5bc49d204782617e01da65d83c0d9700a1b0a72f (diff)
downloadale-c36053d4cc28fbc5fc0ee70ccb2c9a1b349eaaa3.zip
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.
Diffstat (limited to 'doc')
-rw-r--r--doc/ale.txt28
1 files changed, 26 insertions, 2 deletions
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 `<Plug>(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 `<Plug>(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*