Skip to content

Commit a16f01d

Browse files
committed
Add documentation for additional_workspace_folders
- Add 'Additional Workspace Folders' section to project configuration docs - Add cross-reference note to TypeScript LS settings section - Include configuration example and usage notes
1 parent c1a72a7 commit a16f01d

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

docs/02-usage/040_workflow.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ The file allows you to configure ...
4848
* the encoding used in source files
4949
* ignore rules
5050
* write access
51+
* [additional workspace folders](additional-workspace-folders) for cross-package reference support in monorepos
5152
* an initial prompt that shall be passed to the LLM whenever the project is activated
5253
* the name by which you want to refer to the project (relevant when telling the LLM to dynamically activate the project)
5354
* the set of tools and modes to use by default
@@ -65,6 +66,33 @@ You can specify local overrides for the settings in a `project.local.yml` file i
6566
(which, by default, is ignored by git).
6667
Any keys defined therein will override the respective key in `project.yml`.
6768

69+
(additional-workspace-folders)=
70+
#### Additional Workspace Folders (Cross-Package References)
71+
72+
In monorepos or multi-package setups, Serena's language server normally only sees symbols within the
73+
project root. To enable cross-package references (e.g. `find_referencing_symbols` discovering usages
74+
in sibling packages), configure `additional_workspace_folders` in your `project.yml`:
75+
76+
```yaml
77+
additional_workspace_folders:
78+
- ../shared-lib
79+
- ../api-client
80+
- /absolute/path/to/another-package
81+
```
82+
83+
Paths can be absolute or relative to the project root. Each folder is registered as an LSP workspace
84+
folder, and the language server will discover symbols and references across all listed packages.
85+
86+
**Currently supported for:** TypeScript. Other language servers will raise an error if this setting
87+
is used with them. Support for additional languages can be added by implementing the
88+
`_find_representative_source_file()` method in the respective language server class.
89+
90+
:::{note}
91+
Each additional workspace folder adds startup time, as the language server needs to index the
92+
additional projects. For large monorepos, consider listing only the packages you actively need
93+
cross-references for.
94+
:::
95+
6896
(indexing)=
6997
### Indexing
7098

docs/02-usage/050_configuration.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,10 @@ Supported settings:
809809
| `typescript_language_server_version` | `5.1.3` | Override the bundled `typescript-language-server` npm package version Serena installs when `ls_path` is not set. |
810810
| `npm_registry` | `null` | Override the npm registry Serena uses for the managed install. |
811811
812+
TypeScript supports [additional workspace folders](additional-workspace-folders) for cross-package
813+
reference discovery in monorepos. Configure `additional_workspace_folders` in `project.yml` (not
814+
under `ls_specific_settings`) to enable this feature.
815+
812816
#### TypeScript via `vtsls`
813817
814818
The actual configuration key for vtsls is `typescript_vts`, not `vts`.

0 commit comments

Comments
 (0)