Skip to content
Merged

0.25.2 #3686

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
e5d5ba4
Initial plan
Copilot Dec 16, 2025
8c555fb
Add SDBL (query language) semantic tokens support
Copilot Dec 16, 2025
03ab1fa
Simplify SDBL token processing and add tests
Copilot Dec 16, 2025
89e40f8
Simplify SDBL tests - all tests now pass
Copilot Dec 16, 2025
82650d7
Remove unused Tokenizer import
Copilot Dec 16, 2025
caac2d9
Fix SDBL token overlap with BSL string tokens
Copilot Dec 16, 2025
1f95165
Align SDBL token mapping with 1c-query.YAML-tmLanguage reference
Copilot Dec 16, 2025
db938ea
Add detailed position-based tests for SDBL semantic tokens
Copilot Dec 16, 2025
5f58e74
Fix duplicate string tokens - prevent full strings when SDBL tokens p…
Copilot Dec 16, 2025
2e64cfb
Add sequential token position tests to verify no overlaps
Copilot Dec 16, 2025
9556c4c
Fix incorrect comments about token line indexing
Copilot Dec 16, 2025
65b87c9
Fix code style: add proper imports and use toList()
Copilot Dec 16, 2025
ee403b2
Refactor: remove redundant zeroIndexedLine parameter
Copilot Dec 16, 2025
0987b73
Simplify by removing TokenPosition record, use Token directly
Copilot Dec 16, 2025
90b99d0
Add AST-based SDBL semantic tokens (WIP)
Copilot Dec 17, 2025
3dd244c
Add DOT operator to SDBL semantic tokens
Copilot Dec 17, 2025
177b843
Fix SDBL token types: namespace for metadata types, class for object …
Copilot Dec 17, 2025
87b9616
Fix SDBL metadata type tokens: remove defaultLibrary modifier
Copilot Dec 17, 2025
8fd96b7
Merge branch 'develop' into copilot/add-query-language-support
nixel2007 Dec 17, 2025
3ab34d6
Add virtual table method highlighting for SDBL queries
Copilot Dec 18, 2025
8d3c1e2
WIP: Add virtual table method highlighting (debug needed)
Copilot Dec 18, 2025
65bda89
WIP: Fix virtual table method detection through visitVirtualTable
Copilot Dec 18, 2025
10c9839
Fix virtual table method highlighting - 4 of 5 tests passing
Copilot Dec 18, 2025
ef2f02f
Complete SDBL semantic token highlighting - all tests passing ✅
Copilot Dec 18, 2025
f5048b3
Refactor SDBL token handling to use addRange instead of direct TokenE…
Copilot Dec 18, 2025
68facb7
Refactor SDBL visitor to hide low-level token operations in provider
Copilot Dec 18, 2025
fefd4b3
Initial plan
Copilot Dec 18, 2025
c3d122a
Fix NPE in IdenticalExpressionsDiagnostic when ctx.children is null
Copilot Dec 18, 2025
0db3439
Use getChildCount() instead of accessing children field directly
Copilot Dec 18, 2025
5b99dbb
Add grammar resource links to Copilot instructions
nixel2007 Dec 18, 2025
9fc7318
Enable auto-merge for Dependabot
nixel2007 Dec 18, 2025
1012b8d
Update .github/workflows/dependabot-automerge.yaml
nixel2007 Dec 18, 2025
2b1c559
Apply suggestion from @coderabbitai[bot]
nixel2007 Dec 18, 2025
f6c26e5
Merge pull request #3680 from 1c-syntax/nixel2007-patch-2
nixel2007 Dec 18, 2025
ce91ab5
Merge pull request #3679 from 1c-syntax/copilot/fix-nullpointerexcept…
nixel2007 Dec 18, 2025
32eef8d
Добавлена линза для отладки тестов (#3682)
sfaqer Dec 19, 2025
540ddf7
Bump dependabot/fetch-metadata from 2.3.0 to 2.4.0
dependabot[bot] Dec 19, 2025
b9e08b6
Bump org.sonarqube from 7.2.1.6560 to 7.2.2.6593
dependabot[bot] Dec 19, 2025
4e90d25
Bump org.springframework.boot from 3.5.8 to 3.5.9
dependabot[bot] Dec 19, 2025
499f38a
Merge pull request #3683 from 1c-syntax/dependabot/github_actions/dep…
github-actions[bot] Dec 19, 2025
bf580e5
Merge pull request #3684 from 1c-syntax/dependabot/gradle/org.sonarqu…
github-actions[bot] Dec 19, 2025
4a6ef90
Merge pull request #3685 from 1c-syntax/dependabot/gradle/org.springf…
github-actions[bot] Dec 19, 2025
a0a7210
Раскраска временных таблиц. Рефакторинг тестов
nixel2007 Dec 19, 2025
d16ae66
Поддержка предопределенных значений и перечислений
nixel2007 Dec 19, 2025
6792aec
ЕстьNull -> функция
nixel2007 Dec 19, 2025
b694f67
Обработка подчиненных таблиц
nixel2007 Dec 19, 2025
c85f41a
Подчиненная таблица -> class
nixel2007 Dec 19, 2025
952e789
Fix QF
nixel2007 Dec 19, 2025
0e45af6
Address code review feedback - improve comments and code quality
Copilot Dec 19, 2025
406c099
Merge pull request #3673 from 1c-syntax/copilot/add-query-language-su…
nixel2007 Dec 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ This is a Java-based language server that provides code analysis, diagnostics, c
- Project site: https://1c-syntax.github.io/bsl-language-server
- Documentation: [docs/index.md](../docs/index.md) (Russian), [docs/en/index.md](../docs/en/index.md) (English)
- Contributor's Guide: [docs/en/contributing/index.md](../docs/en/contributing/index.md)
- BSL grammar used in BSLParser: https://github.com/1c-syntax/bsl-parser/blob/develop/src/main/antlr/BSLParser.g4
- SDBL grammar used in BSLParser: https://github.com/1c-syntax/bsl-parser/blob/develop/src/main/antlr/SDBLParser.g4

## Technology Stack

Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/dependabot-automerge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Dependabot auto-merge
on:
pull_request_target:
types: [opened, synchronize]

permissions:
contents: write
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == '1c-syntax/bsl-language-server'
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@08eff52bf64351f401fb50d4972fa95b9f2c2d1b
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Approve a PR
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ plugins {
id("io.freefair.aspectj.post-compile-weaving") version "9.1.0"
// id("io.freefair.maven-central.validate-poms") version "9.0.0" // TODO: Re-enable when compatible with Gradle 9
id("com.github.ben-manes.versions") version "0.53.0"
id("org.springframework.boot") version "3.5.8"
id("org.springframework.boot") version "3.5.9"
id("io.spring.dependency-management") version "1.1.7"
id("io.sentry.jvm.gradle") version "5.12.2"
id("io.github.1c-syntax.bslls-dev-tools") version "0.8.1"
id("ru.vyarus.pom") version "3.0.0"
id("org.jreleaser") version "1.21.0"
id("org.sonarqube") version "7.2.1.6560"
id("org.sonarqube") version "7.2.2.6593"
id("me.champeau.jmh") version "0.7.3"
id("com.gorylenko.gradle-git-properties") version "2.5.4"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.github._1c_syntax.bsl.languageserver.configuration.LanguageServerConfiguration;
import com.github._1c_syntax.bsl.languageserver.context.DocumentContext;
import com.github._1c_syntax.bsl.languageserver.context.symbol.MethodSymbol;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import java.util.Map;
Expand All @@ -33,6 +34,7 @@
* Сапплаер линз, показывающий когнитивную сложность методов.
*/
@Component
@Order(4)
public class CognitiveComplexityCodeLensSupplier extends AbstractMethodComplexityCodeLensSupplier {

public CognitiveComplexityCodeLensSupplier(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@
import com.github._1c_syntax.bsl.languageserver.configuration.LanguageServerConfiguration;
import com.github._1c_syntax.bsl.languageserver.context.DocumentContext;
import com.github._1c_syntax.bsl.languageserver.context.symbol.MethodSymbol;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
* Сапплаер линз, показывающий когнитивную сложность методов.
* Сапплаер линз, показывающий цикломатическую сложность методов.
*/
@Component
@Order(5)
public class CyclomaticComplexityCodeLensSupplier extends AbstractMethodComplexityCodeLensSupplier {

public CyclomaticComplexityCodeLensSupplier(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
/*
* This file is a part of BSL Language Server.
*
* Copyright (c) 2018-2025
* Alexey Sosnoviy <[email protected]>, Nikita Fedkin <[email protected]> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
*
* BSL Language Server is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
* BSL Language Server is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with BSL Language Server.
*/
package com.github._1c_syntax.bsl.languageserver.codelenses;

import com.github._1c_syntax.bsl.languageserver.codelenses.testrunner.TestRunnerAdapter;
import com.github._1c_syntax.bsl.languageserver.configuration.LanguageServerConfiguration;
import com.github._1c_syntax.bsl.languageserver.context.DocumentContext;
import com.github._1c_syntax.bsl.languageserver.context.FileType;
import com.github._1c_syntax.bsl.languageserver.context.symbol.MethodSymbol;
import com.github._1c_syntax.bsl.languageserver.utils.Resources;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import lombok.Value;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.lsp4j.CodeLens;
import org.eclipse.lsp4j.Command;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import java.beans.ConstructorProperties;
import java.net.URI;
import java.nio.file.Paths;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;

@Component
@Slf4j
@Order(3)
public class DebugTestCodeLensSupplier
extends AbstractRunTestsCodeLensSupplier<DebugTestCodeLensSupplier.DebugTestCodeLensData> {

private static final String COMMAND_ID = "language-1c-bsl.languageServer.debugTest";

private final TestRunnerAdapter testRunnerAdapter;
private final Resources resources;

// Self-injection для работы кэша в базовом классе.
@Autowired
@Lazy
@Getter
@SuppressWarnings("NullAway.Init")
private DebugTestCodeLensSupplier self;

public DebugTestCodeLensSupplier(
LanguageServerConfiguration configuration,
TestRunnerAdapter testRunnerAdapter,
Resources resources
) {
super(configuration);
this.testRunnerAdapter = testRunnerAdapter;
this.resources = resources;
}

/**
* {@inheritDoc}
*/
@Override
public List<CodeLens> getCodeLenses(DocumentContext documentContext) {

if (documentContext.getFileType() == FileType.BSL) {
return Collections.emptyList();
}

var options = configuration.getCodeLensOptions().getTestRunnerAdapterOptions();

if (options.getDebugTestArguments().isEmpty()) {
return Collections.emptyList();
}

var testIds = testRunnerAdapter.getTestIds(documentContext);
var symbolTree = documentContext.getSymbolTree();

return testIds.stream()
.map(symbolTree::getMethodSymbol)
.flatMap(Optional::stream)
.map(methodSymbol -> toCodeLens(methodSymbol, documentContext))
.toList();
}

/**
* {@inheritDoc}
*/
@Override
public Class<DebugTestCodeLensSupplier.DebugTestCodeLensData> getCodeLensDataClass() {
return DebugTestCodeLensSupplier.DebugTestCodeLensData.class;
}

/**
* {@inheritDoc}
*/
@Override
public CodeLens resolve(DocumentContext documentContext, CodeLens unresolved, DebugTestCodeLensData data) {

var path = Paths.get(documentContext.getUri());
var testId = data.getTestId();

var options = configuration.getCodeLensOptions().getTestRunnerAdapterOptions();
var executable = options.getExecutableForCurrentOS();
String runText = executable + " " + options.getDebugTestArguments();
runText = String.format(runText, path, testId);

var command = new Command();
command.setTitle(resources.getResourceString(getClass(), "title"));
command.setCommand(COMMAND_ID);
command.setArguments(List.of(Map.of("text", runText)));

unresolved.setCommand(command);

return unresolved;

}

private CodeLens toCodeLens(MethodSymbol method, DocumentContext documentContext) {
var testId = method.getName();
var codeLensData = new DebugTestCodeLensSupplier.DebugTestCodeLensData(documentContext.getUri(), getId(), testId);

var codeLens = new CodeLens(method.getSubNameRange());
codeLens.setData(codeLensData);

return codeLens;
}

/**
* DTO для хранения данных линз для отладки теста.
*/
@Value
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public static class DebugTestCodeLensData extends DefaultCodeLensData {
/**
* Имя метода.
*/
String testId;

/**
* @param uri URI документа.
* @param id Идентификатор линзы.
* @param testId Идентификатор теста.
*/
@ConstructorProperties({"uri", "id", "testId"})
public DebugTestCodeLensData(URI uri, String id, String testId) {
super(uri, id);
this.testId = testId;
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.eclipse.lsp4j.Command;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import java.nio.file.Paths;
Expand All @@ -44,6 +45,7 @@
*/
@Component
@Slf4j
@Order(1)
public class RunAllTestsCodeLensSupplier
extends AbstractRunTestsCodeLensSupplier<DefaultCodeLensData> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.eclipse.lsp4j.Command;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import java.beans.ConstructorProperties;
Expand All @@ -51,6 +52,7 @@
*/
@Component
@Slf4j
@Order(2)
public class RunTestCodeLensSupplier
extends AbstractRunTestsCodeLensSupplier<RunTestCodeLensSupplier.RunTestCodeLensData> {

Expand Down Expand Up @@ -139,7 +141,7 @@ private CodeLens toCodeLens(MethodSymbol method, DocumentContext documentContext
}

/**
* DTO для хранения данных линз о сложности методов в документе.
* DTO для хранения данных линз для запуска теста.
*/
@Value
@EqualsAndHashCode(callSuper = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.OrderUtils;

import java.util.Collection;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.function.Function;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -77,6 +81,8 @@ public List<CodeLensSupplier<CodeLensData>> enabledCodeLensSuppliers(
var parameters = configuration.getCodeLensOptions().getParameters();
return codeLensSuppliersById.values().stream()
.filter(supplier -> supplierIsEnabled(supplier.getId(), parameters))
.sorted(Comparator.comparing(o ->
Objects.requireNonNullElse(OrderUtils.getOrder(o.getClass()), Ordered.LOWEST_PRECEDENCE)))
.collect(Collectors.toList());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ private List<String> computeTestIdsByTestRunner(DocumentContext documentContext)
.map(getTestsRegex::matcher)
.filter(Matcher::matches)
.map(matcher -> matcher.group(1))
.distinct()
.toList();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ public class TestRunnerAdapterOptions {
* Аргументы для запуска одного теста.
*/
private String runTestArguments = "-run %s %s";
/**
* Аргументы для отладки одного теста.
*/
private String debugTestArguments = "";
/**
* Аргументы для запуска всех тестов.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,6 @@ private static boolean isComplementary(BinaryOperationNode binary) {
}

private static boolean sufficientSize(BSLParser.ExpressionContext ctx) {
return ctx.children.size() < MIN_EXPRESSION_SIZE;
return ctx.getChildCount() < MIN_EXPRESSION_SIZE;
}
}
Loading
Loading