Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ Status of the `main` branch. Changes prior to the next official version change w
- Java (`eclipse.jdt.ls`): Add upstream JDTLS mode for offline / restricted-network use. Setting both `jdtls_path` and `lombok_path` in `ls_specific_settings.java` makes Serena use an existing upstream JDTLS installation (e.g. `brew install jdtls`) and the system JDK 21+, skipping the ~500 MB vscode-java VSIX, Gradle, and IntelliCode downloads. New related setting `java_home` lets the user override the JDK used to launch JDTLS. Default behavior unchanged — the JDTLS workspace hash is preserved bit-for-bit for users on the default route, so existing project caches are reused without a one-time reindex; the launcher path is mixed into the hash only when `jdtls_path` is set, isolating upstream installations from the default workspace. #1415

# v1.2.0 (2026-04-27)
### Added
- BSL (1C:Enterprise) language server support via bsl-language-server by 1c-syntax. Supports `.bsl` and `.os` files. Requires Java 11+ on PATH.

* General:
- Support `serena --version` CLI command for displaying the current version #1347
- Fix: Check for ignored path ignored `.git` folder only at the top level, not in every subdirectory (`Project._is_ignored_relative_path`) #1350
- `GetSymbolsOverviewTool`: ignored paths were not respected in LSP variant (fix in `SolidLanguageServer`)
- Fix: Duplicate comments in re-saved YAML configuration files #1285
Expand Down Expand Up @@ -53,13 +56,6 @@ Status of the `main` branch. Changes prior to the next official version change w
The `initial_instructions` tool provides the full prompt on demand, keeping the initial context lean.
- Add `serena_info` tool for on-demand retrieval of usage information

* CLI:
- Support `serena --version` CLI command for displaying the current version #1347
- Extend `prompts` subcommand with `print-prompt-template` and `print-cc-system-prompt-override`, improve `list` subcommand

* Clients:
- Document workaround to make Claude Code use Serena's tools after recent degradations caused by changes in CC harness and Opus 4.7 release.

* JetBrains:
- Add `debug` tool: The agent can set breakpoints, inspect variables, evaluate expressions and control execution flow
by directly interacting with the IDE's debugger, using a REPL-style interface for maximum flexibility.
Expand All @@ -84,9 +80,6 @@ Status of the `main` branch. Changes prior to the next official version change w
Three modes (browser, native app with tray, tray manager for aggregating multiple instances) are supported, depending on the OS
- Fix: Memory leaks in frontend when using Chromium-based browsers/Windows webview #1389

* Hooks:
- Adjusted wording of startup hook, improving project activation instructions #1401.

# v1.1.2 (2026-04-14)

* General:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Serena incorporates a powerful abstraction layer for the integration of language
The underlying language servers are typically open-source projects or at least freely available for use.

When using Serena's language server backend, we provide **support for over 40 programming languages**, including
AL, Ansible, Bash, C#, C/C++, Clojure, Crystal, Dart, Elixir, Elm, Erlang, Fortran, F#, GLSL, Go, Groovy, Haskell, Haxe, HLSL, Java, JavaScript, JSON, Julia, Kotlin, Lean 4, Lua, Luau, Markdown, MATLAB, mSL, Nix, OCaml, Perl, PHP, PowerShell, Python, R, Ruby, Rust, Scala, Solidity, Swift, TOML, TypeScript, WGSL, YAML, and Zig.
AL, Ansible, Bash, BSL, C#, C/C++, Clojure, Crystal, Dart, Elixir, Elm, Erlang, Fortran, F#, GLSL, Go, Groovy, Haskell, Haxe, HLSL, Java, JavaScript, JSON, Julia, Kotlin, Lean 4, Lua, Luau, Markdown, MATLAB, mSL, Nix, OCaml, Perl, PHP, PowerShell, Python, R, Ruby, Rust, Scala, Solidity, Swift, TOML, TypeScript, WGSL, YAML, and Zig.

### The Serena JetBrains Plugin

Expand Down
1 change: 1 addition & 0 deletions news/bsl-language-server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added support for BSL (1C:Enterprise / OneScript) language via 1c-syntax/bsl-language-server.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ markers = [
"solidity: language server running for Solidity (uses @nomicfoundation/solidity-language-server)",
"ansible: language server running for Ansible (uses @ansible/ansible-language-server)",
"msl: language server running for mSL (mIRC Scripting Language)",
"bsl: language server running for BSL (1C:Enterprise / OneScript)",
]

[tool.codespell]
Expand Down
138 changes: 138 additions & 0 deletions src/solidlsp/language_servers/bsl_language_server.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
"""
Provides BSL (1C:Enterprise) specific instantiation of the LanguageServer class
using bsl-language-server by 1c-syntax. Supports .bsl and .os files.
Requires Java 11+ on PATH.
"""

import logging
import os
import pathlib
import shutil
import threading

from solidlsp.language_servers.common import RuntimeDependency, RuntimeDependencyCollection
from solidlsp.ls import (
LanguageServerDependencyProvider,
LanguageServerDependencyProviderSinglePath,
SolidLanguageServer,
)
from solidlsp.ls_config import LanguageServerConfig
from solidlsp.lsp_protocol_handler.lsp_types import InitializeParams
from solidlsp.settings import SolidLSPSettings

log = logging.getLogger(__name__)

BSL_LS_VERSION = "0.29.0"
BSL_LS_JAR_URL = "https://github.com/1c-syntax/bsl-language-server/releases/download/v0.29.0/bsl-language-server-0.29.0-exec.jar"
BSL_LS_JAR_SHA256 = "d6fa9ad638ba51855e260b88ad1f8ce4e602385845a4ee43600d148f779bcf0b"


class BSLLanguageServer(SolidLanguageServer):
"""
BSL (1C:Enterprise / OneScript) language server integration for Serena.
"""

def __init__(
self,
config: LanguageServerConfig,
repository_root_path: str,
solidlsp_settings: SolidLSPSettings,
):
super().__init__(
config,
repository_root_path,
None,
"bsl",
solidlsp_settings,
)
self.server_ready = threading.Event()

def _create_dependency_provider(self) -> LanguageServerDependencyProvider:
return self.DependencyProvider(self._custom_settings, self._ls_resources_dir)

class DependencyProvider(LanguageServerDependencyProviderSinglePath):
def _get_or_install_core_dependency(self) -> str:
if shutil.which("java") is None:
raise RuntimeError("Java 11+ is required for BSL Language Server but was not found on PATH.")
jar_dir = os.path.join(self._ls_resources_dir, "bsl-ls")
jar_path = os.path.join(jar_dir, "bsl-language-server.jar")
if not os.path.exists(jar_path):
deps = RuntimeDependencyCollection(
[
RuntimeDependency(
id="bsl-language-server",
description="BSL Language Server JAR by 1c-syntax",
url=BSL_LS_JAR_URL,
sha256=BSL_LS_JAR_SHA256,
archive_type="binary",
binary_name="bsl-language-server.jar",
platform_id="any",
),
]
)
deps.install(jar_dir)
if not os.path.exists(jar_path):
raise FileNotFoundError(f"BSL Language Server JAR not found at {jar_path} after installation.")
return jar_path

def _create_launch_command(self, core_path: str) -> list[str]:
return ["java", "-jar", core_path]

@staticmethod
def _get_initialize_params(repository_absolute_path: str) -> InitializeParams:
root_uri = pathlib.Path(repository_absolute_path).as_uri()
return { # type: ignore[return-value]
"locale": "en",
"capabilities": {
"textDocument": {
"synchronization": {"didSave": True, "dynamicRegistration": True},
"definition": {"dynamicRegistration": True},
"references": {"dynamicRegistration": True},
"documentSymbol": {
"dynamicRegistration": True,
"hierarchicalDocumentSymbolSupport": True,
"symbolKind": {"valueSet": list(range(1, 27))}, # type: ignore
},
"hover": {"dynamicRegistration": True, "contentFormat": ["markdown", "plaintext"]}, # type: ignore
"rename": {"dynamicRegistration": True, "prepareSupport": True},
},
"workspace": {
"workspaceFolders": True,
"didChangeConfiguration": {"dynamicRegistration": True},
"symbol": {"dynamicRegistration": True},
},
},
"processId": os.getpid(),
"rootPath": repository_absolute_path,
"rootUri": root_uri,
"workspaceFolders": [
{"uri": root_uri, "name": os.path.basename(repository_absolute_path)},
],
}

def _start_server(self) -> None:
def window_log_message(msg: dict) -> None:
log.info("BSL LSP: %s", msg.get("message", ""))

def do_nothing(_: dict) -> None:
return

self.server.on_notification("window/logMessage", window_log_message)
self.server.on_notification("$/progress", do_nothing)
self.server.on_notification("textDocument/publishDiagnostics", do_nothing)
self.server.on_request(
"client/registerCapability",
lambda params: None,
)

log.info("Starting BSL language server process")
self.server.start()

init_params = self._get_initialize_params(self.repository_root_path)
init_response = self.server.send.initialize(init_params)
log.debug("BSL LSP initialize response: %s", init_response)

assert "capabilities" in init_response, "BSL LSP did not return capabilities"

self.server.notify.initialized({})
self.server_ready.set()
13 changes: 12 additions & 1 deletion src/solidlsp/ls_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ class Language(str, Enum):
Uses a custom LSP server based on pygls. Automatically sets up
a virtual environment with pygls dependencies on first use.
"""
BSL = "bsl"
"""BSL Language Server for 1C:Enterprise and OneScript languages.
Uses bsl-language-server by 1c-syntax. Automatically downloads the JAR.
Supports .bsl and .os files. Requires Java 11+ on PATH.
"""
# Experimental or deprecated Language Servers
TYPESCRIPT_VTS = "typescript_vts"
"""Use the typescript language server through the natively bundled vscode extension via https://github.com/yioneko/vtsls"""
Expand Down Expand Up @@ -344,6 +349,8 @@ def get_source_fn_matcher(self) -> FilenameMatcher:
return FilenameMatcher("*.yaml", "*.yml")
case self.MSL:
return FilenameMatcher("*.mrc")
case self.BSL:
return FilenameMatcher("*.bsl", "*.os")
case _:
raise ValueError(f"Unhandled language: {self}")

Expand Down Expand Up @@ -378,7 +385,7 @@ def get_ls_class(self) -> type["SolidLanguageServer"]:

return CSharpLanguageServer
case self.CSHARP_OMNISHARP:
from solidlsp.language_servers.omnisharp import OmniSharp
from solidlsp.language_servers.omnisharp import OmniSharp # type: ignore[attr-defined]

return OmniSharp
case self.TYPESCRIPT:
Expand Down Expand Up @@ -575,6 +582,10 @@ def get_ls_class(self) -> type["SolidLanguageServer"]:
from solidlsp.language_servers.msl_language_server import MslLanguageServer

return MslLanguageServer
case self.BSL:
from solidlsp.language_servers.bsl_language_server import BSLLanguageServer

return BSLLanguageServer
case _:
raise ValueError(f"Unhandled language: {self}")

Expand Down
8 changes: 8 additions & 0 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ def project_with_ls(request: LanguageParamRequest) -> Iterator[Project]:
Language.PYTHON_TY: [pytest.mark.python],
Language.RUST: [pytest.mark.rust],
Language.TYPESCRIPT: [pytest.mark.typescript],
Language.BSL: [
pytest.mark.bsl,
pytest.mark.skipif(_sh.which("java") is None, reason="Java is not installed"),
],
}


Expand Down Expand Up @@ -319,6 +323,10 @@ def _determine_disabled_languages() -> list[Language]:
if not al_tests_enabled:
result.append(Language.AL)

# Disable BSL tests in CI or when Java is not available
if is_ci or _sh.which("java") is None:
result.append(Language.BSL)

return result


Expand Down
5 changes: 5 additions & 0 deletions test/resources/repos/bsl/test_repo/.bsl-language-server.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"language": "ru",
"diagnosticLanguage": "ru",
"computeDiagnostics": "onSave"
}
Empty file.
14 changes: 14 additions & 0 deletions test/resources/repos/bsl/test_repo/CommonModule.bsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// CommonModule.bsl - common module with reusable procedures

Процедура ВывестиСообщение(Текст) Экспорт
Сообщить(Текст);
КонецПроцедуры

Функция ПолучитьПриветствие(Имя) Экспорт
Возврат "Привет, " + Имя + "!";
КонецФункции

Процедура ВызватьПриветствие() Экспорт
Сообщение = ПолучитьПриветствие("Мир");
ВывестиСообщение(Сообщение);
КонецПроцедуры
11 changes: 11 additions & 0 deletions test/resources/repos/bsl/test_repo/ObjectModule.bsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// ObjectModule.bsl - object module example

Перем ВнутреннееСостояние;

Процедура Инициализировать() Экспорт
ВнутреннееСостояние = "ready";
КонецПроцедуры

Функция ПолучитьСостояние() Экспорт
Возврат ВнутреннееСостояние;
КонецФункции
Loading
Loading