mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-16 01:07:06 +08:00
Support for LSP/tsserver Code Actions (#3437)
* Added tsserver and LSP code action support. * tsserver refactors support added. * Handling special case when new text is added after new line symbol. * ale#code_action#ApplyChanges simplified. * Initial attempt on LSP Code Actions. * workspace/executeCommand added. * Some null checks added. * Add last column to LSP Code Action message. * Pass diagnostics to LSP code action. Previously ApplyChanges code was applied from top-to-bottom that required extra parameters to track progress and there was bug. I have changed code to bottom-to-top approach as that does not require those extra parameters and solved the bug. Tested with typescript-language-server and it is working.
This commit is contained in:
committed by
GitHub
parent
1ec573bf0d
commit
01800a23ad
@@ -23,6 +23,7 @@ Before:
|
||||
\ 'completion_trigger_characters': [],
|
||||
\ 'definition': 0,
|
||||
\ 'symbol_search': 0,
|
||||
\ 'code_actions': 0,
|
||||
\ },
|
||||
\}
|
||||
|
||||
@@ -102,6 +103,7 @@ Execute(Capabilities should bet set up correctly):
|
||||
\ 'definition': 1,
|
||||
\ 'symbol_search': 1,
|
||||
\ 'rename': 1,
|
||||
\ 'code_actions': 1,
|
||||
\ },
|
||||
\ b:conn.capabilities
|
||||
AssertEqual [[1, 'initialized', {}]], g:message_list
|
||||
@@ -125,7 +127,7 @@ Execute(Disabled capabilities should be recognised correctly):
|
||||
\ 'referencesProvider': v:false,
|
||||
\ 'textDocumentSync': 2,
|
||||
\ 'documentFormattingProvider': v:true,
|
||||
\ 'codeActionProvider': v:true,
|
||||
\ 'codeActionProvider': v:false,
|
||||
\ 'signatureHelpProvider': {
|
||||
\ 'triggerCharacters': ['(', ','],
|
||||
\ },
|
||||
@@ -146,6 +148,7 @@ Execute(Disabled capabilities should be recognised correctly):
|
||||
\ 'definition': 0,
|
||||
\ 'symbol_search': 0,
|
||||
\ 'rename': 0,
|
||||
\ 'code_actions': 0,
|
||||
\ },
|
||||
\ b:conn.capabilities
|
||||
AssertEqual [[1, 'initialized', {}]], g:message_list
|
||||
@@ -197,6 +200,7 @@ Execute(Capabilities should be enabled when send as Dictionaries):
|
||||
\ 'typeDefinition': 1,
|
||||
\ 'symbol_search': 1,
|
||||
\ 'rename': 1,
|
||||
\ 'code_actions': 1,
|
||||
\ },
|
||||
\ b:conn.capabilities
|
||||
AssertEqual [[1, 'initialized', {}]], g:message_list
|
||||
|
||||
Reference in New Issue
Block a user