Skip to content

1.0.3#4242

Merged
nixel2007 merged 135 commits into
masterfrom
develop
Jul 4, 2026
Merged

1.0.3#4242
nixel2007 merged 135 commits into
masterfrom
develop

Conversation

@nixel2007

Copy link
Copy Markdown
Member

No description provided.

claude and others added 30 commits June 25, 2026 19:04
…ля (#4204 п.2)

В точке завершения рекурсии метка `См. Функция` бралась из источников уже
разрешённого типа поля (на уровень глубже), из-за чего `Содержимое - см. Коробка`
сворачивалось в `См. Контейнер` вместо `См. Коробка`.

Теперь источник берётся из собственной ленивой ссылки поля
(owner.lazyFields[имя]); для эагерных полей-коллекций (`Массив из см. Узел`)
остаётся источник ленивого элемента. Это же значение используется и для
обнаружения цикла.

Тесты ужесточены: проверяется именно `См. Коробка`/`See Коробка` и отсутствие
`См. Контейнер`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QcYuuctkrfWkmGqXaUmx5S
Add a guide for AI assistants describing the project's purpose,
high-level architecture and key components, build/test commands and
their duration, UTF-8/Cyrillic and EOL rules for resources, the
diagnostics structure, code style checks, and pointers to docs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KjMDcyJsxemFrpFfMLBv6h
Restructure CLAUDE.md per Anthropic memory-file guidance: more
concise, denser sections, docs referenced via plain markdown links
(read on demand) instead of bloating context. Add an instruction to
proactively suggest updating CLAUDE.md when a discrepancy with the
actual repo is found, and a stripped HTML maintainer note.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KjMDcyJsxemFrpFfMLBv6h
Add a Conventional Commits requirement to the git section and a note
that, inside a git worktree, the git-versioning plugin must be disabled
(-Dversioning.disable) and the version set manually (-Pversion=...),
otherwise the build fails.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KjMDcyJsxemFrpFfMLBv6h
fix(hover): корректный конструктор на обрыве рекурсивной см.-цепочки
Add nested CLAUDE.md files (loaded on demand when working in their
directories) describing the key subsystems: context & symbols,
the type system, references, diagnostics, and LSP providers. Link
them from the root CLAUDE.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KjMDcyJsxemFrpFfMLBv6h
Add nested CLAUDE.md for configuration, reporters, cfg, mcp and utils.
Expand the root CLAUDE.md with a "cross-cutting concepts" section
covering the event model (published via AOP), workspace-scoped beans
and the multi-workspace architecture, plus a cli entry-points note.
Add an AOP paragraph to context/CLAUDE.md and link all new files.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KjMDcyJsxemFrpFfMLBv6h
webmvc HTTP transport is functional. Document both launch paths: the
standalone `mcp` subcommand (--protocol stdio|sse|streamable) and the
`--mcp` flag alongside `lsp`/`websocket` (Streamable HTTP), plus how
BSLLSPLauncher selects profiles/web type from args. Note the stale
"prototype" wording in mcp package-info.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KjMDcyJsxemFrpFfMLBv6h
A discovered discrepancy belongs in a message to the maintainer, not as
a note left in the doc. Remove the package-info remark.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KjMDcyJsxemFrpFfMLBv6h
The MCP mode is no longer a stdio-only prototype: document the stdio,
SSE and Streamable HTTP transports selected in BSLLSPLauncher, and the
--mcp flag for running MCP over Streamable HTTP next to lsp/websocket.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KjMDcyJsxemFrpFfMLBv6h
Javadoc of a class/method must describe its contract, not who calls it
or in which scenarios — that is foreign domain knowledge, breaks
separation of concerns and quickly goes stale. Keep caller/scenario
knowledge on the calling side, in tests, or in package-info/docs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KjMDcyJsxemFrpFfMLBv6h
Drop caller/scenario coupling (BSLLSPLauncher, CLI flags/subcommands)
per the javadoc style rule. Describe the package by what it is — an MCP
server over the analysis core supporting stdio/SSE/Streamable HTTP —
not how it is launched.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KjMDcyJsxemFrpFfMLBv6h
docs: add CLAUDE.md with project overview and dev guidelines
Введены архитектурные тесты на базе ArchUnit (archunit-junit5 1.4.1),
фиксирующие сложившиеся конвенции проекта:

- конкретные диагностики именуются *Diagnostic и помечены @DiagnosticMetadata;
- абстрактные базовые диагностики — с префиксом Abstract;
- @DiagnosticMetadata ставится только на реализациях BSLDiagnostic;
- провайдеры — *Provider, репортёры (реализации DiagnosticReporter) — *Reporter;
- подкоманды picocli в cli — *Command;
- классы в пакетах events наследуют ApplicationEvent и именуются *Event;
- доменные слои не зависят от слоя точек входа cli;
- логирование только через slf4j, без java.util.logging.

Тесты не поднимают Spring-контекст и выполняются быстро.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LkYRgB6NZZRRNZmBrdL54M
Событие переезжает в новый пакет types.oscript.events рядом с остальными
Spring ApplicationEvent проекта. Это приводит размещение события к общей
конвенции (все события — в пакетах events) и снимает единственное исключение
для двунаправленного архитектурного правила про события.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LkYRgB6NZZRRNZmBrdL54M
Добавлены правила:
- диагностики обязаны лежать в пакете diagnostics;
- запрет вывода в stdout/stderr во всём коде, кроме явного allow-list
  транспортных/CLI-точек (ParentProcessWatcher, LanguageServerLauncher-
  Configuration, VersionCommand, McpStdioConfiguration);
- двунаправленные правила про события: в пакетах events лежат только
  ApplicationEvent с суффиксом Event, и наоборот — события/классы *Event
  не должны лежать вне events;
- каркас слоистой архитектуры (layeredArchitecture), включаемый постепенно:
  пока зафиксировано ограничение «cli не используется доменными слоями».

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LkYRgB6NZZRRNZmBrdL54M
- .claude/settings.json: env LANG/LC_ALL=C.UTF-8, чтобы под POSIX-локалью
  веб-окружения Gradle мог декодировать кириллические имена файлов-фикстур
  (иначе падают processTestResources и часть тестов);
- .gitignore: продолжаем игнорировать локальное состояние .claude/, но
  трекаем общий settings.json;
- CLAUDE.md: добавлена заметка про локаль рантайма (sun.jnu.encoding);
  исправлены имена классов подкоманд cli (суффикс Command).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LkYRgB6NZZRRNZmBrdL54M
VersionCommand печатал версию напрямую в System.out. Перевод на штатный
канал вывода picocli (@SPEC CommandSpec → commandLine().getOut()) убирает
прямое обращение к стандартному потоку и делает вывод перехватываемым.
Тест усилен: проверяет не только код возврата, но и сам текст вывода.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LkYRgB6NZZRRNZmBrdL54M
- запрет вывода в стандартные потоки сделан глобальным (без привязки к
  диагностикам): никто не пишет в stdout/stderr, кроме транспортных точек
  LSP/MCP и аварийного fallback в ParentProcessWatcher;
- слоистая архитектура и запрет @Autowired обёрнуты в FreezingArchRule:
  текущие нарушения (слоистые инверсии; legacy self-/setter-инъекции,
  которые нельзя убрать одномоментно) зафиксированы базовой линией в
  archunit_store/, новые — валят сборку. По мере чистки база сокращается.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LkYRgB6NZZRRNZmBrdL54M
Слоистое правило задавало пакеты шаблоном "..diagnostics..", который жадно
матчил и configuration.diagnostics — внутрислойные связи configuration попадали
в базу как мнимые межслойные. Переход на абсолютные пути + ограничение модели
только реальными инверсиями (cli не используется снизу; providers не вызываются
из diagnostics) сокращает базовую линию с 50 до 20 записей. Все оставшиеся —
настоящий долг: diagnostics→providers (quick fix через CodeActionProvider,
IdenticalExpressionsDiagnostic→FormatProvider) и reporters→cli.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LkYRgB6NZZRRNZmBrdL54M
ServerInfo.getVersion() может вернуть null (например, без манифеста — ср.
SentryScopeConfigurer, где результат оборачивается в Optional.ofNullable).
Прежняя проверка version.isEmpty() в этом случае давала NPE вместо кода 1.
Добавлена проверка на null + тест testNullVersion. Замечание CodeRabbit.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LkYRgB6NZZRRNZmBrdL54M
В обе локали EnvironmentSetting добавлен раздел про локаль рантайма: под
LC_CTYPE=POSIX/C JVM берёт ASCII для sun.jnu.encoding и не читает кириллические
имена файлов-фикстур, из-за чего падают processTestResources и часть тестов.
Указан обход LANG=C.UTF-8. Замечание CodeRabbit (синхронизация ru/en).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LkYRgB6NZZRRNZmBrdL54M
delombok копирует вложенные CLAUDE.md из пакетов исходников в сгенерированные
сорсы, и javadoc падал на них ("Illegal package name"). Исключаем не-java файлы
из задачи javadoc. Чинит CI-job build-javadoc (предсуществующая поломка после
добавления per-directory CLAUDE.md), не связан с ArchUnit.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LkYRgB6NZZRRNZmBrdL54M
…ders

Статический билдер createCodeActions(...) лежал в providers.CodeActionProvider,
хотя используется исключительно диагностиками в getQuickFixes(). Из-за этого
возникала слоистая инверсия diagnostics → providers (16 рёбер). Метод перенесён
как static на интерфейс diagnostics.QuickFixProvider — туда, где живёт контракт
quick-fix и где его вызывают реализаторы. Перенос в codeactions/ невозможен
(там обратная зависимость codeactions → diagnostics, был бы цикл).

Логика билдера не изменилась. Заморозка слоёв авто-сжалась: 20 → 5 записей
(остались reporters→cli и IdenticalExpressions→FormatProvider).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LkYRgB6NZZRRNZmBrdL54M
Бин filteredReporters жил в reporters/infrastructure/ReportersConfiguration, но
зависел от cli.AnalyzeCommand (читал --reporter), создавая инверсию reporters→cli.
Отбор репортёров по ключам — это разбор CLI-ввода, поэтому бин перенесён в новый
cli/ReporterSelectionConfiguration. Имя бина (filteredReporters) и @lazy сохранены,
поэтому @Qualifier-инъекция в ReportersAggregator и тайминг picocli не меняются.
Пустой пакет reporters/infrastructure удалён, reporters/CLAUDE.md обновлён.

Заморозка слоёв авто-сжалась: 5 → 3 (остался только diagnostics→providers через
IdenticalExpressionsDiagnostic→FormatProvider).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LkYRgB6NZZRRNZmBrdL54M
Движок форматирования (getNewText + хелперы, ~460 строк) жил в providers.FormatProvider,
хотя это переиспользуемая логика, а не тонкий LSP-провайдер. Из-за прямого вызова движка
диагностикой IdenticalExpressionsDiagnostic (нормализация текста операнда для сообщения)
возникала инверсия diagnostics→providers.

Движок вынесен в новый бин formatting.BslFormatter; FormatProvider стал тонким
LSP-адаптером и делегирует в него (как требует providers/CLAUDE.md). Диагностика теперь
зависит от BslFormatter, а не от providers. Поведение не изменилось — FormatProviderTest
(27 тестов) и IdenticalExpressionsDiagnosticTest.checkMessage() зелёные.

Это убрало последнюю слоистую инверсию, поэтому правило layer_dependencies снято с
FreezingArchRule и стало строгим (без базовой линии). В archunit_store осталась только
база по @Autowired.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LkYRgB6NZZRRNZmBrdL54M
Javadoc пакета formatting и класса BslFormatter описывал, КТО вызывает движок
(«переиспользуемый провайдером и диагностиками»), что запрещено правилом из
CLAUDE.md (javadoc — про контракт, а не про вызовы). Переформулировано на
описание самого контракта (токены + опции → отформатированный текст).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LkYRgB6NZZRRNZmBrdL54M
Последнее замороженное правило (@Autowired) переведено на явный allow-list классов,
где конструкторное внедрение невозможно (AspectJ-аспекты, logback-appender, self-
инъекция code lens, именованные бины). Это убирает FreezingArchRule целиком: удалены
каталог archunit_store/ (с нечитаемым .properties-store в \uXXXX) и archunit.properties.
Новый @Autowired вне списка по-прежнему валит сборку.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LkYRgB6NZZRRNZmBrdL54M
LSP-сервисы и холдеры лежали в корневом пакете languageserver вперемешку с
launcher'ом и прочим. Выделены в отдельный пакет lsp/ (симметрично mcp/):
сервисы BSLLanguageServer/BSLTextDocumentService/BSLWorkspaceService и холдеры
ClientCapabilitiesHolder/LanguageClientHolder (это чистые понятия LSP) — вместе
со своими тестами. Импорты обновлены по всему проекту; launcher (BSLLSPLauncher,
Main-Class) и не-LSP классы остаются в корне.

ArchUnit: добавлены слои Lsp и Mcp, правило для providers ужесточено до реальных
потребителей — providers вызывается только из голов lsp/cli/mcp (без layers
«про запас»).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LkYRgB6NZZRRNZmBrdL54M
Доперенесены оставшиеся классы протокола/жизненного цикла LSP из корня в lsp/:
AutoServerInfo (extends lsp4j ServerInfo), ParentProcessWatcher (слежение за
родительским процессом редактора), WorkDoneProgressHelper (LSP work-done
progress) и AnalyzeProjectOnStart (запуск анализа на старте сервера) — вместе
с тестами. AnalyzeProjectOnStart перенесён со своим resource-бандлом
(_ru/_en.properties): Resources грузит бандл по FQN класса, поэтому при смене
пакета ресурсы обязаны переезжать рядом.

В корне остались только bootstrap-классы: BSLLSPLauncher (Main-Class) и
BSLLSBinding (@ComponentScan-якорь).

ArchUnit: в allow-list правила про стандартные потоки обновлён FQN
ParentProcessWatcher на новый пакет.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LkYRgB6NZZRRNZmBrdL54M
github-actions Bot and others added 27 commits July 1, 2026 10:19
…c-syntax-supportconf-0.17.1

build(deps): bump io.github.1c-syntax:supportconf from 0.17.0 to 0.17.1
…e-bug-1zsoxe

fix(completion): сохранять типы полей элемента Соответствия в автокомплите
…ылок

Исправляет смешение ответственностей, возникшее из-за попытки обойти смелл S1448:

- дублирование убрано: resolveHyperlink (тип по строке) и резолв См.-ссылки в
  символ используют один обход resolveChain; из результата первый берёт тип
  возврата, второй — getSourceSymbol(). Удалены параллельные walkMembers/walkToMember;
- слой типов: резолв См.-ссылки снова на фасаде TypeService.resolveSeeReference
  (диспетч «тот же модуль / квалифицированная» внутри фасада); DocumentLink-саплаер
  ходит через фасад, а не напрямую в SymbolTypeIndex. Ценой известного смелла
  S1448 (TypeService большой; дробление — отдельно);
- presentation вынесен из домена: форматтер uri#L<line>,<col> переехал из
  context.symbol в доменно-независимый utils.NavigationLinks(URI, Range); им
  пользуются и hover, и documentlink.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QcYuuctkrfWkmGqXaUmx5S
…лой Hover→Utils

resolveChain не доходил до фолбэка на параметр (Модуль.Метод.Параметр),
если у промежуточного метода тип возврата UNKNOWN — а у процедур и
недокументированных функций он всегда такой. Теперь на последнем сегменте
пробуем разрешить его как имя параметра метода до выхода по UNKNOWN.

Также ArchitectureTest: Hover теперь легитимно зависит от Utils
(hover.SeeReferenceHyperlinks использует utils.NavigationLinks) — как и
прочие фичевые пакеты (Color, DocumentLink, Folding, InlayHints,
SemanticTokens).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QcYuuctkrfWkmGqXaUmx5S
При выводе типа переменной вида `Строка = Строка + "..."` рекурсивная
ссылка на саму переменную упиралась в guard циклов и резолвилась в пустой
набор. Ветка `+` в inferBinary трактовала пустой левый операнд как Число
(default), и это ложное Число подмешивалось в union — тип переменной
расширялся до "Строка, Число". В обратном порядке (`"..." + Строка`) левый
операнд — литерал, поэтому баг не проявлялся.

Причина глубже, чем ветка `+`: self-reference терял уже известный тип из
предыдущих присваиваний. Теперь inferVariable регистрирует переменную в
InferenceContext.inProgress и публикует растущий accumulator по мере
объединения присваиваний; при повторном входе (self-reference) возвращается
накопленный к этому моменту тип вместо EMPTY — one-pass фикс-точка.

Как следствие:
- выражение `Строка + "..."` корректно выводится в Строку (а не теряет тип);
- числовой аккумулятор `Число = Число + 1` остаётся Число;
- общая ветка `+` не изменена.

Closes #4205
selfConcatenationExpressionIsString указывал курсор на пробел после
оператора `+` (helper прибавляет +1 к колонке), где нет ни одного
терминала — findTerminalNodeContainsPosition возвращал пусто, и тип
получался EMPTY. Ставим курсор внутрь правого операнда: findExpressionContext
поднимается до ближайшего expression-узла (всего бинарного выражения),
и тип корректно выводится в Строку.

Сам фикс инференса не менялся: selfConcatenationVariableStaysString и
numericSelfAccumulatorStaysNumber в CI прошли — падал только этот тест
из-за позиции курсора.
…e-bug-yfsylp

fix(types): не расширять тип строки-аккумулятора до «Строка, Число» (#4205)
…ания

Отдельный компонент ради однострочного построения markdown-ссылки избыточен —
формирование ссылки перенесено прямо в VariableSymbolMarkupContentBuilder.sourceLink.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QcYuuctkrfWkmGqXaUmx5S
Резолв не привязан к «См.»: разрешает имя/квалифицированную ссылку в
определяющий символ — метод, общий модуль, менеджер справочника/документа,
любой тип с модульным отражением. Имя метода фасада отражает это, а не «см.».
Ветка имени типа целиком добавлена явно (resolve + definingSymbol), покрыта
тестом на ссылку в тип менеджера.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QcYuuctkrfWkmGqXaUmx5S
…34/S1142/S109)

Добавленный фолбэк на параметр раздул resolveChain до когнитивной сложности 32.
Дублированные блоки «последний сегмент — имя параметра метода» вынесены в
parameterChain(); убраны лишние вложенность, возвраты и magic number 2.
Поведение не изменилось (покрыто SymbolTypeIndexHyperlinkTest).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QcYuuctkrfWkmGqXaUmx5S
feat(types): резолв См.-ссылок в определение через type service + кликабельные ссылки в hover
When a client opens a single file (not a folder) VSCode sends `initialize`
with `workspaceFolders`, `rootUri` and `rootPath` all null. Since the
multi-workspace refactor `setConfigurationRoot` bailed out early in that case,
so no `ServerContext` was created; `didOpen` then failed to route the document
("No workspace found") and neither push nor pull diagnostics were produced.
The same happened to `untitled:` buffers even when real workspaces existed,
because their URI never prefix-matches a `file://` workspace root.

Create a default (headless) `ServerContext` at initialization when the client
provides no roots, with a null configuration root so `populateContext` scans
nothing. Track the first registered workspace as the "primary" context and add
`resolveContextForDocument`, which falls back to it for any document that does
not belong to a workspace root (untitled buffers, files opened outside all
roots, single-file mode). Document routing in `BSLTextDocumentService` uses the
new fallback; `getServerContext` keeps its strict containment semantics so
existing callers are unaffected. The synthetic default URI is excluded from
relative-pattern file watchers and never publishes `WorkspaceAddedEvent`, so
path-based watchers are not fed a non-file URI.

Fixes 1c-syntax/vsc-language-1c-bsl#375

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011chMESFUX9VKy4oCuTNcWB
SonarCloud flags `volatile` on a non-primitive reference (rule S3077),
dropping the reliability rating on new code. Replace the volatile URI field
with an AtomicReference and use compareAndSet for first-writer-wins, matching
the AtomicReference idiom already used elsewhere in the codebase.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011chMESFUX9VKy4oCuTNcWB
The tests share the singleton ServerContextProvider bean and relied on
per-test cleanup, which is skipped if an assertion fails mid-test — leaking
workspaces (or the default context) into the next test given JUnit 5's
unordered execution. Reset the provider before each test for isolation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011chMESFUX9VKy4oCuTNcWB
…vate

getPrimaryContext has no cross-package caller — it's used only internally by
resolveContextForDocument and by the same-package test. Keep the public surface
of ServerContextProvider minimal; registerDefaultWorkspace and
resolveContextForDocument stay public as they are invoked from the lsp package.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011chMESFUX9VKy4oCuTNcWB
Bumps [io.sentry.jvm.gradle](https://github.com/getsentry/sentry-android-gradle-plugin) from 6.13.0 to 6.14.0.
- [Release notes](https://github.com/getsentry/sentry-android-gradle-plugin/releases)
- [Changelog](https://github.com/getsentry/sentry-android-gradle-plugin/blob/main/CHANGELOG.md)
- [Commits](getsentry/sentry-android-gradle-plugin@6.13.0...6.14.0)

---
updated-dependencies:
- dependency-name: io.sentry.jvm.gradle
  dependency-version: 6.14.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
…vm.gradle-6.14.0

build(deps): bump io.sentry.jvm.gradle from 6.13.0 to 6.14.0
When initialize arrives without folders/rootUri, a synthetic default workspace
is created and marked primary. If a real workspace folder is then added at
runtime (workspace/didChangeWorkspaceFolders → addWorkspace), the previous logic
kept the empty default context as primary, so untitled buffers and orphan
documents kept routing to it instead of the freshly added project folder.

Track the primary preferring the first real workspace: the default becomes
primary only while no real folder exists and is displaced as soon as one is
added; removing the primary repoints to a remaining real workspace, falling back
to the default only as a last resort. Tests cover the runtime add/remove
scenarios after an empty initialize.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011chMESFUX9VKy4oCuTNcWB
The removed test drove the runtime workspace-add scenario via a direct
ServerContextProvider.addWorkspace call, duplicating the provider-level unit
tests without exercising real language-server wiring (the didChangeWorkspaceFolders
handler is fire-and-forget async, so an e2e variant would only add a flaky wait).
The runtime add/remove/promote contract stays covered in ServerContextProviderTest,
and initialize-without-root default creation is covered by
initializeWithoutWorkspaceRegistersDefaultWorkspace.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011chMESFUX9VKy4oCuTNcWB
Tighten initializeWithoutWorkspaceRegistersDefaultWorkspace: assert the untitled
document resolves to exactly the context stored under DEFAULT_WORKSPACE_URI
rather than merely being present, guarding the promoteToPrimary/getPrimaryContext
contract against regressions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011chMESFUX9VKy4oCuTNcWB
- repointPrimaryIfRemoved: replace the multi-line updateAndGet block lambda with
  a plain get/compute/set (S2211 "specify a type for 'current'"); behaviour is
  unchanged and reads more simply.
- ServerContextProviderTest: reword a prose comment that ended in ';' so Sonar no
  longer flags it as commented-out code (S125).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011chMESFUX9VKy4oCuTNcWB
The dedup rationale comment left in BSLLanguageServerTest used Class#method
tokens and a trailing ';', which Sonar reads as commented-out code. Drop it —
the rationale is preserved in the commit that removed the duplicate test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011chMESFUX9VKy4oCuTNcWB
…alize

After initialize() setConfigurationRoot always registers at least the default
workspace (or the real folders), so the primary context is an invariant, not an
optional. getPrimaryContext no longer returns an empty Optional when it is
unset/missing — it throws IllegalStateException, surfacing misuse (provider used
before initialize() or after shutdown()) instead of silently swallowing it.
Removed the test that legitimised the empty state.

To keep the invariant from breaking under the routing race, removeWorkspace now
repoints the primary to a surviving context BEFORE removing the workspace from
the map (excluding the one being removed), so primary never transiently points
to an already-removed context.

Note: the Optional return of getPrimaryContext/resolveContextForDocument is kept
to avoid rippling into the five getContextForDocument call sites; making them
non-Optional and dropping the now-unreachable "No workspace found" guards is a
sensible follow-up.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011chMESFUX9VKy4oCuTNcWB
- Add a test asserting resolveContextForDocument throws IllegalStateException
  when no workspace is registered, restoring coverage of the new throw branch
  (it replaces the deleted "returns empty" test with the loud-fail contract).
- Reword the comment in repointPrimaryBeforeRemoval so it no longer ends in ';'
  with code-like tokens, which Sonar mistook for commented-out code (S125).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011chMESFUX9VKy4oCuTNcWB
Sonar S5778: the lambda under assertThatThrownBy had two calls that can throw
(URI.create and resolveContextForDocument). Move URI.create out so only the
call under test can throw inside the lambda.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011chMESFUX9VKy4oCuTNcWB
Now that getPrimaryContext throws when the primary context is missing, both it
and resolveContextForDocument always return a context or fail loudly — the
Optional wrapper only ever held a present value. Return ServerContext directly.

getContextForDocument is non-null accordingly, so the five now-unreachable
"No workspace found" guards (didOpen/didChange/didClose/processDocumentChange/
withFreshDocumentContextInternal) and the NO_WORKSPACE_FOUND_MESSAGE constant
are removed; a missing primary now surfaces as an IllegalStateException instead
of a silent skip. Tests assert identity (isSameAs) instead of Optional.contains.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011chMESFUX9VKy4oCuTNcWB
…ng-3l4clt

fix(lsp): анализ одиночного файла и untitled-документов без workspace
@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 69d1e758-7f86-4716-b166-96d33dd81f4f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch develop

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nixel2007 nixel2007 merged commit dab0b69 into master Jul 4, 2026
50 checks passed
@sonarqubecloud

sonarqubecloud Bot commented Jul 4, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants