Skip to content
Merged

0.27.0 #3733

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
382e4db
Bump actions/upload-artifact from 5 to 6
dependabot[bot] Dec 29, 2025
278eae9
Merge pull request #3713 from 1c-syntax/dependabot/github_actions/act…
github-actions[bot] Dec 29, 2025
7154dc6
Initial plan
Copilot Dec 29, 2025
9e98aa5
Add configurable template function highlighting for semantic tokens
Copilot Dec 29, 2025
0c6881a
Address code review: add null safety checks
Copilot Dec 29, 2025
280b16c
Initial plan
Copilot Dec 29, 2025
433955f
feat: Add ModuleReferenceSemanticTokensSupplier for highlighting comm…
Copilot Dec 29, 2025
6853a84
refactor: Remove redundant isSourceDefinedSymbolReference filter for …
Copilot Dec 29, 2025
1bc34a4
feat: Add explicit CommonModule type check for module references
Copilot Dec 29, 2025
f7f1a53
style: Use import instead of fully qualified class name for Symbol
Copilot Dec 29, 2025
330620d
test: Add tests to verify variable with common module is not highligh…
Copilot Dec 29, 2025
11a5848
Merge pull request #3715 from 1c-syntax/copilot/highlight-namespace-i…
nixel2007 Dec 29, 2025
dfe9a0e
Merge branch 'develop' into copilot/refactor-string-function-parameters
nixel2007 Dec 29, 2025
98e8a73
Initial plan
Copilot Dec 29, 2025
b564116
Remove non-documented methods from strTemplateMethods defaults
Copilot Dec 29, 2025
8633373
Add NewExpressionSemanticTokensSupplier to highlight type names after…
Copilot Dec 29, 2025
2d52ed8
Add local call methods to strTemplateMethods defaults
Copilot Dec 30, 2025
e2dac8b
Add event listener for configuration changes in StringSemanticTokensS…
Copilot Dec 30, 2025
359b714
Move ParsedStrTemplateMethods to separate class and clean up null checks
Copilot Dec 30, 2025
0a5ce3f
Рефакторинг реализации и тестов
nixel2007 Dec 30, 2025
bf84c42
Рефакторинг тестов
nixel2007 Dec 30, 2025
1cb9cc0
Merge pull request #3716 from 1c-syntax/copilot/add-type-coloring-fea…
nixel2007 Dec 30, 2025
799e037
Merge branch 'develop' into copilot/refactor-string-function-parameters
nixel2007 Dec 30, 2025
d81c817
Refactor StringSemanticTokensSupplierTest to use SemanticTokensTestHe…
Copilot Dec 30, 2025
f20814e
Fix imports in SemanticTokensOptions
Copilot Dec 30, 2025
c003a24
Rewrite all tests to use ExpectedToken pattern
Copilot Dec 30, 2025
e8e067d
Add tests for case-insensitive method name matching
Copilot Dec 30, 2025
bc8faac
Add setter-based caching for SemanticTokensOptions and unit tests
Copilot Dec 30, 2025
8aec16e
Initialize parsedStrTemplateMethods field directly to avoid null check
Copilot Dec 30, 2025
e5b5781
Merge pull request #3714 from 1c-syntax/copilot/refactor-string-funct…
nixel2007 Dec 30, 2025
349c5d1
Initial plan
Copilot Jan 1, 2026
89885c8
Skip empty publishDiagnostics on didClose when client supports pull d…
Copilot Jan 1, 2026
0ba2aac
Add test coverage for didClose diagnostic publishing behavior
Copilot Jan 2, 2026
86a4354
Initial plan
Copilot Jan 2, 2026
efb4d6d
Fix NullPointerException in ExpressionTreeBuildingVisitor for incompl…
Copilot Jan 2, 2026
d6e3e22
Improve comment explaining null expression handling in visitTernaryOp…
Copilot Jan 2, 2026
a99503a
Исправлена версия докер-контейнера для codespace
nixel2007 Jan 2, 2026
67104f4
Исправлена потенциальная гонка при закрытии документа в BSLTextDocume…
nixel2007 Jan 2, 2026
6b92861
Initial plan
Copilot Jan 2, 2026
e0fe3a4
Simplify test approach by mocking clientCapabilitiesHolder directly
Copilot Jan 2, 2026
e2c80ca
Add logging and extract timeout constant for document close termination
Copilot Jan 2, 2026
fb345fb
Add test coverage for document close race conditions
Copilot Jan 2, 2026
ff642f4
Fix grammar in log message: 'second' -> 'seconds'
Copilot Jan 2, 2026
b286fdd
Happy new year
nixel2007 Jan 2, 2026
48a4e2b
Add HNY 2026
nixel2007 Jan 2, 2026
69ef76f
Merge remote-tracking branch 'origin/master' into develop
nixel2007 Jan 2, 2026
bdd0d41
Merge branch 'develop' into copilot/check-empty-publish-diagnostics
nixel2007 Jan 2, 2026
a11189a
Merge pull request #3721 from 1c-syntax/copilot/check-empty-publish-d…
nixel2007 Jan 2, 2026
f8eaffe
Merge branch 'develop' into copilot/fix-nullpointerexception-bsl-parser
nixel2007 Jan 2, 2026
f8abc95
Merge branch 'develop' into fix/possible-race-on-did-close
nixel2007 Jan 2, 2026
c6986b0
Merge pull request #3723 from 1c-syntax/copilot/fix-nullpointerexcept…
nixel2007 Jan 2, 2026
9f00ce2
Merge remote-tracking branch 'origin/copilot/sub-pr-3724' into fix/po…
nixel2007 Jan 2, 2026
4b3c193
Merge pull request #3724 from 1c-syntax/fix/possible-race-on-did-close
nixel2007 Jan 2, 2026
7f5871e
Update mdclasses dependency version to 0.17.1
nixel2007 Jan 2, 2026
fe3fef5
Merge pull request #3726 from 1c-syntax/nixel2007-patch-1
nixel2007 Jan 2, 2026
c475dbf
Initial plan
Copilot Jan 2, 2026
6dc20aa
Fix NullPointerException in UselessTernaryOperatorDiagnostic
Copilot Jan 2, 2026
9f3ab19
Use getChildCount() and improve test with assertj
Copilot Jan 2, 2026
267ce98
Use assertThatCode with lambda to test getDiagnostics doesn't throw
Copilot Jan 2, 2026
9c1f478
Merge pull request #3728 from 1c-syntax/copilot/fix-nullpointerexcept…
nixel2007 Jan 2, 2026
a2bf8d9
Исправлено двойное заполнение ReferenceIndex при построении контекста
nixel2007 Jan 4, 2026
de0ee24
Переделка модели блокировок при заполнении контекста.
nixel2007 Jan 4, 2026
23af142
В ховер добавлена информация о месте объявления переменной
nixel2007 Jan 4, 2026
6ee2db2
Initial plan
Copilot Jan 4, 2026
37b08cc
Address review comments: fix test lock handling, JavaDoc formatting, …
Copilot Jan 4, 2026
9f79828
Merge pull request #3731 from 1c-syntax/copilot/sub-pr-3729
nixel2007 Jan 4, 2026
e74fae3
Merge pull request #3730 from 1c-syntax/feature/variable-info-in-hover
nixel2007 Jan 4, 2026
9f2b23d
Fix version retrieval in getEnvironment method to use serverInfo
nixel2007 Jan 4, 2026
455c9cc
Merge pull request #3732 from 1c-syntax/fix/sentry-release-detection
nixel2007 Jan 4, 2026
6acf373
Merge pull request #3729 from 1c-syntax/fix/lock-race
nixel2007 Jan 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Java",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/java:1-25-bookworm",
"image": "mcr.microsoft.com/devcontainers/java:25-jdk-bookworm",

"features": {
"ghcr.io/devcontainers/features/java:1": {
Expand Down
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# happy new year 2026
b286fdd9efe4754aebabc861310637d8ae7783c2
# happy new year 2025
e84a3f81035a6e76c042b406d5ad6e986a91d8e1
# happy new year 2024
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
path: "**/test-results/test/**/*.xml"
- name: Publish Test report
if: failure()
uses: actions/upload-artifact@v5
uses: actions/upload-artifact@v6
with:
name: junit_report_${{ matrix.os }}_${{ matrix.java_version }}
path: build/reports/tests/test
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ dependencies {
exclude("org.antlr", "antlr-runtime")
}
api("io.github.1c-syntax", "utils", "0.6.8")
api("io.github.1c-syntax", "mdclasses", "0.17.0")
api("io.github.1c-syntax", "mdclasses", "0.17.1")
api("io.github.1c-syntax", "bsl-common-library", "0.9.0")
api("io.github.1c-syntax", "supportconf", "0.15.0")

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of BSL Language Server.
*
* Copyright (c) 2018-2025
* Copyright (c) 2018-2026
* Alexey Sosnoviy <[email protected]>, Nikita Fedkin <[email protected]> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of BSL Language Server.
*
* Copyright (c) 2018-2025
* Copyright (c) 2018-2026
* Alexey Sosnoviy <[email protected]>, Nikita Fedkin <[email protected]> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of BSL Language Server.
*
* Copyright (c) 2018-2025
* Copyright (c) 2018-2026
* Alexey Sosnoviy <[email protected]>, Nikita Fedkin <[email protected]> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of BSL Language Server.
*
* Copyright (c) 2018-2025
* Copyright (c) 2018-2026
* Alexey Sosnoviy <[email protected]>, Nikita Fedkin <[email protected]> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of BSL Language Server.
*
* Copyright (c) 2018-2025
* Copyright (c) 2018-2026
* Alexey Sosnoviy <[email protected]>, Nikita Fedkin <[email protected]> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of BSL Language Server.
*
* Copyright (c) 2018-2025
* Copyright (c) 2018-2026
* Alexey Sosnoviy <[email protected]>, Nikita Fedkin <[email protected]> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of BSL Language Server.
*
* Copyright (c) 2018-2025
* Copyright (c) 2018-2026
* Alexey Sosnoviy <[email protected]>, Nikita Fedkin <[email protected]> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of BSL Language Server.
*
* Copyright (c) 2018-2025
* Copyright (c) 2018-2026
* Alexey Sosnoviy <[email protected]>, Nikita Fedkin <[email protected]> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down Expand Up @@ -47,6 +47,7 @@
import com.github._1c_syntax.bsl.languageserver.providers.SelectionRangeProvider;
import com.github._1c_syntax.bsl.languageserver.providers.SemanticTokensProvider;
import com.github._1c_syntax.bsl.languageserver.utils.Ranges;
import com.github._1c_syntax.utils.Absolute;
import jakarta.annotation.PreDestroy;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand Down Expand Up @@ -140,6 +141,7 @@
public class BSLTextDocumentService implements TextDocumentService, ProtocolExtension {

private static final long AWAIT_CLOSE = 30;
private static final long AWAIT_FORCE_TERMINATION = 1;

private final ServerContext context;
private final LanguageServerConfiguration configuration;
Expand Down Expand Up @@ -184,7 +186,7 @@ private void onDestroy() {
return CompletableFuture.completedFuture(null);
}

return withFreshDocumentContext(
return withFreshDocumentContextNullable(
documentContext,
() -> hoverProvider.getHover(documentContext, params).orElse(null)
);
Expand Down Expand Up @@ -328,7 +330,7 @@ public CompletableFuture<List<FoldingRange>> foldingRange(FoldingRangeRequestPar
return CompletableFuture.completedFuture(null);
}

return withFreshDocumentContext(
return withFreshDocumentContextNullable(
documentContext,
() -> {
List<CallHierarchyItem> callHierarchyItems = callHierarchyProvider.prepareCallHierarchy(documentContext, params);
Expand Down Expand Up @@ -466,51 +468,68 @@ public CompletableFuture<List<InlayHint>> inlayHint(InlayHintParams params) {
@Override
public void didOpen(DidOpenTextDocumentParams params) {
var textDocumentItem = params.getTextDocument();
var documentContext = context.addDocument(URI.create(textDocumentItem.getUri()));

// Create single-threaded executor for this document to serialize didChange operations
var uri = documentContext.getUri();
documentExecutors.computeIfAbsent(uri, key ->
new DocumentChangeExecutor(
documentContext,
BSLTextDocumentService::applyTextDocumentChanges,
this::processDocumentChange,
"doc-" + documentContext.getUri() + "-"
)
);
var uri = Absolute.uri(textDocumentItem.getUri());
var lock = context.getDocumentLock(uri);
lock.writeLock().lock();

try {
var documentContext = context.addDocument(uri);

// Create single-threaded executor for this document to serialize didChange operations
documentExecutors.computeIfAbsent(uri, key ->
new DocumentChangeExecutor(
documentContext,
BSLTextDocumentService::applyTextDocumentChanges,
this::processDocumentChange,
"doc-" + documentContext.getUri() + "-"
)
);

context.openDocument(documentContext, textDocumentItem.getText(), textDocumentItem.getVersion());
context.openDocument(documentContext, textDocumentItem.getText(), textDocumentItem.getVersion());

if (configuration.getDiagnosticsOptions().getComputeTrigger() != ComputeTrigger.NEVER) {
validate(documentContext);
if (configuration.getDiagnosticsOptions().getComputeTrigger() != ComputeTrigger.NEVER) {
validate(documentContext);
}
} finally {
lock.writeLock().unlock();
}

}

@Override
public void didChange(DidChangeTextDocumentParams params) {
var documentContext = context.getDocumentUnsafe(params.getTextDocument().getUri());
if (documentContext == null) {
LOGGER.warn("Received didChange, but document is not found in context. uri={}", params.getTextDocument().getUri());
return;
}

var uri = documentContext.getUri();

// Get executor for this document
var executor = documentExecutors.get(uri);
if (executor == null) {
// Document not opened or already closed
return;
}
// Acquire read lock to ensure document is not being modified by addDocument/removeDocument
var lock = context.getDocumentLock(uri);
lock.readLock().lock();
try {
// Get executor for this document
var executor = documentExecutors.get(uri);
if (executor == null) {
// Document not opened or already closed
LOGGER.warn("Received didChange, but document executor is not created yet. uri={}", uri);
return;
}

var version = params.getTextDocument().getVersion();
var version = params.getTextDocument().getVersion();

if (version == null) {
LOGGER.warn("Received didChange without version for {}", uri);
return;
}
if (version == null) {
LOGGER.warn("Received didChange without version for {}", uri);
return;
}

// Submit change operation to document's executor to serialize operations.
executor.submit(version, params.getContentChanges());
// Submit change operation to document's executor to serialize operations.
executor.submit(version, params.getContentChanges());
} finally {
lock.readLock().unlock();
}
}

@Override
Expand All @@ -530,16 +549,43 @@ public void didClose(DidCloseTextDocumentParams params) {
// Wait for all queued changes to complete (with timeout to avoid hanging)
if (!docExecutor.awaitTermination(AWAIT_CLOSE, TimeUnit.SECONDS)) {
docExecutor.shutdownNow();
// Must wait for worker thread to finish even after shutdownNow,
// because finally block in worker may still be executing flushPendingChanges
boolean terminated = docExecutor.awaitTermination(AWAIT_FORCE_TERMINATION, TimeUnit.SECONDS);
if (!terminated) {
LOGGER.warn(
"Document executor for URI {} did not terminate within the additional timeout after shutdownNow()",
uri
);
}
}
} catch (InterruptedException e) {
docExecutor.shutdownNow();
// Wait briefly for worker to finish after interrupt
try {
boolean terminated = docExecutor.awaitTermination(AWAIT_FORCE_TERMINATION, TimeUnit.SECONDS);
if (!terminated) {
LOGGER.warn(
"Document executor for URI {} did not terminate within {} seconds after interrupt during document close",
uri,
AWAIT_FORCE_TERMINATION
);
}
} catch (InterruptedException ignored) {
LOGGER.warn(
"Interrupted again while waiting for document executor for URI {} to terminate after shutdownNow",
uri
);
}
Thread.currentThread().interrupt();
}
}

context.closeDocument(documentContext);

diagnosticProvider.publishEmptyDiagnosticList(documentContext);
if (!clientSupportsPullDiagnostics) {
diagnosticProvider.publishEmptyDiagnosticList(documentContext);
}
}

@Override
Expand Down Expand Up @@ -768,9 +814,23 @@ private void processDocumentChange(
}
}

private <T> CompletableFuture<@Nullable T> withFreshDocumentContext(
private <T> CompletableFuture<@Nullable T> withFreshDocumentContextNullable(
DocumentContext documentContext,
Supplier<@Nullable T> supplier
) {
return withFreshDocumentContextInternal(documentContext, supplier);
}

private <T> CompletableFuture<T> withFreshDocumentContext(
DocumentContext documentContext,
Supplier<T> supplier
) {
return withFreshDocumentContextInternal(documentContext, supplier);
}

private <T> CompletableFuture<T> withFreshDocumentContextInternal(
DocumentContext documentContext,
Supplier<T> supplier
) {
var executor = documentExecutors.get(documentContext.getUri());
CompletableFuture<Void> waitFuture;
Expand All @@ -785,7 +845,13 @@ private void processDocumentChange(
executorService,
cancelChecker -> {
cancelChecker.checkCanceled();
return supplier.get();
var lock = context.getDocumentLock(documentContext.getUri());
lock.readLock().lock();
try {
return supplier.get();
} finally {
lock.readLock().unlock();
}
}
)
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of BSL Language Server.
*
* Copyright (c) 2018-2025
* Copyright (c) 2018-2026
* Alexey Sosnoviy <[email protected]>, Nikita Fedkin <[email protected]> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of BSL Language Server.
*
* Copyright (c) 2018-2025
* Copyright (c) 2018-2026
* Alexey Sosnoviy <[email protected]>, Nikita Fedkin <[email protected]> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of BSL Language Server.
*
* Copyright (c) 2018-2025
* Copyright (c) 2018-2026
* Alexey Sosnoviy <[email protected]>, Nikita Fedkin <[email protected]> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of BSL Language Server.
*
* Copyright (c) 2018-2025
* Copyright (c) 2018-2026
* Alexey Sosnoviy <[email protected]>, Nikita Fedkin <[email protected]> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of BSL Language Server.
*
* Copyright (c) 2018-2025
* Copyright (c) 2018-2026
* Alexey Sosnoviy <[email protected]>, Nikita Fedkin <[email protected]> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of BSL Language Server.
*
* Copyright (c) 2018-2025
* Copyright (c) 2018-2026
* Alexey Sosnoviy <[email protected]>, Nikita Fedkin <[email protected]> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of BSL Language Server.
*
* Copyright (c) 2018-2025
* Copyright (c) 2018-2026
* Alexey Sosnoviy <[email protected]>, Nikita Fedkin <[email protected]> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of BSL Language Server.
*
* Copyright (c) 2018-2025
* Copyright (c) 2018-2026
* Alexey Sosnoviy <[email protected]>, Nikita Fedkin <[email protected]> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down
Loading
Loading