Skip to content

Переход на использование чтения описания методов и переменных bsl-parser#3753

Merged
nixel2007 merged 8 commits into
developfrom
feature/desriptions
Jan 14, 2026
Merged

Переход на использование чтения описания методов и переменных bsl-parser#3753
nixel2007 merged 8 commits into
developfrom
feature/desriptions

Conversation

@theshadowco

@theshadowco theshadowco commented Jan 8, 2026

Copy link
Copy Markdown
Member

Описание

  1. Удалены дублирующие bsl-parser-lib классы
  2. Удалено использование токенайзера для описаний

Связанные задачи

Closes

Чеклист

Общие

  • Ветка PR обновлена из develop
  • Отладочные, закомментированные и прочие, не имеющие смысла участки кода удалены
  • Изменения покрыты тестами
  • Обязательные действия перед коммитом выполнены (запускал команду gradlew precommit)

Для диагностик

  • Описание диагностики заполнено для обоих языков (присутствуют файлы для обоих языков, для русского заполнено все подробно, перевод на английский можно опустить)

Дополнительно

Summary by CodeRabbit

  • Refactor

    • Unified documentation/description model to a parser-driven representation, streamlining how links, types and fields are handled.
  • Bug Fixes

    • Improved hover content formatting for signatures, parameters and returned-value docs.
    • More accurate diagnostics for missing parameter/return descriptions.
    • Enhanced semantic tokenization for documentation fragments.
  • Chores

    • BSL parser dependency version updated.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Removed local description/model/parsing code and migrated usages to the bsl-parser dependency; call sites updated to import parser-provided description types, use factory methods, and adapt to SimpleRange/fields/links APIs.

Changes

Cohort / File(s) Summary
Build
build.gradle.kts
Bumped bsl-parser to 0.30.0-rc.2.
Deleted local description models
src/main/java/.../context/symbol/description/{DescriptionReader.java, MethodDescription.java, ParameterDescription.java, SourceDefinedSymbolDescription.java, TypeDescription.java}, src/main/java/.../context/symbol/description/package-info.java, src/main/java/.../context/symbol/variable/VariableDescription.java
Removed local description parsing/model classes and package-info.
Symbol computers
src/main/java/.../context/computer/{MethodSymbolComputer.java, VariableSymbolComputer.java}
Switched imports to parser types; replaced direct constructors with factory calls (MethodDescription.create(...), VariableDescription.create(...)).
Symbol types & signatures
src/main/java/.../context/symbol/{AbstractVariableSymbol.java, AnnotationParamSymbol.java, AnnotationSymbol.java, Describable.java, IntBasedVariableSymbol.java, MethodSymbol.java, ParameterDefinition.java, ShortBasedVariableSymbol.java, VariableSymbol.java}
Updated imports to com.github._1c_syntax.bsl.parser.description.*; variable description type in public signatures now references parser-provided types.
Diagnostics
src/main/java/.../languageserver/diagnostics/{CommentedCodeDiagnostic.java, DeprecatedMethodCallDiagnostic.java, LineLengthDiagnostic.java, MissingParameterDescriptionDiagnostic.java, MissingReturnedValueDescriptionDiagnostic.java}
Updated imports and logic to new APIs (getLinks(), fields()), and switched to SimpleRange for range handling.
Hover / formatting
src/main/java/.../languageserver/hover/{DescriptionFormatter.java, VariableSymbolMarkupContentBuilder.java}
Migrated to parser description types; refactored formatting (HyperlinkTypeDescription handling, inlined sections, removed getSectionWithCodeFences).
Semantic tokens
src/main/java/.../languageserver/semantictokens/{BslDocSemanticTokensSupplier.java, CommentSemanticTokensSupplier.java, SemanticTokensHelper.java}
Replaced AST/tokenizer parsing with DescriptionElement-driven processing; switched to SimpleRange; replaced addTerminalNodeRange with addDescriptionElement.
Tests
src/test/java/.../{context/computer/VariableSymbolTest.java, context/symbol/description/MethodDescriptionTest.java, diagnostics/MissingReturnedValueDescriptionDiagnosticTest.java, hover/MethodSymbolMarkupContentBuilderTest.java, providers/SemanticTokensProviderTest.java}
Updated imports/assertions for new parser API (SimpleRange, getLinks(), fields(), HyperlinkTypeDescription); adjusted semantic token and diagnostic expectations.
CI workflow
.github/workflows/benchmark.yml
Switched full clone to shallow clone (--depth 1) for SSL 3.1 download step.

Sequence Diagram(s)

sequenceDiagram
    actor Client
    participant LanguageServer
    participant Workspace as WorkspaceDB
    participant ParserLib as bsl-parser

    Client->>LanguageServer: Request hover / diagnostics / semantic tokens
    LanguageServer->>Workspace: Locate symbol & source tokens
    LanguageServer->>ParserLib: Description.create(tokens) / request description elements
    ParserLib-->>LanguageServer: Description, DescriptionElements, SimpleRange, Links, Fields
    LanguageServer->>LanguageServer: Build hover markup, diagnostics, semantic tokens
    LanguageServer-->>Client: Return hover / diagnostics / semantic tokens
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

hacktoberfest-accepted

Suggested reviewers

  • nixel2007

Poem

🐰 I nibbled old description trees,
Parser sprouts now sway in the breeze.
Factory hops and ranges small,
Links and fields replace it all,
A tidy burrow, code at ease. 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.52% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main objective: migrating to use bsl-parser for reading method and variable descriptions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings


📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 39d8831 and 27f2b6c.

📒 Files selected for processing (4)
  • .github/workflows/benchmark.yml
  • build.gradle.kts
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/computer/VariableSymbolComputer.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/context/computer/VariableSymbolTest.java

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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 and usage tips.

@github-actions

github-actions Bot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

Test Results

 2 817 files   2 817 suites   1h 3m 6s ⏱️
 1 162 tests  1 162 ✅ 0 💤 0 ❌
10 458 runs  10 458 ✅ 0 💤 0 ❌

Results for commit b051209.

♻️ This comment has been updated with latest results.

@theshadowco theshadowco changed the title Переход на использование чтение описания методов и переменных bsl-parser Переход на использование чтения описания методов и переменных bsl-parser Jan 8, 2026
@nixel2007
nixel2007 requested a review from Copilot January 10, 2026 15:50
@nixel2007 nixel2007 self-assigned this Jan 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request migrates from internal method and variable description parsing to using the bsl-parser library (v0.30.0-rc.1). The change removes ~550 lines of duplicate parsing logic and delegates description reading to the upstream bsl-parser library.

Changes:

  • Removed internal description classes (MethodDescription, VariableDescription, TypeDescription, ParameterDescription, DescriptionReader) in favor of bsl-parser equivalents
  • Updated semantic token supplier to use new description element API instead of re-parsing with tokenizer
  • Removed "call options" section support (now merged with examples)
  • Updated all imports and API calls throughout the codebase

Reviewed changes

Copilot reviewed 35 out of 36 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
build.gradle.kts Updated bsl-parser to 0.30.0-rc.1 and bsl-common-library to 0.9.2
DescriptionFormatter.java Refactored to use new HyperlinkTypeDescription API; removed getCallOptionsSection method
BslDocSemanticTokensSupplier.java Simplified to use getElements() API instead of re-tokenizing descriptions
SemanticTokensHelper.java Added addDescriptionElement method for new description element type
CommentSemanticTokensSupplier.java Updated to use SimpleRange instead of org.eclipse.lsp4j.Range
MissingReturnedValueDescriptionDiagnostic.java Updated API calls: getLink() → getLinks(), parameters() → fields()
MissingParameterDescriptionDiagnostic.java Updated API call: getLink() → getLinks()
LineLengthDiagnostic.java Updated to use SimpleRange
VariableSymbolComputer.java Updated to use VariableDescription.create() factory method
MethodSymbolComputer.java Updated to use MethodDescription.create() factory method
Multiple symbol classes Updated imports from internal to bsl-parser description classes
Test files Updated expectations for new API behavior (examples as String, type ordering changes, new hyperlink detection)
MethodDescription.bsl Moved "Варианты вызова" lines to "Пример" section reflecting parser changes

@theshadowco
theshadowco marked this pull request as ready for review January 12, 2026 14:24
@theshadowco

Copy link
Copy Markdown
Member Author

@coderabbitai
проведи ревью реквеста, он готов

@coderabbitai

coderabbitai Bot commented Jan 12, 2026

Copy link
Copy Markdown
Contributor

@theshadowco: Конечно, провожу ревью изменений в PR #3753.

Обратите внимание, что в описании PR отсутствует номер задачи после "Closes" — рекомендую добавить ссылку на соответствующий issue.


🧠 Learnings used
Learnt from: CR
Repo: 1c-syntax/bsl-language-server PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-18T18:49:48.712Z
Learning: Applies to docs/{en/,}diagnostics/**/*.md : Update diagnostic documentation in both Russian and English with examples of problematic code and fixes

Learnt from: theshadowco
Repo: 1c-syntax/bsl-language-server PR: 3610
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/folding/QueryPackageFoldingRangeSupplier.java:26-26
Timestamp: 2025-11-19T09:02:03.154Z
Learning: В проекте bsl-language-server используется кастомная версия ANTLR4 от 1c-syntax (io.github.1c-syntax:antlr4), которая включает базовый класс org.antlr.v4.runtime.Tokenizer с методами getAst() и getTokens(). SDBLTokenizer и BSLTokenizer наследуются от этого базового класса.
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
@src/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/BslDocSemanticTokensSupplier.java:
- Around line 26-27: Remove the unused import BSLDescriptionLexer from
BslDocSemanticTokensSupplier (the import at the top that reads
BSLDescriptionLexer); the class BslDocSemanticTokensSupplier no longer
references that type, so delete the import line and run your IDE's
optimize/imports or build to ensure no other unused imports remain.
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2844181 and dee6e84.

⛔ Files ignored due to path filters (1)
  • src/test/resources/context/symbol/MethodDescription.bsl is excluded by !src/test/resources/**
📒 Files selected for processing (34)
  • build.gradle.kts
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/computer/MethodSymbolComputer.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/computer/VariableSymbolComputer.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/AbstractVariableSymbol.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/AnnotationParamSymbol.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/AnnotationSymbol.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/Describable.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/IntBasedVariableSymbol.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/MethodSymbol.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/ParameterDefinition.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/ShortBasedVariableSymbol.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/VariableSymbol.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/description/DescriptionReader.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/description/MethodDescription.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/description/ParameterDescription.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/description/SourceDefinedSymbolDescription.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/description/TypeDescription.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/description/package-info.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/variable/VariableDescription.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/CommentedCodeDiagnostic.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/DeprecatedMethodCallDiagnostic.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/LineLengthDiagnostic.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingParameterDescriptionDiagnostic.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingReturnedValueDescriptionDiagnostic.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/hover/DescriptionFormatter.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/hover/VariableSymbolMarkupContentBuilder.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/BslDocSemanticTokensSupplier.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/CommentSemanticTokensSupplier.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/SemanticTokensHelper.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/context/computer/VariableSymbolTest.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/description/MethodDescriptionTest.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingReturnedValueDescriptionDiagnosticTest.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/hover/MethodSymbolMarkupContentBuilderTest.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/providers/SemanticTokensProviderTest.java
💤 Files with no reviewable changes (7)
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/description/ParameterDescription.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/description/DescriptionReader.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/description/SourceDefinedSymbolDescription.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/variable/VariableDescription.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/description/TypeDescription.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/description/package-info.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/description/MethodDescription.java
🧰 Additional context used
📓 Path-based instructions (5)
src/main/java/**/*.java

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/main/java/**/*.java: Follow the Style Guide for code formatting and conventions
Use Lombok annotations to reduce boilerplate code and enable annotation processing in IDE
Write JavaDoc for public APIs and include comments for complex logic
Use meaningful, descriptive names for classes and methods following Java naming conventions
Optimize imports before committing; DO NOT optimize imports across the entire project unless specifically working on that task

Files:

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/AnnotationParamSymbol.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/Describable.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/CommentSemanticTokensSupplier.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/IntBasedVariableSymbol.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/computer/MethodSymbolComputer.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/CommentedCodeDiagnostic.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/VariableSymbol.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/hover/VariableSymbolMarkupContentBuilder.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/SemanticTokensHelper.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/AnnotationSymbol.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/DeprecatedMethodCallDiagnostic.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/ShortBasedVariableSymbol.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingReturnedValueDescriptionDiagnostic.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/LineLengthDiagnostic.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/MethodSymbol.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/computer/VariableSymbolComputer.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingParameterDescriptionDiagnostic.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/BslDocSemanticTokensSupplier.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/ParameterDefinition.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/AbstractVariableSymbol.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/hover/DescriptionFormatter.java
src/**/*.java

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use Java 17 for language and follow Java naming conventions

Files:

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/AnnotationParamSymbol.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/Describable.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/providers/SemanticTokensProviderTest.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/CommentSemanticTokensSupplier.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/IntBasedVariableSymbol.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/computer/MethodSymbolComputer.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/CommentedCodeDiagnostic.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/VariableSymbol.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/hover/VariableSymbolMarkupContentBuilder.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingReturnedValueDescriptionDiagnosticTest.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/SemanticTokensHelper.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/AnnotationSymbol.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/context/computer/VariableSymbolTest.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/DeprecatedMethodCallDiagnostic.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/ShortBasedVariableSymbol.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingReturnedValueDescriptionDiagnostic.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/LineLengthDiagnostic.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/MethodSymbol.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/computer/VariableSymbolComputer.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingParameterDescriptionDiagnostic.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/description/MethodDescriptionTest.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/BslDocSemanticTokensSupplier.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/hover/MethodSymbolMarkupContentBuilderTest.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/ParameterDefinition.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/AbstractVariableSymbol.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/hover/DescriptionFormatter.java
src/test/java/**/*Test.java

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Maintain or improve test coverage and use appropriate test frameworks (JUnit, AssertJ, Mockito)

Files:

  • src/test/java/com/github/_1c_syntax/bsl/languageserver/providers/SemanticTokensProviderTest.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingReturnedValueDescriptionDiagnosticTest.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/context/computer/VariableSymbolTest.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/description/MethodDescriptionTest.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/hover/MethodSymbolMarkupContentBuilderTest.java
src/main/java/**/diagnostics/**/*.java

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Each diagnostic should have: Java implementation class, resource bundle for localized messages, unit tests, and documentation

Files:

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/CommentedCodeDiagnostic.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/DeprecatedMethodCallDiagnostic.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingReturnedValueDescriptionDiagnostic.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/LineLengthDiagnostic.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingParameterDescriptionDiagnostic.java
src/test/java/**/diagnostics/**/*Test.java

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Write comprehensive unit tests for each diagnostic including edge cases, following existing test patterns

Files:

  • src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingReturnedValueDescriptionDiagnosticTest.java
🧠 Learnings (12)
📓 Common learnings
Learnt from: CR
Repo: 1c-syntax/bsl-language-server PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-18T18:49:48.712Z
Learning: Applies to docs/{en/,}diagnostics/**/*.md : Update diagnostic documentation in both Russian and English with examples of problematic code and fixes
📚 Learning: 2025-12-28T11:15:32.357Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 0
File: :0-0
Timestamp: 2025-12-28T11:15:32.357Z
Learning: In PR #3706 about semantic token optimization, I incorrectly stated that the algorithm in findSuffixMatchWithOffset correctly handles inline text insertions (text insertion without line breaks). The actual bug is that when lineOffset=0, tokens after the insertion point have the same deltaLine but different deltaStart, and the old algorithm failed to match them because it checked deltaStart equality. PR #3707 fixes this by allowing deltaStart to differ for the boundary token when lineOffset==0.

Applied to files:

  • src/test/java/com/github/_1c_syntax/bsl/languageserver/providers/SemanticTokensProviderTest.java
📚 Learning: 2025-12-18T18:49:48.712Z
Learnt from: CR
Repo: 1c-syntax/bsl-language-server PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-18T18:49:48.712Z
Learning: Applies to docs/{en/,}diagnostics/**/*.md : Update diagnostic documentation in both Russian and English with examples of problematic code and fixes

Applied to files:

  • src/test/java/com/github/_1c_syntax/bsl/languageserver/providers/SemanticTokensProviderTest.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/CommentedCodeDiagnostic.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingReturnedValueDescriptionDiagnosticTest.java
📚 Learning: 2025-11-19T09:02:03.154Z
Learnt from: theshadowco
Repo: 1c-syntax/bsl-language-server PR: 3610
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/folding/QueryPackageFoldingRangeSupplier.java:26-26
Timestamp: 2025-11-19T09:02:03.154Z
Learning: В проекте bsl-language-server используется кастомная версия ANTLR4 от 1c-syntax (io.github.1c-syntax:antlr4), которая включает базовый класс org.antlr.v4.runtime.Tokenizer с методами getAst() и getTokens(). SDBLTokenizer и BSLTokenizer наследуются от этого базового класса.

Applied to files:

  • src/test/java/com/github/_1c_syntax/bsl/languageserver/providers/SemanticTokensProviderTest.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/computer/MethodSymbolComputer.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/CommentedCodeDiagnostic.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/computer/VariableSymbolComputer.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/BslDocSemanticTokensSupplier.java
📚 Learning: 2025-04-18T22:46:43.245Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 3449
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/utils/expressiontree/ExpressionTreeBuildingVisitor.java:192-203
Timestamp: 2025-04-18T22:46:43.245Z
Learning: В проекте bsl-language-server класс BSLParser.ExpressionContext наследуется от BSLParserRuleContext, а не напрямую от ParserRuleContext. При работе с ним нужно учитывать специфичные методы BSLParserRuleContext.

Applied to files:

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/computer/MethodSymbolComputer.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/computer/VariableSymbolComputer.java
📚 Learning: 2025-12-18T18:49:48.712Z
Learnt from: CR
Repo: 1c-syntax/bsl-language-server PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-18T18:49:48.712Z
Learning: Applies to src/main/java/**/diagnostics/**/*.java : Each diagnostic should have: Java implementation class, resource bundle for localized messages, unit tests, and documentation

Applied to files:

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/CommentedCodeDiagnostic.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingReturnedValueDescriptionDiagnosticTest.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingReturnedValueDescriptionDiagnostic.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/LineLengthDiagnostic.java
📚 Learning: 2025-01-19T20:47:40.061Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 3388
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/codelens/TestRunnerAdapterOptions.java:46-46
Timestamp: 2025-01-19T20:47:40.061Z
Learning: Configuration classes in the BSL Language Server project use mutable collections (HashMap, ArrayList) and Data annotation from Lombok, allowing for modification of configuration properties after initialization.

Applied to files:

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/hover/VariableSymbolMarkupContentBuilder.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/hover/DescriptionFormatter.java
📚 Learning: 2025-01-19T21:34:39.797Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 3388
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/codelens/TestRunnerAdapterOptions.java:46-46
Timestamp: 2025-01-19T21:34:39.797Z
Learning: In BSL Language Server configuration classes, immutable collections (Set.of, List.of) should be used for default values, while mutability is achieved through setters generated by Data annotation.

Applied to files:

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/hover/VariableSymbolMarkupContentBuilder.java
📚 Learning: 2025-02-10T17:12:56.150Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 3408
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/ProtectedModuleDiagnostic.java:63-66
Timestamp: 2025-02-10T17:12:56.150Z
Learning: In BSL Language Server, `documentContext.getServerContext().getConfiguration()` is guaranteed to return a non-null value, making null checks unnecessary.

Applied to files:

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/hover/VariableSymbolMarkupContentBuilder.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/BslDocSemanticTokensSupplier.java
📚 Learning: 2025-12-18T18:49:48.712Z
Learnt from: CR
Repo: 1c-syntax/bsl-language-server PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-18T18:49:48.712Z
Learning: Applies to src/test/java/**/diagnostics/**/*Test.java : Write comprehensive unit tests for each diagnostic including edge cases, following existing test patterns

Applied to files:

  • src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingReturnedValueDescriptionDiagnosticTest.java
📚 Learning: 2025-02-10T17:13:41.452Z
Learnt from: theshadowco
Repo: 1c-syntax/bsl-language-server PR: 3408
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/ProtectedModuleDiagnostic.java:54-58
Timestamp: 2025-02-10T17:13:41.452Z
Learning: In ProtectedModuleDiagnostic.java, the usage of `Range` field as a diagnostic target is accepted as is, despite being marked as a temporary solution in the comments.

Applied to files:

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/LineLengthDiagnostic.java
📚 Learning: 2025-01-19T21:44:32.675Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 3388
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunAllTestsCodeLensSupplier.java:47-47
Timestamp: 2025-01-19T21:44:32.675Z
Learning: В классах-наследниках AbstractRunTestsCodeLensSupplier метод getSelf() должен возвращать this вместо использования Spring-based self-reference, чтобы избежать проблем с циклическими зависимостями и timing issues при тестировании.

Applied to files:

  • src/test/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/description/MethodDescriptionTest.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
  • GitHub Check: Analyse
  • GitHub Check: build
  • GitHub Check: build (21, ubuntu-latest)
  • GitHub Check: build (21, macOS-latest)
  • GitHub Check: build (25, windows-latest)
  • GitHub Check: build (17, macOS-latest)
  • GitHub Check: build (25, ubuntu-latest)
  • GitHub Check: build (17, windows-latest)
  • GitHub Check: build (25, macOS-latest)
  • GitHub Check: build (21, windows-latest)
  • GitHub Check: build (17, ubuntu-latest)
  • GitHub Check: Sentry
🔇 Additional comments (62)
src/test/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/description/MethodDescriptionTest.java (13)

26-28: LGTM!

The imports correctly reference the new com.github._1c_syntax.bsl.parser.description package, aligning with the PR's objective to migrate description parsing to the bsl-parser dependency.


86-86: LGTM!

Correctly migrated from getLink() (single optional) to getLinks() (collection), with appropriate isEmpty() assertion.


124-124: LGTM!

API change from parameters() to fields() is correctly applied for accessing type description sub-elements.


138-145: LGTM!

The test properly validates the new HyperlinkTypeDescription type:

  • Uses instanceof check before casting (safe pattern)
  • Correctly accesses hyperlink() on the cast type
  • Uses Hyperlink.create() factory method for expected value comparison

158-164: LGTM!

Test correctly validates hyperlink parameters with the new API, including the additional types().hasSize(1) assertion that improves test coverage.


178-178: LGTM!

Correctly uses contains() assertion for the collection-based getLinks() API.


217-223: Verify the expected counts align with the new parser behavior.

The expected sizes for getExamples() (73) and getCallOptions() (103) have changed significantly. Ensure these values correctly reflect the new bsl-parser's description parsing logic and are not a regression.


246-252: LGTM!

Test expectations updated to reflect the new parser's example extraction behavior.


283-288: LGTM!

Assertions correctly updated for the new call options parsing behavior.


300-428: LGTM!

Comprehensive test coverage for nested type structures with consistent API migration from parameters() to fields(). The changes to type names (e.g., "Массив<Структура>") and description value shifts reflect the new parser's improved handling of parameterized types.


192-192: LGTM!

Consistent getLinks() API usage.


265-273: LGTM!

The fields() accessor is correctly used for type description sub-elements throughout testMethod4.


444-444: LGTM!

Final test method correctly updated for the getLinks() API.

src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/IntBasedVariableSymbol.java (1)

26-26: Import migration looks correct.

The import of VariableDescription is correctly updated to the new com.github._1c_syntax.bsl.parser.description package, consistent with the broader refactor migrating description types to the bsl-parser dependency.

src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/ParameterDefinition.java (1)

26-26: Import migration is consistent with the refactor.

The ParameterDescription import correctly points to the new com.github._1c_syntax.bsl.parser.description package, aligning with the migration of description types to the parser library.

src/main/java/com/github/_1c_syntax/bsl/languageserver/context/computer/MethodSymbolComputer.java (3)

36-37: Import migration to parser.description package.

The imports for MethodDescription and ParameterDescription are correctly updated to the new com.github._1c_syntax.bsl.parser.description package.


231-238: Factory method usage for MethodDescription creation is correct.

The change from constructor instantiation to MethodDescription.create(comments) factory method aligns with the new API in bsl-parser (version 0.30.0-rc.2). The factory method signature correctly accepts List<Token> and returns MethodDescription, which is properly wrapped in Optional.of() to match the method's return type. This is a clean approach that encapsulates the creation logic within the parser library.


321-330: No action required. The MethodDescription.getParameters() API returns a collection of ParameterDescription objects with accessible name() method. This contract is already validated across 40+ usages throughout the codebase and test coverage exists. No compatibility issues are evident.

src/test/java/com/github/_1c_syntax/bsl/languageserver/providers/SemanticTokensProviderTest.java (4)

421-425: Test expectations updated for consolidated documentation tokens.

The token expectations correctly reflect the new tokenization behavior where documentation fragments like " - " and " - описание" are now represented as single Comment tokens instead of being split into multiple tokens. This aligns with the parser.description migration that consolidates documentation parsing.


510-514: Consistent consolidation of parameter description tokens.

The test correctly expects consolidated Comment tokens for documentation fragments in parameter descriptions. The length values (3 for " - ", 19 for " - имя пользователя") accurately reflect the single-token representation.


520-524: Parameter documentation token expectations aligned.

These changes maintain consistency with the consolidated tokenization approach for " - " separators and trailing descriptions like " - возраст".


536-536: Return value description token consolidated.

The return value documentation " - результат проверки" is correctly expected as a single Comment token with length 21, consistent with the other documentation fragment changes.

build.gradle.kts (2)

85-85: > Likely an incorrect or invalid review comment.


92-92: Minor version bump for bsl-common-library looks appropriate.

The update from 0.9.1 to 0.9.2 is a patch version increment introducing new types, which is backward compatible.

src/test/java/com/github/_1c_syntax/bsl/languageserver/hover/MethodSymbolMarkupContentBuilderTest.java (1)

71-118: Test expectations correctly updated for the bsl-parser migration.

The test assertions have been updated to reflect the new formatting output from the bsl-parser description classes. Key changes include:

  • Method signature now shows inline parameter types (Line 73)
  • Parameter descriptions use non-breaking spaces (&nbsp;) for alignment (Lines 82-84)
  • Link format simplified from [См. ОбщийМодуль.СуперМетод()] to [ОбщийМодуль.СуперМетод] (Line 99)
  • Return value block restructured with different indentation (Lines 110-116)

These changes maintain test coverage for the hover functionality with the new parser-based descriptions.

src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/ShortBasedVariableSymbol.java (1)

26-26: LGTM!

The import change correctly migrates VariableDescription to the bsl-parser package. The class's functionality remains unchanged as the type is only used in the constructor parameter and passed to the parent class.

src/main/java/com/github/_1c_syntax/bsl/languageserver/hover/VariableSymbolMarkupContentBuilder.java (1)

27-27: LGTM!

The import migration is correct. The code continues to use getPurposeDescription() and getTrailingDescription() methods from VariableDescription - these APIs are expected to be available in the bsl-parser package version.

src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/AnnotationParamSymbol.java (1)

25-25: LGTM!

The import change correctly aligns with the broader migration. The MethodDescription type is used for the description field and obtained from MethodSymbol.getDescription(), which should also return the parser-based type after this PR.

src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/CommentedCodeDiagnostic.java (1)

36-36: Import migration to bsl-parser library is correct.

The import change aligns with a coordinated codebase refactoring—11 files across the project have been migrated to use com.github._1c_syntax.bsl.parser.description.MethodDescription. The contains(first, last) method usage at line 169 is consistent with the external parser library's API, confirmed by successful test coverage in MethodDescriptionTest.java.

src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingReturnedValueDescriptionDiagnosticTest.java (1)

62-76: LGTM!

The test correctly expands coverage to include a new diagnostic case for the complex type ФайловаяСистемаКлиент.ПараметрыЗагрузкиФайла. The assertion follows the existing test pattern and validates that the migration to bsl-parser properly detects this additional scenario.

src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/AnnotationSymbol.java (1)

25-25: LGTM!

The import migration from the local description package to com.github._1c_syntax.bsl.parser.description.MethodDescription aligns with the PR objective to centralize description types in the parser library.

src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/Describable.java (1)

24-24: LGTM!

The import migration for SourceDefinedSymbolDescription is consistent with the centralization of description types in the parser library. The interface contract remains unchanged.

src/test/java/com/github/_1c_syntax/bsl/languageserver/context/computer/VariableSymbolTest.java (2)

29-30: LGTM!

The imports correctly reflect the migration: VariableDescription now comes from the parser library, and SimpleRange is the parser's range representation used for description ranges.


99-117: LGTM!

The assertions are correctly updated to use SimpleRange.create() for VariableDescription ranges while keeping Ranges.create() for LSP4J-based VariableSymbol ranges. This properly reflects the separation between parser-level types (SimpleRange) and language server types (Range).

src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/DeprecatedMethodCallDiagnostic.java (1)

32-32: LGTM! The import migration to com.github._1c_syntax.bsl.parser.description.SourceDefinedSymbolDescription is correct, and the getDeprecationInfo() method call at line 71 is compatible with the parser library's implementation. Tests confirm the method works as expected.

src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingParameterDescriptionDiagnostic.java (2)

30-31: LGTM!

Import updates correctly reference the new com.github._1c_syntax.bsl.parser.description package as part of the migration from local description classes to the parser library.


85-88: LGTM!

API adaptation from getLink() to getLinks() correctly handles the transition from a single link to a collection of links. The logic remains intact—treating presence of any link as sufficient documentation.

src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/MethodSymbol.java (1)

28-28: LGTM!

Import update correctly migrates MethodDescription dependency to the parser library. The field declaration and usage remain unchanged.

src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingReturnedValueDescriptionDiagnostic.java (3)

30-31: LGTM!

Import updates correctly reference the new com.github._1c_syntax.bsl.parser.description package for MethodDescription and TypeDescription.


88-91: LGTM!

API adaptation from getLink() to getLinks() is consistent with the migration pattern across the codebase.


102-106: No action required—the current implementation is correct.

The code uses typeDescription.fields().isEmpty(), which is the correct API for accessing nested type structure in the TypeDescription interface from the bsl-parser library. The logic properly filters for simple types lacking both description and nested fields. This implementation is validated by comprehensive test coverage in MethodDescriptionTest.java and consistent usage throughout the codebase.

Likely an incorrect or invalid review comment.

src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/LineLengthDiagnostic.java (2)

32-33: LGTM!

Import updates correctly reference MethodDescription from the parser library and add SimpleRange for lightweight range handling.


148-162: LGTM!

The migration from Range to SimpleRange is implemented correctly:

  • Line offset handling (+1) properly accounts for 0-based SimpleRange vs 1-based token line numbers
  • Record accessor syntax (startLine(), endLine()) replaces getter methods
  • SimpleRange.containsRange and SimpleRange.create(token) provide equivalent functionality
src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/AbstractVariableSymbol.java (1)

26-26: LGTM!

Import update correctly migrates VariableDescription dependency to the parser library. The field declaration and usage pattern remain unchanged.

src/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/CommentSemanticTokensSupplier.java (3)

27-30: LGTM! Import migration to parser.description package.

The imports are correctly updated to use the parser-based description types and SimpleRange for range operations related to description handling.


81-104: LGTM! Correct migration to SimpleRange for description range tracking.

The code correctly:

  • Uses SimpleRange for tracking description ranges (line 81)
  • Creates comment ranges via SimpleRange.create(commentToken) (line 101)
  • Uses SimpleRange.containsRange() for containment checks (line 104)

The continued use of Ranges.create() in addSingleLineCommentTokens (line 126) and addMultilineCommentTokens (line 162) is appropriate since those methods feed into helper.addRange() which expects LSP Range objects.


181-186: LGTM! Updated method signature and isEmpty check.

The method signature correctly accepts List<SimpleRange> and uses range.isEmpty() instead of Ranges.isEmpty(range). The SimpleRange.isEmpty() instance method is correctly called on the range object returned from description.getRange().

src/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/SemanticTokensHelper.java (2)

24-24: LGTM! Import updated for new description element model.

The import correctly reflects the shift from AST-based TerminalNode to the data-driven DescriptionElement approach.


167-173: LGTM! Clean implementation using DescriptionElement.

The new addDescriptionElement method properly extracts range information from the element and delegates to addEntry. This is more direct than the previous TerminalNode-based approach.

Note: Unlike addTokenRange which has a null check (line 142), this method assumes non-null elements. If callers may pass null elements, consider adding @Nullable annotation and a null guard.

src/main/java/com/github/_1c_syntax/bsl/languageserver/context/computer/VariableSymbolComputer.java (5)

34-34: LGTM! Import updated to parser.description package.

The import correctly points to the migrated VariableDescription class in the parser library.


237-239: LGTM! Factory method usage for VariableDescription.

Correctly using VariableDescription.create(Collections.emptyList(), trailingComments) instead of the constructor, consistent with the migration to the parser library's factory-based API.


249-251: LGTM!

Consistent factory method usage for ForEachStatement context.


261-263: LGTM!

Consistent factory method usage for ForStatement context.


282-282: LGTM!

Factory method correctly passes both comments and trailingComments for module/sub variable declarations that may have leading comments.

src/main/java/com/github/_1c_syntax/bsl/languageserver/hover/DescriptionFormatter.java (5)

30-33: LGTM! Import updates for parser.description migration.

Imports correctly updated to reference types from the parser library, including the new HyperlinkTypeDescription for hyperlink type handling.


122-127: Simplified call options section handling.

Same pattern as examples - expects getCallOptions() to return a single String rather than a collection.


322-326: LGTM! Pattern matching for hyperlink type detection.

Using instanceof HyperlinkTypeDescription with pattern variable extraction is cleaner than the previous type.isHyperlink() approach and directly provides access to the hyperlink() method.


353-358: API accessor change from parameters() to fields().

The TypeDescription API now uses fields() instead of parameters() to access nested field descriptions. This naming better reflects that these represent structured type fields rather than method parameters.


114-119: Simplified examples section handling.

The implementation correctly expects getExamples() to return a single String (not a collection). The logic:

  • Filters empty strings using .isEmpty()
  • Wraps non-empty content in a code fence with the localized header

This aligns with the parser library's API where examples are pre-concatenated into a single string.

src/main/java/com/github/_1c_syntax/bsl/languageserver/context/symbol/VariableSymbol.java (1)

25-25: LGTM! Import migration for VariableDescription.

The import correctly points to the parser library's VariableDescription. The public API method signature at line 45 remains unchanged (Optional<VariableDescription> getDescription()), but now references the migrated type.

src/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/BslDocSemanticTokensSupplier.java (2)

102-113: LGTM! Updated range accessors.

Correctly uses range.isEmpty(), range.startLine(), and range.startCharacter() from the SimpleRange API.


118-127: LGTM! Clean element-based semantic token generation.

The switch expression elegantly maps description element types to semantic token types:

  • TYPE_NAMESemanticTokenTypes.Type
  • PARAMETER_NAMESemanticTokenTypes.Parameter
  • Documentation keywords → SemanticTokenTypes.Macro
  • Unknown types return "" which is safely handled (skipped by addEntry when type index is -1)

This data-driven approach is cleaner than the previous AST/tokenizer-based logic.

@theshadowco
theshadowco requested a review from nixel2007 January 12, 2026 14:47
@sonarqubecloud

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