Files
serena/docs/01-about/020_programming-languages.md
T
ab67ecab3b feat: add mSL (mIRC Scripting Language) support (#1315)
* feat: add mSL (mIRC Scripting Language) support

Add language server support for mIRC Scripting Language (.mrc files).
mSL is used in mIRC and AdiIRC IRC clients for scripting bots, games,
and automation.

The implementation uses a custom Python-based LSP server (pygls) that
parses aliases, events, menus, dialogs, and CTCP handlers. Dependencies
(pygls, lsprotocol) are installed in an isolated venv on first use.

Includes test repo, integration tests, and documentation updates.

* style: apply ruff formatting to msl_language_server.py

* fix: remove INITIALIZE handler that crashes pygls 2.x

pygls 2.x handles the initialize request internally. Overriding
it via @server.feature(lsp.INITIALIZE) causes the LSP subprocess
to crash. Removing the handler lets pygls auto-advertise capabilities
based on registered features (document_symbol, workspace_symbol).

* fix: update embedded LSP script for pygls 2.x

pygls 2.x moved LanguageServer from pygls.server to pygls.lsp.server.
Update import and bump requirement from pygls>=1.3.0 to pygls>=2.0.0.

* refactor: ship mSL LSP as package module, not runtime disk write

Per maintainer feedback: the mSL LSP is a Python script, so it should
ship as a module inside the package rather than being written to disk
at runtime.

Changes:
- Extract embedded LSP script to msl_lsp_server.py (proper module)
- Simplify MslLanguageServer: remove venv creation, disk writes,
  _create_msl_lsp_files(). DependencyProvider now just returns
  sys.executable and launches the sibling module directly.
- Add pygls>=2.0.0 and lsprotocol>=2023.0.0 to pyproject.toml deps

* fix: regenerate uv.lock after upstream v1.1.0 merge

* feat(msl): add references, definitions, and expand test coverage

- Add textDocument/references handler for cross-file alias reference finding
- Add textDocument/definition handler for go-to-definition support
- Handle $ prefix on cursor position for mSL identifiers
- Fix pre-existing mypy error in agent.py (dict[str, object] -> dict[str, str | int])
- Add MSL to _LANGUAGE_PYTEST_MARKERS in conftest.py
- Add MSL parametrized cases to test_find_symbol_stable and test_find_symbol_references_stable
- Expand test repo with cross-file reference examples (main.mrc <-> utils.mrc)
- Add within-file and cross-file reference tests to test_msl_basic.py
- Update docs and CHANGELOG to reflect expanded capabilities

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: apply ruff formatting to msl_lsp_server.py

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(msl): add hover handler, fix cross-file references via filesystem scan

Root causes of 4 CI test failures:
- textDocument/hover was not implemented (test_find_symbol_stable needs it)
- references/workspace_symbol/definition only searched opened documents,
  missing files not explicitly opened by the client
- pygls.uris.to_fs_path returns lowercase drive letters on Windows,
  causing URI mismatch with the framework's repository path comparison

Fixes:
- Add textDocument/hover handler returning definition snippets in Markdown
- Add _get_all_mrc_files() to scan workspace filesystem for all .mrc files
- Read workspace roots from server.workspace (pygls 2.x API) instead of
  broken monkey-patching of server.lsp
- Use pathlib.Path.resolve() to normalize drive letter casing on Windows
- Simplify __main__ to just server.start_io()

All 12 tests pass locally (10 solidlsp + 2 serena_agent integration).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* MSL language: removed unnecessary Dep. provider

* Changelog

* deps

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Michael Panchenko <michael.panchenko@oraios-ai.de>
2026-04-13 08:47:51 +02:00

7.8 KiB

Language Support

Serena provides a set of versatile code querying and editing functionalities based on symbolic understanding of the code across a wide range of programming languages. Equipped with these capabilities, Serena discovers and edits code just like a seasoned developer making use of an IDE's capabilities would. Serena can efficiently find the right context and do the right thing even in very large and complex projects!

There are two alternative technologies powering these capabilities:

  • Language servers implementing the language server Protocol (LSP) — the free/open-source alternative.
  • The Serena JetBrains Plugin, which leverages the powerful code analysis and editing capabilities of your JetBrains IDE.

See the Features section for a detailed comparison of the capabilities provided by the JetBrains Plugin vs. language servers.

(language-servers)=

Language Servers

Serena incorporates a powerful abstraction layer for the integration of language servers that implement the language server protocol (LSP). It even supports multiple language servers in parallel to support polyglot projects.

The language servers themselves are typically open-source projects (like Serena) or at least freely available for use.

We currently provide direct, out-of-the-box support for the programming languages listed below. Some languages require additional installations or setup steps, as noted.

  • AL
  • Ansible
    (experimental; requires Node.js and npm; automatically installs @ansible/ansible-language-server; must be explicitly specified in the languages entry in the project.yml; requires ansible in PATH for full functionality) the upstream @ansible/ansible-language-server@1.2.3 supports hover, completion, definition, semantic tokens, and validation; document symbols, workspace symbols, references, and rename are not supported by this version)
  • Bash
  • C#
    (by default, uses the Roslyn language server (language csharp), requiring .NET v10+ and, on Windows, pwsh (PowerShell 7+); set language to csharp_omnisharp to use OmiSharp instead)
  • C/C++
    (by default, uses the clangd language server (language cpp) but we also support ccls (language cpp_ccls); for best results, provide a compile_commands.json at the repository root; see the C/C++ Setup Guide for details.)
  • Clojure
  • Crystal
    (requires Crystalline language server to be installed and available on PATH; note: Crystalline has limited go-to-definition support and does not support find-references)
  • Dart
  • Elixir
    (requires Elixir installation; Expert language server is downloaded automatically)
  • Elm
    (requires Elm compiler)
  • Erlang
    (requires installation of beam and erlang_ls; experimental, might be slow or hang)
  • F#
    (requires .NET v8.0+; 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)
  • Go
    (requires installation of gopls)
  • Groovy
    (requires local groovy-language-server.jar setup via GROOVY_LS_JAR_PATH or configuration)
  • Haskell
    (automatically locates HLS via ghcup, stack, or system PATH; supports Stack and Cabal projects)
  • Haxe (requires Haxe compiler 3.4.0+ and Node.js; uses the vshaxe language server; automatically downloaded from Open VSX, or discovered from the vshaxe VSCode extension)
  • HLSL / GLSL / WGSL (uses shader-language-server (language hlsl); automatically downloaded; on macOS, requires Rust toolchain for building from source; note: reference search is not supported by this language server)
  • Java
  • JavaScript
    (supported via the TypeScript language server, i.e. use language typescript for both JavaScript and TypeScript)
  • Julia
  • Kotlin
    (uses the pre-alpha official kotlin LS, some issues may appear)
  • Lean 4
    (requires lean and lake installed via elan; uses the built-in Lean 4 LSP; the project must be a Lake project with lake build run before use)
  • Lua
  • Luau
  • Markdown
    (must explicitly enable language markdown, primarily useful for documentation-heavy projects)
  • mSL (mIRC Scripting Language)
    (auto-installed; no external dependencies required — uses a custom pygls-based LSP server shipped with Serena; supports document symbols, workspace symbols, references, and go-to-definition for aliases, events, menus, dialogs, and CTCP handlers in .mrc files)
  • Nix
    (requires nixd installation)
  • OCaml (requires opam and ocaml-lsp-server to be installed manually; see the OCaml Setup Guide)
  • Pascal
    (uses Pascal/Lazarus, which is automatically downloaded; set PP and FPCDIR environment variables for source navigation)
  • Perl
    (requires installation of Perl::LanguageServer)
  • PHP
    (by default, uses the Intelephense language server (language php), set INTELEPHENSE_LICENSE_KEY environment variable for premium features; we also support Phpactor (language php_phpactor), which requires PHP 8.1+)
  • Python
  • R
    (requires installation of the languageserver R package)
  • Ruby
    (by default, uses ruby-lsp (language ruby); use language ruby_solargraph to use Solargraph instead.)
  • Rust
    (requires rustup - uses rust-analyzer from your toolchain)
  • Scala
    (requires some manual setup; uses Metals LSP)
  • 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)
  • Swift
  • TypeScript
  • Vue
    (3.x with TypeScript; requires Node.js v18+ and npm; supports .vue Single File Components with monorepo detection)
  • YAML
  • Zig
    (requires installation of ZLS - Zig Language Server)

Support for further languages can easily be added by providing a shallow adapter for a new language server implementation, see Serena's memory on that.

The Serena JetBrains Plugin

The Serena JetBrains Plugin leverages the powerful code analysis capabilities of JetBrains IDEs. The plugin naturally supports all programming languages and frameworks that are supported by JetBrains IDEs.

When using the plugin, Serena connects to an instance of your JetBrains IDE via the plugin. For users who already work in a JetBrains IDE, this means Serena seamlessly integrates with the IDE instance you typically have open anyway, requiring no additional setup or configuration beyond the plugin itself.

  • See the JetBrains Plugin documentation for a high-level overview of its benefits and usage details.
  • See the Features section for a detailed comparison of the capabilities provided by the JetBrains Plugin vs. language servers.
<p>
<a href="https://plugins.jetbrains.com/plugin/28946-serena/">
<img style="background-color:transparent;" src="../_static/images/jetbrains-marketplace-button.png">
</a>
</p>