feat(solidlsp): add ls_args and ls_extra_args for custom LS launch command#1267
feat(solidlsp): add ls_args and ls_extra_args for custom LS launch command#1267arikon wants to merge 1 commit intooraios:mainfrom
Conversation
089706c to
0e22958
Compare
|
@opcode81 Could you have a look on this, please? |
…encyProviderSinglePath - ls_extra_args appends to the default launch command args - ls_args fully replaces the default args (executable path is always kept) - Documented new options in ClangdLanguageServer docstring - Added unit tests for all combinations in test_cpp_dependency_provider.py
00e5f09 to
5bafde5
Compare
|
Rebased on |
|
@arikon This is less innocent than it might first seem. The additional launch commands may require an invalidation of the symbols cache. Could you explain which problem you ran into that required this? Maybe it would be sufficient to just extend a single LS implementation before extending the config. Extending the config like proposed here is a decision that we can't take back once released, so we have to properly think about this and we didn't have time to do so yet |
|
@MischaPanch I'm running {
"clangd.arguments": [
"--enable-config",
"--header-insertion=never",
"--log=info",
"--pretty",
"-j=6",
"--clang-tidy",
"--query-driver=/Users/arikon/.ya/tools/v4/10234711056/bin/arm-none-eabi-g++,/Users/arikon/.ya/tools/v4/10234711056/bin/arm-none-eabi-gcc,/Users/arikon/.ya/tools/v4/10492063598/bin/clang,/Users/arikon/.ya/tools/v4/10492063598/bin/clang++,/Users/arikon/.ya/tools/v4/10592126941/riscv32-esp-elf/bin/riscv32-esp-elf-g++,/Users/arikon/.ya/tools/v4/10592126941/riscv32-esp-elf/bin/riscv32-esp-elf-gcc",
"--all-scopes-completion"
]
}
Index:
Background: Skip
---
If:
PathMatch: smart_devices/libs/iot_cloud_sdk/.*
CompileFlags:
CompilationDatabase: /Users/arikon/ws/vscode/iot_cloud_sdk/compile-commands/default/host
Add:
# Workaround: https://github.com/llvm/llvm-project/issues/189288
- -isystem
- /Users/arikon/.ya/tools/v4/9996985259/lib/clang/20/include
---
If:
PathMatch:
- smart_devices/libs/iot_cloud_sdk/platform/beken/.*
- smart_devices/third_party/beken_freertos_sdk/.*
- smart_devices/third_party/freertos/kernel/.*
- smart_devices/third_party/lwip/.*
CompileFlags:
CompilationDatabase: /Users/arikon/ws/vscode/iot_cloud_sdk/compile-commands/default/bk7238
Remove:
- -mthumb-interwork
- -mabi=*
- -mno-sched-prolog
Add:
- -Wno-unknown-attributes
---
If:
PathMatch:
- smart_devices/libs/iot_cloud_sdk/platform/esp32/.*
- smart_devices/third_party/espressif/esp-idf/5.4
- smart_devices/third_party/espressif/esp-idf-aux/5.4
CompileFlags:
CompilationDatabase: /Users/arikon/ws/vscode/iot_cloud_sdk/compile-commands/default/esp32-esp-idf-5-4
Add:
- -Wno-unknown-attributesThe project is — multiplatfrom embedded SDK, so I need to tune I want that So I need to provide minimun this bunch of args to Serena's |
Serena doesn't even offer any diagnostics tools now, I don't understand what practically changes for you if Serena runs its current clangd command instead of a customized version. Do you not get proper symbol resolution or are there any problems with performance? Why does it matter if the clangd session that Serena uses doesn't have the exact same parametrization as the one you use in VSC? |
Summary
ls_extra_args— extra arguments appended to the default language server launch command (e.g.["--query-driver=/usr/bin/arm-none-eabi-gcc"])ls_args— fully replaces default arguments; only the executable path is kept (e.g.["--log=verbose"])ls_specific_settingsin.serena/project.ymland apply to all language servers usingLanguageServerDependencyProviderSinglePathClangdLanguageServerdocstring as an exampleExample config