-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for LSP/tsserver Code Actions #3437
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
0163a81
CodeFix implementation
daliusd 278ccb9
Tests added. Minor changes.
daliusd 58ec8ae
ALECodeFix documented.
daliusd def3a2d
Vint problem fix.
daliusd 7002207
It seems this line must be added.
daliusd 5f5f577
Use only errors with code.
daliusd e7c14eb
ALECodeFix renamed to ALECodeAction.
daliusd a762e32
tsserver refactors support added.
daliusd 0abbe1b
Minor fix.
daliusd ff6abac
Attempt to fix <range> problem in tests.
daliusd bca2ec8
Call function instead of command.
daliusd d40b4b9
Handling special case when new text is added after new line symbol.
daliusd 747cea9
Text fixed.
daliusd 5cfc644
ale#code_action#ApplyChanges simplified.
daliusd 3dbac74
Initial attempt on LSP Code Actions.
daliusd 2d74cde
Minor fix.
daliusd e2839d2
workspace/executeCommand added.
daliusd 8b6df35
Minor improvement.
daliusd 86a34f9
Some null checks added.
daliusd ce2f468
Add last column to LSP Code Action message.
daliusd 0c7021c
Pass diagnostics to LSP code action.
daliusd d385920
Couple new tests added.
daliusd a258a51
Even more tests.
daliusd a626ca5
Even more tests.
daliusd 9faca44
Tests fixed.
daliusd 8fe3cc7
One more test fixed.
daliusd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
" Author: Dalius Dobravolskas <dalius.dobravolskas@gmail.com> | ||
" Description: https://github.com/pappasam/jedi-language-server | ||
|
||
call ale#Set('python_jedils_executable', 'jedi-language-server') | ||
call ale#Set('python_jedils_use_global', get(g:, 'ale_use_global_executables', 0)) | ||
call ale#Set('python_jedils_auto_pipenv', 0) | ||
|
||
function! ale_linters#python#jedils#GetExecutable(buffer) abort | ||
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_jedils_auto_pipenv')) | ||
\ && ale#python#PipenvPresent(a:buffer) | ||
return 'pipenv' | ||
endif | ||
|
||
return ale#python#FindExecutable(a:buffer, 'python_jedils', ['jedi-language-server']) | ||
endfunction | ||
|
||
function! ale_linters#python#jedils#GetCommand(buffer) abort | ||
let l:executable = ale_linters#python#jedils#GetExecutable(a:buffer) | ||
|
||
let l:exec_args = l:executable =~? 'pipenv$' | ||
\ ? ' run jedi-language-server' | ||
\ : '' | ||
|
||
return ale#Escape(l:executable) . l:exec_args | ||
endfunction | ||
|
||
call ale#linter#Define('python', { | ||
\ 'name': 'jedils', | ||
\ 'lsp': 'stdio', | ||
\ 'executable': function('ale_linters#python#jedils#GetExecutable'), | ||
\ 'command': function('ale_linters#python#jedils#GetCommand'), | ||
\ 'project_root': function('ale#python#FindProjectRoot'), | ||
\ 'completion_filter': 'ale#completion#python#CompletionItemFilter', | ||
\}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes more sense for the cmp function to sort forwards. Apply
reverse()
to reverse theList
below.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good.