mirror of
https://github.com/dense-analysis/ale.git
synced 2026-05-24 09:18:42 +08:00
Fix #4388: Fix pylsp and Pyright cwd
Add functions to compute the cwd to be the same as the project root for pylsp and Pyright to work around issues in each language server when they encounter modules that share the same name as first or third party libraries.
This commit is contained in:
@@ -10,6 +10,8 @@ After:
|
||||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(The command callback should return the correct default string):
|
||||
call ale#test#SetFilename('./foo.py')
|
||||
|
||||
AssertLinter
|
||||
\ 'pyright-langserver',
|
||||
\ ale#Escape('pyright-langserver') . ' --stdio'
|
||||
@@ -30,6 +32,12 @@ Execute(The default configuration should be mostly empty):
|
||||
|
||||
AssertLSPConfig {'python': {}}
|
||||
|
||||
Execute(The cwd and project root should be detected correctly):
|
||||
call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
|
||||
|
||||
AssertLinterCwd ale#test#GetFilename('../test-files/python/with_virtualenv/subdir')
|
||||
AssertLSPProject ale#test#GetFilename('../test-files/python/with_virtualenv/subdir')
|
||||
|
||||
Execute(virtualenv paths should be set in configuration by default):
|
||||
call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user