mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-13 14:16:21 +00:00
Merge remote-tracking branch 'origin/main' into feature/rename-memory-references
Conflicts: src/serena/tools/file_tools.py
This commit is contained in:
commit
a59e12adaa
41 files changed
+2608
-41
No files matched your search
@@ -71,6 +71,10 @@ Some languages require additional installations or setup steps, as noted.
|
||||
(requires [.NET v8.0+](https://dotnet.microsoft.com/en-us/download/dotnet); uses FsAutoComplete/Ionide, which is auto-installed; for Homebrew .NET on macOS, set DOTNET_ROOT in your environment)
|
||||
* **Fortran**
|
||||
(requires installation of fortls: `pip install fortls`)
|
||||
* **GDScript** (Godot Engine)
|
||||
(requires the Godot editor to be running with its built-in LSP enabled — default on port 6008;
|
||||
Serena connects over TCP and does not launch Godot itself;
|
||||
see the [GDScript Setup Guide](../03-special-guides/godot_gdscript_setup_guide_for_serena) for details)
|
||||
* **Go**
|
||||
(requires installation of `gopls`)
|
||||
* **Groovy**
|
||||
@@ -128,6 +132,8 @@ Some languages require additional installations or setup steps, as noted.
|
||||
* **Solidity**
|
||||
(experimental; requires Node.js and npm; automatically installs `@nomicfoundation/solidity-language-server`;
|
||||
works best with a `foundry.toml` or `hardhat.config.js` in the project root)
|
||||
* **Svelte**
|
||||
(requires Node.js v18+ and npm; supports `.svelte` Single File Components plus TypeScript/JavaScript files via `svelte-language-server`; a companion `typescript-language-server` + `typescript-svelte-plugin` is spawned automatically for cross-file rename, go-to-definition, and references across `.ts`/`.js` and `.svelte` files; use language `svelte` for Svelte projects instead of also enabling `typescript`)
|
||||
* **Swift**
|
||||
* **TypeScript**
|
||||
* **Vue**
|
||||
|
||||
@@ -197,7 +197,7 @@ Claude Code settings file (`.claude/settings.json` in your project directory, or
|
||||
]
|
||||
}
|
||||
],
|
||||
"Stop": [
|
||||
"SessionEnd": [
|
||||
{
|
||||
"matcher": "",
|
||||
"hooks": [
|
||||
|
||||
@@ -487,6 +487,27 @@ Supported settings:
|
||||
| `fsautocomplete_version` | `0.83.0` | Override the FsAutoComplete version Serena installs as a .NET tool. |
|
||||
|
||||
|
||||
#### GDScript (Godot Engine)
|
||||
|
||||
Serena connects to the Godot editor's built-in LSP server over TCP. No separate process is launched.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `port` | `6008` | TCP port the running Godot editor listens on for LSP connections. |
|
||||
| `request_timeout` | `30.0` | Seconds to wait for a response from the Godot LSP server. |
|
||||
|
||||
Example:
|
||||
|
||||
```yaml
|
||||
ls_specific_settings:
|
||||
gdscript:
|
||||
port: 6008
|
||||
request_timeout: 60.0
|
||||
```
|
||||
|
||||
|
||||
#### Go (`gopls`)
|
||||
|
||||
Serena forwards `ls_specific_settings.go.gopls_settings` to `gopls` as LSP `initializationOptions` when the Go language server is started.
|
||||
@@ -971,6 +992,26 @@ Supported settings:
|
||||
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.
|
||||
|
||||
A companion TypeScript language server (`typescript-language-server` + `typescript-svelte-plugin`) is spawned automatically alongside the Svelte LSP. The plugin makes the TypeScript program `.svelte`-aware so that cross-file operations — rename, go-to-definition, and find-references from `.ts`/`.js` files — correctly include `.svelte` consumers. Serena merges and deduplicates reference results from both servers automatically.
|
||||
|
||||
Supported settings:
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---|---|---|
|
||||
| `ls_path` | managed install | Override the `svelteserver` executable path. |
|
||||
| `svelte_language_server_version` | `0.18.0` | Override the `svelte-language-server` npm package version Serena installs. |
|
||||
| `typescript_version` | `6.0.3` (falls back to `ls_specific_settings.typescript.typescript_version`) | Override the `typescript` npm package version used as the shared tsdk. |
|
||||
| `typescript_language_server_version` | `5.1.3` (falls back to `ls_specific_settings.typescript.typescript_language_server_version`) | Override the `typescript-language-server` npm package version for the companion server. |
|
||||
| `typescript_svelte_plugin_version` | `0.3.52` | Override the `typescript-svelte-plugin` npm package version used for `.svelte`-aware TS resolution. |
|
||||
| `npm_registry` | `null` | Override the npm registry Serena uses for all managed installs. |
|
||||
| `initialization_options_configuration` | `{}` | Deep-merge overrides for any of the ten plugin configuration sections (`svelte`, `prettier`, `emmet`, `typescript`, `javascript`, `js/ts`, `css`, `less`, `scss`, `html`). |
|
||||
|
||||
All four packages are tracked via a version file; changing any version setting triggers a clean reinstall.
|
||||
|
||||
#### TypeScript via `vtsls`
|
||||
|
||||
The actual configuration key for vtsls is `typescript_vts`, not `vts`.
|
||||
|
||||
@@ -150,6 +150,7 @@ Only the language servers listed below download or install additional dependenci
|
||||
- **PHP (`intelephense`)**: `intelephense`
|
||||
- **SCSS / Sass / CSS**: `some-sass-language-server`
|
||||
- **Solidity**: `@nomicfoundation/solidity-language-server`
|
||||
- **Svelte**: `svelte-language-server`
|
||||
- **TypeScript**: `typescript` and `typescript-language-server`
|
||||
- **Vue**: `@vue/language-server`, plus `typescript` and `typescript-language-server`
|
||||
- **VTSLS**: `@vtsls/language-server`
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
# GDScript (Godot Engine) Setup Guide for Serena
|
||||
|
||||
This guide explains how to prepare a Godot project so that Serena can provide code intelligence for GDScript (`.gd`) files via Godot's built-in Language Server Protocol (LSP) support.
|
||||
|
||||
Unlike most language servers, Serena does **not** launch a separate LSP process for GDScript. Instead, Serena connects over TCP to the LSP server that the Godot editor itself runs while it is open. This means the Godot editor must already be running with your project loaded before you start Serena.
|
||||
|
||||
---
|
||||
## Prerequisites
|
||||
|
||||
- Godot Engine 3.x or 4.x installed and available on your system.
|
||||
- A Godot project with a `project.godot` file at the project root.
|
||||
|
||||
No additional language server needs to be installed — Godot ships with a built-in LSP server that is enabled by default.
|
||||
|
||||
---
|
||||
## How It Works
|
||||
|
||||
When a Godot project is open in the editor, the editor listens for LSP connections on **TCP port 6008** (the same default for both Godot 3 and Godot 4). Serena connects to this port and communicates using standard LSP Content-Length framing.
|
||||
|
||||
Serena automatically detects which major version of Godot your project targets by reading the `config_version` field from `project.godot`:
|
||||
|
||||
- `config_version` = 5 → Godot 4
|
||||
- `config_version` = 4 → Godot 3
|
||||
|
||||
If `config_version` is not recognized (e.g. from a future Godot release), Serena logs a warning and still connects — both Godot 3 and Godot 4 use the same port.
|
||||
|
||||
No additional configuration is needed for version detection.
|
||||
|
||||
---
|
||||
## Setup Steps
|
||||
|
||||
1. Open your Godot project in the Godot editor and allow it to finish loading.
|
||||
|
||||
2. Verify that the built-in LSP is enabled (it is on by default):
|
||||
- Go to **Editor → Editor Settings → Network → Language Server**
|
||||
- Confirm **"Use Language Server"** is checked.
|
||||
- Confirm the port is **6008** (the default).
|
||||
|
||||
3. Add `gdscript` to the `languages` list in your project's Serena configuration:
|
||||
```yaml
|
||||
# .serena/project.yml
|
||||
languages:
|
||||
- gdscript
|
||||
```
|
||||
|
||||
4. Start Serena in your project root. Serena will connect to the already-running Godot editor automatically.
|
||||
|
||||
---
|
||||
## Using Serena with GDScript
|
||||
|
||||
- Serena recognizes `.gd` and `.gdscript` files. The language identifier used in LSP communication is `gdscript`.
|
||||
- The Godot editor must remain open for the entire Serena session. If the editor is closed, Serena will lose its connection and will need to be restarted once the editor is open again.
|
||||
- On first use, you may see a brief delay while Serena establishes the TCP connection and the editor indexes your project files — this is expected.
|
||||
|
||||
---
|
||||
## Performance Note
|
||||
|
||||
Godot's built-in LSP does not implement the `workspace/symbol` request (global symbol search across the whole project). As a result, when Serena performs a workspace-wide symbol search — for example, calling `find_symbol` without a `relative_path` — it must fall back to sending a `textDocument/documentSymbol` request for **every `.gd` file** in the project individually.
|
||||
|
||||
For large projects, this initial full-project scan can take **30–60 seconds or more**.
|
||||
|
||||
To mitigate this:
|
||||
|
||||
- **Pass `relative_path` whenever possible.** Narrowing a search to a specific file or subdirectory avoids scanning the entire workspace.
|
||||
- **Let the first full scan complete.** Serena caches the results to disk after the initial scan. Subsequent Serena sessions will use the on-disk cache and start instantly.
|
||||
|
||||
---
|
||||
## Known Limitations
|
||||
|
||||
| Limitation | Detail |
|
||||
|---|---|
|
||||
| No `workspace/symbol` support | Godot's LSP does not implement this request. All symbol lookups fall back to per-file `documentSymbol` requests, making the first full-project scan slow. |
|
||||
| Editor must stay open | Serena requires the Godot editor to be running throughout the session. Closing the editor breaks the TCP connection; restart Serena after reopening the editor. |
|
||||
| Slower workspace operations | `find_symbol` and `find_references` across the whole workspace are slower than for languages whose LSP servers support native workspace-wide queries. |
|
||||
|
||||
---
|
||||
## Advanced Configuration
|
||||
|
||||
You can customize Serena's GDScript connection via `ls_specific_settings` in your `serena_config.yml` or `project.yml`:
|
||||
|
||||
```yaml
|
||||
ls_specific_settings:
|
||||
gdscript:
|
||||
port: 6008 # TCP port the Godot editor listens on (default: 6008)
|
||||
request_timeout: 30.0 # seconds to wait for an LSP response (default: 30.0)
|
||||
```
|
||||
|
||||
These override the defaults only if explicitly set.
|
||||
|
||||
---
|
||||
## Reference
|
||||
|
||||
- Godot LSP documentation: [https://docs.godotengine.org/en/stable/tutorials/editor/external_editor.html](https://docs.godotengine.org/en/stable/tutorials/editor/external_editor.html)
|
||||
- GDScript language reference: [https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/](https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/)
|
||||
Reference in new issue
Block a user