mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-31 00:24:31 +08:00
* rust-analyzer in non-cargo projects rust-analyzer can also be used in non-cargo projects. This requires a rust-project.json file in the project root [1]. Make the rust-analyzer linter search for a rust-project.json file if no Cargo.toml file could be found. [1]: https://rust-analyzer.github.io/manual.html#non-cargo-based-projects * Document rust-analyzer without cargo * Test rust-analyzer with non-cargo projects Change the other rust tests to match the new directory structure of the test files.
28 lines
955 B
Plaintext
28 lines
955 B
Plaintext
Before:
|
|
call ale#assert#SetUpLinterTest('rust', 'analyzer')
|
|
|
|
After:
|
|
call ale#assert#TearDownLinterTest()
|
|
|
|
Execute(The default executable path should be correct):
|
|
AssertLinter 'rust-analyzer', ale#Escape('rust-analyzer')
|
|
|
|
Execute(The project root should be detected correctly in cargo projects):
|
|
AssertLSPProject ''
|
|
|
|
call ale#test#SetFilename('../test-files/rust/cargo/testfile.rs')
|
|
|
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/rust/cargo')
|
|
|
|
Execute(The project root should be detected correctly in non-cargo projects):
|
|
AssertLSPProject ''
|
|
|
|
call ale#test#SetFilename('../test-files/rust/rust-project/testfile.rs')
|
|
|
|
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/rust/rust-project')
|
|
|
|
Execute(Should accept configuration settings):
|
|
AssertLSPConfig {}
|
|
let b:ale_rust_analyzer_config = {'diagnostics': {'disabled': ['unresolved-import']}}
|
|
AssertLSPOptions {'diagnostics': {'disabled': ['unresolved-import']}}
|