Skip to content
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
8b754e3
Initial plan
Copilot Nov 1, 2025
645c470
Add CommonModuleReference utility and initial tests
Copilot Nov 1, 2025
f3dcf26
Add addModuleReference method and update ReferenceIndexFiller
Copilot Nov 1, 2025
feb1eb3
Add support for common module references via variable - WIP
Copilot Nov 1, 2025
08dc796
Complete implementation of common module reference tracking
Copilot Nov 1, 2025
fc496e7
Clean up code per review comments
Copilot Nov 1, 2025
b039c9f
Clear stale CommonModule mappings on reassignment and between methods
Copilot Nov 1, 2025
53a253e
Preserve module-level variable mappings across methods
Copilot Nov 1, 2025
ef90941
Add support for multiple common module accessor names and manager mod…
Copilot Nov 1, 2025
fc7d40b
Use MDOType.fromValue() instead of hardcoded manager types
Copilot Dec 2, 2025
60a3011
Add configurable references options for common module accessors
Copilot Dec 2, 2025
a13dd1f
Add references configuration to JSON schema and documentation
Copilot Dec 2, 2025
fb4eff5
Merge branch 'develop' into copilot/support-method-module-references
nixel2007 Dec 2, 2025
d177d29
Rename CommonModuleReference to ModuleReference and refactor code
Copilot Dec 3, 2025
5b881d0
Merge branch 'develop' into copilot/support-method-module-references
nixel2007 Dec 3, 2025
457974a
Fix missing @Test annotation and closing brace in ReferenceIndexFille…
Copilot Dec 5, 2025
5340761
Merge branch 'develop' into copilot/support-method-module-references
nixel2007 Dec 6, 2025
277132d
Add unit tests for manager module functionality in ModuleReference
Copilot Dec 7, 2025
b7bd706
Fix jspecify issues: use Optional instead of null returns
Copilot Dec 7, 2025
e2cf62d
Remove manager module functionality per review request
Copilot Dec 8, 2025
042a37a
Restore ManagerModule in DEFAULT_MODULE_TYPES and refactor extractPar…
Copilot Dec 8, 2025
daaa80f
Add module reference for common module identifiers in call statements
Copilot Dec 8, 2025
acae691
Fix ReferenceIndexTest tests for new module reference indexing
Copilot Dec 8, 2025
ffe716e
Address code review feedback
Copilot Dec 8, 2025
a336ad6
Address review feedback: caching, case-insensitive compare, hover for…
Copilot Dec 8, 2025
b22bab1
Remove null check for CommonModule.getComment()
Copilot Dec 8, 2025
e9dd21a
Address review feedback: optimize patterns, improve hover, add tests
Copilot Dec 8, 2025
d52da3b
Address review feedback: use locale-aware mdoRef, fix imports
Copilot Dec 8, 2025
fd94d14
Merge branch 'develop' into copilot/support-method-module-references
theshadowco Dec 9, 2025
7ccc3fd
Рефакторинг
nixel2007 Dec 9, 2025
57fb106
Улучшение ховера по модулю
nixel2007 Dec 9, 2025
b5ee7fb
Fix QF
nixel2007 Dec 9, 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 docs/en/features/ConfigurationFile.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ If there is no configuration file, an attempt will be made to find the ".bsl-lan
| `traceLog` | `String` | To log all requests *(incoming and outgoing)* between **BSL Language Server** and **Language Client** from used editor/IDE, this parameter sets log file path. The path can set either absolute or relative *(from project root)*, by default the value is not set.<br/><br/>**WARNING**<br/><br/>* When starting **BSL Language Server** overwrites this file <br/>* Speed of interaction between client and server **DRAMATICALLY REDUCED** |
| `configurationRoot` | `String` | This parameter is intended to indicate the root directory the 1C configuration files are located in the project directory. It can be useful if there are several configuration directories in the same project directory or when the structure of the project directory is so complex. By default, the parameter is empty and `BSL Language Server` determines the location of the configuration root directory independently |
| `sendErrors` | `String` | Mode for sending error messages to BSL Language Server developers. More [Monitoring](Monitoring.md).Possible values:<br/>* `ask` - ask permission on every error *(set by default)*. <br/>* `send` - always send error messages.<br/>* `never` - never send error messages. |
| `references` | `JSON-Object` | Contains reference index settings |
| ⤷&nbsp;&nbsp;&nbsp;`commonModuleAccessors` | `Array` `String` | List of 'Module.Method' patterns for methods returning common module references (e.g. `CommonUse.CommonModule("ModuleName")`). Supports both format with module name (`CommonUse.CommonModule`) and local call (`CommonModule`). By default, includes standard BSL patterns: `ОбщийМодуль`, `CommonModule`, `ОбщегоНазначения.ОбщийМодуль`, `ОбщегоНазначенияКлиент.ОбщийМодуль`, `ОбщегоНазначенияСервер.ОбщийМодуль`, `ОбщегоНазначенияКлиентСервер.ОбщийМодуль`, `ОбщегоНазначенияПовтИсп.ОбщийМодуль` and their English equivalents. |

You can use the following JSON schema to make it easier to compile and edit a configuration file:

Expand Down
2 changes: 2 additions & 0 deletions docs/features/ConfigurationFile.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ BSL Language Server предоставляет возможность измен
| `traceLog` | `Строка` | Для логирования всех запросов *(входящих и исходящих)* между **BSL Language Server** и **Language Client** из используемого редактора/IDE, в этом параметре можно указать путь к файлу лога. Путь можно указывать как абсолютный, так и относительный *(от корня анализируемого проекта)*, по умолчанию значение не заполнено.<br/><br/>**ВНИМАНИЕ**<br/><br/>* При запуске **BSL Language Server** перезаписывает указанный файл<br/>* Скорость взаимодействия между клиентом и сервером **ЗНАЧИТЕЛЬНО ЗАМЕДЛЯЕТСЯ** |
| `configurationRoot` | `Строка` | Данный параметр предназначен для указания корневого каталога, в котором находятся файлы конфигурации 1С в каталоге проекта. Может быть полезен в случае нахождения нескольких каталогов конфигураций в одном каталоге проекта либо при сложной структуре каталога проекта. По умолчанию параметр не заполнен и `BSL Language Server` самостоятельно определяет расположение корневого каталога конфигурации |
| `sendErrors` | `Строка` | Режим отправки сообщений об ошибках разработчикам BSL Language Server. Подробнее - на странице [Мониторинг и отправка ошибок](Monitoring.md). Возможные значения:<br/>* `ask` - спрашивать разрешение при каждой ошибке *(установлен по умолчанию)*. <br/>* `send` - всегда отправлять сообщения об ошибках. <br/>* `never` - никогда не отправлять сообщения об ошибках. |
| `references` | `JSON-Объект` | Содержит настройки построения индекса ссылок |
| ⤷&nbsp;&nbsp;&nbsp;`commonModuleAccessors` | `Массив` `Строка` | Список паттернов "Модуль.Метод" для методов, возвращающих ссылку на общий модуль (например, `ОбщегоНазначения.ОбщийМодуль("ИмяМодуля")`). Поддерживается как формат с указанием модуля (`ОбщегоНазначения.ОбщийМодуль`), так и локальный вызов (`ОбщийМодуль`). По умолчанию включает стандартные варианты из БСП: `ОбщийМодуль`, `CommonModule`, `ОбщегоНазначения.ОбщийМодуль`, `ОбщегоНазначенияКлиент.ОбщийМодуль`, `ОбщегоНазначенияСервер.ОбщийМодуль`, `ОбщегоНазначенияКлиентСервер.ОбщийМодуль`, `ОбщегоНазначенияПовтИсп.ОбщийМодуль` и их английские эквиваленты. |

Для облегчения составления и редактирования конфигурационного файла можно использовать следующую JSON-схему:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import com.github._1c_syntax.bsl.languageserver.configuration.documentlink.DocumentLinkOptions;
import com.github._1c_syntax.bsl.languageserver.configuration.formating.FormattingOptions;
import com.github._1c_syntax.bsl.languageserver.configuration.inlayhints.InlayHintOptions;
import com.github._1c_syntax.bsl.languageserver.configuration.references.ReferencesOptions;
import com.github._1c_syntax.utils.Absolute;
import org.jspecify.annotations.Nullable;
import jakarta.annotation.PostConstruct;
Expand Down Expand Up @@ -97,6 +98,10 @@ public class LanguageServerConfiguration {
@Setter(value = AccessLevel.NONE)
private FormattingOptions formattingOptions = new FormattingOptions();

@JsonProperty("references")
@Setter(value = AccessLevel.NONE)
private ReferencesOptions referencesOptions = new ReferencesOptions();

private String siteRoot = "https://1c-syntax.github.io/bsl-language-server";
private boolean useDevSite;

Expand Down Expand Up @@ -211,5 +216,6 @@ private void copyPropertiesFrom(LanguageServerConfiguration configuration) {
PropertyUtils.copyProperties(this.diagnosticsOptions, configuration.diagnosticsOptions);
PropertyUtils.copyProperties(this.documentLinkOptions, configuration.documentLinkOptions);
PropertyUtils.copyProperties(this.formattingOptions, configuration.formattingOptions);
PropertyUtils.copyProperties(this.referencesOptions, configuration.referencesOptions);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
* 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.configuration.references;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

/**
* Настройки для построения индекса ссылок.
* <p>
* Позволяет указать список модулей и методов, возвращающих ссылку на общий модуль
* (например, ОбщегоНазначения.ОбщийМодуль("ИмяМодуля")).
*/
@Data
@AllArgsConstructor(onConstructor = @__({@JsonCreator(mode = JsonCreator.Mode.DISABLED)}))
@NoArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
public class ReferencesOptions {

/**
* Список паттернов "Модуль.Метод" для методов, возвращающих ссылку на общий модуль.
* <p>
* Формат: "ИмяМодуля.ИмяМетода", например:
* <ul>
* <li>"ОбщегоНазначения.ОбщийМодуль"</li>
* <li>"ОбщегоНазначенияКлиент.ОбщийМодуль"</li>
* <li>"CommonUse.CommonModule"</li>
* <li>"ОбщийМодуль" - для локального вызова без указания модуля</li>
* </ul>
* <p>
* По умолчанию включает стандартные варианты из БСП.
*/
private List<String> commonModuleAccessors = new ArrayList<>(List.of(
// Локальный вызов
"ОбщийМодуль",
"CommonModule",
// Стандартные модули БСП
"ОбщегоНазначения.ОбщийМодуль",
"ОбщегоНазначенияКлиент.ОбщийМодуль",
"ОбщегоНазначенияСервер.ОбщийМодуль",
"ОбщегоНазначенияКлиентСервер.ОбщийМодуль",
"ОбщегоНазначенияПовтИсп.ОбщийМодуль",
// Английские варианты
"CommonUse.CommonModule",
"CommonUseClient.CommonModule",
"CommonUseServer.CommonModule",
"CommonUseClientServer.CommonModule"
));
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* 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.
*/
/**
* Пакет содержит настройки для построения индекса ссылок.
*/
@NullMarked
package com.github._1c_syntax.bsl.languageserver.configuration.references;

import org.jspecify.annotations.NullMarked;
Loading