mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-14 20:17:42 +00:00
SolidLSP: Allow workspace folders to be flexibly configured across all language servers
that use the newly introduced InitializeParamsBuilder - Add new configuration option `ls_workspace_folders` to allow indexed source folders to be specified explicitly. In monorepos, this allows the set of indexed folders to be restricted to a subset of the repository. #1627 - Rename configuration option `additional_workspace_folders` to `ls_additional_workspace_folders` and support the option across all language servers that use an InitializeParamsBuilder (previously limited strictly to the TypeScript server). Moved the option from SolidLSPSettings to LanguageServerConfig, where it belongs. Apply InitializeParamsBuilder in TypeScriptLanguageServer and its subclasses.
This commit is contained in:
1 parent
6f1f05407d
commit
c904efed5e
17 files changed
+313
-193
No files matched your search
@@ -51,7 +51,7 @@ The file allows you to configure ...
|
||||
* the encoding used in source files
|
||||
* ignore rules
|
||||
* write access
|
||||
* [additional workspace folders](additional-workspace-folders) for cross-package reference support in monorepos
|
||||
* the list of workspace folders to be processed by language servers (when using the LSP backend)
|
||||
* an initial prompt that shall be passed to the LLM whenever the project is activated
|
||||
* a shell command to run upon project activation (prior to language backend initialisation)
|
||||
* the set of tools and modes to use for the project
|
||||
@@ -70,33 +70,6 @@ You can specify local overrides for the settings in a `project.local.yml` file i
|
||||
(which, by default, is ignored by git).
|
||||
Any keys defined therein will override the respective key in `project.yml`.
|
||||
|
||||
(additional-workspace-folders)=
|
||||
#### Additional Workspace Folders (Cross-Package References)
|
||||
|
||||
In monorepos or multi-package setups, Serena's language server normally only sees symbols within the
|
||||
project root. To enable cross-package references (e.g. `find_referencing_symbols` discovering usages
|
||||
in sibling packages), configure `additional_workspace_folders` in your `project.yml`:
|
||||
|
||||
```yaml
|
||||
additional_workspace_folders:
|
||||
- ../shared-lib
|
||||
- ../api-client
|
||||
- /absolute/path/to/another-package
|
||||
```
|
||||
|
||||
Paths can be absolute or relative to the project root. Each folder is registered as an LSP workspace
|
||||
folder, and the language server will discover symbols and references across all listed packages.
|
||||
|
||||
**Currently supported for:** TypeScript. Other language servers will raise an error if this setting
|
||||
is used with them. Support for additional languages can be added by implementing the
|
||||
`_find_representative_source_file()` method in the respective language server class.
|
||||
|
||||
:::{note}
|
||||
Each additional workspace folder adds startup time, as the language server needs to index the
|
||||
additional projects. For large monorepos, consider listing only the packages you actively need
|
||||
cross-references for.
|
||||
:::
|
||||
|
||||
(indexing)=
|
||||
### Indexing
|
||||
|
||||
|
||||
@@ -1001,9 +1001,6 @@ Supported settings:
|
||||
| `typescript_language_server_version` | `5.1.3` | Override the bundled `typescript-language-server` npm package version Serena installs when `ls_path` is not set. |
|
||||
| `npm_registry` | `null` | Override the npm registry Serena uses for the managed install. |
|
||||
|
||||
TypeScript supports [additional workspace folders](additional-workspace-folders) for cross-package
|
||||
reference discovery. Configure `additional_workspace_folders` in `project.yml` to enable this feature.
|
||||
|
||||
#### Svelte
|
||||
|
||||
Serena uses `svelte-language-server` for the `svelte` language key. Use `svelte` for Svelte projects instead of also listing `typescript`, unless you intentionally want multiple language servers active for the same files.
|
||||
|
||||
Reference in new issue
Block a user