Skip to content

Code completion

Context-aware suggestions as you type: global functions, object methods and properties (with type inference), types after the New operator, keywords and local variables.

Shortcut: Ctrl+Space

← All features

Compilation-context filtering and priority

When metadata is known, suggestions are filtered and ordered using the current module, method directive and preprocessor branch. The project's automatically selected configuration modes and the shared supportThickClientFileMode setting are used. Known unavailable suggestions are hidden by default. Available suggestions come first, followed by suggestions available in only some possible contexts.

Filtering is controlled in .bsl-language-server.json:

{
  "completion": {
    "hideUnavailableByContext": true
  }
}

Set it to false to also show unavailable suggestions at the end of the list. Changes apply to the next completion request. A suggestion is hidden only when it is known to be unavailable in every current context and for every possible target. Partial availability and missing information do not cause suggestions to be removed.

Ranking accounts for platform member and type availability, common-module visibility, application-method declaration conditions and permitted server transitions. A server method callable from the client therefore keeps its normal priority in client code.

Application types inherit availability from their Syntax Assistant base type, such as DocumentManager.<Document name>. Common modules use their metadata flags even before their source file has been parsed. Global properties, including Catalogs, are ranked using their own availability and that of their value type.

After a dot, receiver types are inferred in the current compilation contexts. When preprocessor branches assign different structures to a variable, repeating the condition selects the matching type: fields of the excluded type are not offered. The same context filter applies to members of the remaining type; when filtering is disabled, unavailable members stay in the list with a lower priority.

Existing priorities for local names, fields, global functions and keywords, and the ordering of deprecated items, are preserved within each group. Missing availability information does not penalize a suggestion. OneScript, files without metadata and unknown compilation contexts retain the original ordering.

Keywords

Keywords follow the script language, like platform member names. The BSL/OneScript language vocabulary defines candidates and canonical spellings; Syntax Assistant supplies descriptions and templates. Syntax placeholders such as Declarations, DefaultValue and DefVal are excluded. English loop headers offer To, rather than the By spelling found in the help data.

The surrounding construct is considered:

  • Continue and Break are offered in loop bodies, including nested blocks;
  • Await is offered inside asynchronous methods;
  • Else, ElsIf, Except and closing keywords require the corresponding open block;
  • Then, Do, Each, In, To, Val and Export are offered in the appropriate parts of declarations and headers.

Unfinished blocks are supported. The prefix being completed is not treated as an already inserted keyword: for example, completing EndDo still sees the loop as open. Words in comments and strings do not create false blocks. Ordinary keywords are not offered inside strings, comments or directive headers.

Method contexts and server calls

Only a server-call marker appears to the right of the signature, before the return type, for example →S · ValueTable. The name, signature and inserted code are preserved. Labels follow the project's script variant, like platform method and type names; diagnostic messages separately follow the server's interface language.

Label Meaning In a Russian project
→S Calling from this position requires a transition to the server side →С
→S? The transition depends on the mode or the selected call target →С?

Compilation contexts and call explanations appear as plain text below the method documentation, including documentation loaded through completion resolve. They do not create a separate detail heading. The current directive and preprocessor branch determine the transition: a server method called from the server has no arrow. A local common-module call in file mode is not a server transition. A transition between form parts does not necessarily involve network communication. Platform method availability alone does not prove a server call. Unknown contexts and OneScript have no labels. Clients without structured label support receive the short label in the regular detail field after the signature and return type.

Global functions by prefix

After typing Сообщ inside the procedure, prefix-based completion is triggered. The popup lists global functions starting with that string, including Сообщить.

01-global-functions

Object methods via dot (type inferred from New)

The type of Список is inferred from the Новый Массив assignment, and typing Список. pops up the array's methods. Typing Доб filters the list down to the Добавить method.

02-method-via-dot

Types after the New operator

After typing Новый Масс, type completion is triggered. The list offers classes starting with Масс (e.g. Массив), and the highlighted class shows its constructor signature with the number of syntax variants.

03-new-object

Local variable completion

Two local variables КоличествоСтрок and СуммаПродаж are declared in the procedure, and typing Сумм triggers completion. The popup offers the local variable СуммаПродаж.

comp-04-local-variable

Module procedures and functions

After typing Вычисл in the procedure body, completion of the current module's methods is triggered. The list offers the ВычислитьИтог function with its signature and description.

comp-05-module-method

Collection members (ValueTable)

The type of Таблица is inferred from Новый ТаблицаЗначений, and typing Таблица. pops up its members. The popup offers the value table's properties and methods such as Колонки and Добавить.

comp-06-collection-members

Common module methods

After typing ОбщегоНазначения.Знач, completion of the common module's members is triggered. The list offers the module's exported methods (e.g. ЗначениеРеквизитаОбъекта) with their signatures and return types.

comp-07-common-module-members

Metadata collections (Catalogs.)

The ordinary completion list offers the collections themselves (Catalogs, Documents, AccumulationRegisters), without listing full paths to every object. Collection names follow the script language; object names from metadata are preserved without translation.

After typing Catalogs. (or Справочники.), completion of the metadata object collection is triggered. The list offers the configuration's catalogs along with manager methods.

comp-08-metadata-collection

Enumeration manager members

After typing Перечисления.ВажностьПроблемыУчета., completion of the enumeration manager's members is triggered. The list offers the enumeration's own values together with the manager's methods.

comp-09-enum-values

OneScript: library classes after New (with #Использовать)

In a OneScript module with #Использовать demolib, typing Новый Форматир triggers completion of the imported library's classes. The list offers the library classes starting with that prefix.

comp-10-os-new-library-class

OneScript: library module methods

In a OneScript module with #Использовать demolib, typing СтроковыеУтилиты. triggers completion of the library module's members. The list offers the exported methods of the СтроковыеУтилиты module.

comp-11-os-module-members

OneScript: library classes/modules appear only with #Использовать (or within the same package)

First, completion after Новый Форматир without #Использовать offers nothing from the library, then the #Использовать demolib directive is added at the top of the file. After that the same input triggers completion of the library's classes and modules.

comp-12-os-use-required

Structure fields from the parameter description

The Заказ parameter is described in a BSLDoc comment as a structure with fields Номер and Сумма, and typing Заказ. triggers completion. The list offers the structure fields with the types and descriptions taken from the comment.

comp-13-struct-doc

Structure fields added via Insert()

Fields are added to the Запись structure via Вставить("Имя", …) and Вставить("Возраст", …), and typing Запись. triggers completion. The list offers the fields Имя and Возраст inferred from those calls.

comp-14-struct-insert

Structure fields: description + dynamic Insert()

The Заказ structure is described in a BSLDoc comment with fields Номер and Сумма, and is extended in the body by Вставить("Скидка", 0). After typing Заказ., completion offers both the documented fields and the dynamically added Скидка field.

comp-15-struct-combo

ValueTable row columns

Inside the Для Каждого Строка Из Таблица loop, typing Строка. triggers completion of the value table row's columns. The list offers the columns Артикул and Цена added earlier via Колонки.Добавить.

comp-16-valuetable-columns

Predefined catalog items

After typing Справочники.ВидыКонтактнойИнформации., completion of the catalog manager's members is triggered. The list offers the catalog's predefined items alongside the manager's methods.

comp-17-predefined-items

Fuzzy completion (substring, not just prefix)

In an .os file, after СтроковыеУтилиты. the substring Форм is typed — taken from the middle of the name, not a prefix. Fuzzy matching finds the real module method ВыполнитьФорматирование (matched letters highlighted), even though the name does not start with Форм.

comp-18-fuzzy


Next: Go to definition →