1c-devtools-cursor

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

1C Dev Tools for Cursor

适用于Cursor的1C开发工具

Skill by ara.so — Devtools Skills collection.
Extension for Cursor IDE that provides comprehensive development tools for the 1C:Enterprise 8 ecosystem. Offers command palette integration, task tree navigation, configuration management, extension handling, and BSL debugging capabilities.
ara.so开发的Skill——开发工具技能合集。
一款为Cursor IDE打造的扩展,为1C:Enterprise 8生态系统提供全面的开发工具,支持命令面板集成、任务树导航、配置管理、扩展处理以及BSL调试功能。

What It Does

功能介绍

1C Dev Tools integrates 1C:Enterprise development workflow into Cursor IDE:
  • Information Base Management: Create, update, export/import databases
  • Configuration Operations: Load/unload configurations from sources (src/cf), build .cf files
  • Extension Management: Work with multiple extensions (src/cfe), compile .cfe files
  • External Files: Build and disassemble external reports/processors
  • Dependency Management: Initialize and manage packagedef dependencies
  • Launch Tools: Start Enterprise or Configurator from IDE
  • BSL Debugging: Attach debugger with variable inspection, watch expressions, and call stack navigation
All commands accessible through:
  • 1C Dev Tools panel
  • Command palette (Ctrl+Shift+P)
  • Task tree in bottom panel
1C开发工具将1C:Enterprise开发工作流集成到Cursor IDE中:
  • 信息库管理:创建、更新、导出/导入数据库
  • 配置操作:从源代码(src/cf)加载/卸载配置、构建.cf文件
  • 扩展管理:管理多个扩展(src/cfe)、编译.cfe文件
  • 外部文件:构建与反编译外部报表/处理器
  • 依赖管理:初始化与管理packagedef依赖
  • 启动工具:从IDE中启动Enterprise或Configurator
  • BSL调试:附加调试器,支持变量查看、监视表达式与调用栈导航
所有命令可通过以下方式访问:
  • 1C开发工具面板
  • 命令面板(Ctrl+Shift+P)
  • 底部面板的任务树

Installation

安装

Prerequisites

前置要求

  1. Node.js 18.x or higher
  2. OneScript (oscript) - Script execution engine: https://oscript.io/
  3. Windows environment variable: Create
    oscript
    pointing to
    C:\Program Files\OneScript\bin\oscript.exe
  1. Node.js 18.x或更高版本
  2. OneScript (oscript) - 脚本执行引擎:https://oscript.io/
  3. Windows环境变量:创建
    oscript
    变量,指向
    C:\Program Files\OneScript\bin\oscript.exe

Install Extension

安装扩展

  1. Open Cursor IDE
  2. Press
    Ctrl+Shift+P
    → "Extensions: Install from VSIX"
  3. Select the
    .vsix
    file
  4. Restart Cursor
  1. 打开Cursor IDE
  2. 按下
    Ctrl+Shift+P
    → "Extensions: Install from VSIX"
  3. 选择
    .vsix
    文件
  4. 重启Cursor

Project Setup

项目设置

Extension auto-activates when
packagedef
file exists in project root.
Project structure:
project-root/
├── packagedef              # Project manifest (required for activation)
├── env.json               # Connection parameters
├── launch.json            # Debug configurations
├── tasks.json             # Custom tasks
├── oscript_modules/       # OneScript modules override
├── src/
│   ├── cf/               # Configuration sources
│   └── cfe/              # Extension sources (subdirectories per extension)
└── build/
    ├── ib/               # Information base
    └── commit/
        └── Commit.txt    # Changed files list for incremental updates
当项目根目录存在
packagedef
文件时,扩展将自动激活。
项目结构:
project-root/
├── packagedef              # 项目清单(激活扩展必需)
├── env.json               # 连接参数
├── launch.json            # 调试配置
├── tasks.json             # 自定义任务
├── oscript_modules/       # OneScript模块覆盖
├── src/
│   ├── cf/               # 配置源代码
│   └── cfe/              # 扩展源代码(每个扩展对应一个子目录)
└── build/
    ├── ib/               # 信息库
    └── commit/
        └── Commit.txt    # 增量更新的变更文件列表

Configuration

配置

env.json - Connection Parameters

env.json - 连接参数

Create
env.json
in project root:
json
{
    "$schema": "https://raw.githubusercontent.com/vanessa-opensource/vanessa-runner/develop/vanessa-runner-schema.json",
    "default": {
        "--ibconnection": "/F./build/ib",
        "--infoBase": "MyInfoBase",
        "--db-user": "Admin",
        "--db-pwd": "",
        "--root": ".",
        "--workspace": ".",
        "--v8version": "8.3.27",
        "--v8-platform-root": "C:/Program Files/1cv8",
        "--debug-server": "localhost",
        "--debug-port-range": "1560:1591",
        "--locale": "ru",
        "--language": "ru",
        "--additional": "/DisplayAllFunctions /Lru /iTaxi /TESTMANAGER",
        "--ordinaryapp": "-1"
    }
}
Key parameters:
  • --ibconnection
    : File base path (
    /F./build/ib
    ) or server (
    /S<server>\<base>
    )
  • --v8version
    : Platform version (e.g.,
    8.3.27
    )
  • --v8-platform-root
    : Installation path
  • --debug-server
    : Debug server hostname (use computer name for local)
  • --debug-port-range
    : RDBG port range
在项目根目录创建
env.json
json
{
    "$schema": "https://raw.githubusercontent.com/vanessa-opensource/vanessa-runner/develop/vanessa-runner-schema.json",
    "default": {
        "--ibconnection": "/F./build/ib",
        "--infoBase": "MyInfoBase",
        "--db-user": "Admin",
        "--db-pwd": "",
        "--root": ".",
        "--workspace": ".",
        "--v8version": "8.3.27",
        "--v8-platform-root": "C:/Program Files/1cv8",
        "--debug-server": "localhost",
        "--debug-port-range": "1560:1591",
        "--locale": "ru",
        "--language": "ru",
        "--additional": "/DisplayAllFunctions /Lru /iTaxi /TESTMANAGER",
        "--ordinaryapp": "-1"
    }
}
关键参数:
  • --ibconnection
    : 文件库路径(
    /F./build/ib
    )或服务器地址(
    /S<server>\<base>
  • --v8version
    : 平台版本(例如:
    8.3.27
  • --v8-platform-root
    : 安装路径
  • --debug-server
    : 调试服务器主机名(本地使用计算机名称)
  • --debug-port-range
    : RDBG端口范围

launch.json - Debug Configurations

launch.json - 调试配置

Create
.vscode/launch.json
:
json
{
    "configurations": [
        {
            "type": "onec",
            "request": "launch",
            "name": "1C: Launch with background jobs",
            "debugServerHost": "localhost",
            "debugServerPort": 1560,
            "infoBaseAlias": "DefAlias",
            "autoAttachTypes": [
                "Client",
                "Server",
                "Job",
                "JobFileMode"
            ]
        },
        {
            "type": "onec",
            "request": "launch",
            "name": "1C: Launch without background jobs",
            "debugServerHost": "localhost",
            "debugServerPort": 1560,
            "infoBaseAlias": "DefAlias",
            "autoAttachTypes": [
                "Client",
                "Server"
            ]
        },
        {
            "type": "onec",
            "request": "attach",
            "name": "1C: Attach",
            "debugServerHost": "localhost",
            "debugServerPort": 1560,
            "infoBaseAlias": "DefAlias",
            "autoAttachTypes": [
                "Client",
                "Server"
            ]
        }
    ]
}
autoAttachTypes options:
Client
,
ManagedClient
,
WebClient
,
ComConnector
,
Server
,
ServerEmulation
,
WebService
,
HttpService
,
OData
,
Job
,
JobFileMode
,
MobileClient
,
MobileServer
,
MobileJobFileMode
,
MobileManagedClient
,
MobileManagedServer
创建
.vscode/launch.json
json
{
    "configurations": [
        {
            "type": "onec",
            "request": "launch",
            "name": "1C: Launch with background jobs",
            "debugServerHost": "localhost",
            "debugServerPort": 1560,
            "infoBaseAlias": "DefAlias",
            "autoAttachTypes": [
                "Client",
                "Server",
                "Job",
                "JobFileMode"
            ]
        },
        {
            "type": "onec",
            "request": "launch",
            "name": "1C: Launch without background jobs",
            "debugServerHost": "localhost",
            "debugServerPort": 1560,
            "infoBaseAlias": "DefAlias",
            "autoAttachTypes": [
                "Client",
                "Server"
            ]
        },
        {
            "type": "onec",
            "request": "attach",
            "name": "1C: Attach",
            "debugServerHost": "localhost",
            "debugServerPort": 1560,
            "infoBaseAlias": "DefAlias",
            "autoAttachTypes": [
                "Client",
                "Server"
            ]
        }
    ]
}
autoAttachTypes可选值:
Client
,
ManagedClient
,
WebClient
,
ComConnector
,
Server
,
ServerEmulation
,
WebService
,
HttpService
,
OData
,
Job
,
JobFileMode
,
MobileClient
,
MobileServer
,
MobileJobFileMode
,
MobileManagedClient
,
MobileManagedServer

Debug Server Settings

调试服务器设置

Extension automatically manages
dbgs.exe
debug server:
  • Local: Auto-starts server on activation
  • Remote: Attempts connection
  • Protocol: HTTP only (configure in Configurator)
Fine-tune debug timings via settings (
1c-dev-tools.debug.timings
):
json
{
    "1c-dev-tools.debug.timings": {
        "varFetchDelayMs": 50,
        "calcWaitingTimeMs": 100,
        "pingIntervalMs": 50,
        "pingStoppedIntervalMs": 500,
        "stepInOutDelayMs": 40,
        "immediatePingDelaysMs": [25, 50, 100],
        "evalExprRetryDelaysMs": [50, 100],
        "variablesRequestRetryDelaysMs": [50, 100, 150],
        "pingDbgtgtIntervalMs": 5000
    }
}
扩展会自动管理
dbgs.exe
调试服务器:
  • 本地:激活时自动启动服务器
  • 远程:尝试建立连接
  • 协议:仅支持HTTP(在Configurator中配置)
微调调试时序可通过设置项(
1c-dev-tools.debug.timings
):
json
{
    "1c-dev-tools.debug.timings": {
        "varFetchDelayMs": 50,
        "calcWaitingTimeMs": 100,
        "pingIntervalMs": 50,
        "pingStoppedIntervalMs": 500,
        "stepInOutDelayMs": 40,
        "immediatePingDelaysMs": [25, 50, 100],
        "evalExprRetryDelaysMs": [50, 100],
        "variablesRequestRetryDelaysMs": [50, 100, 150],
        "pingDbgtgtIntervalMs": 5000
    }
}

Key Commands

核心命令

Access via command palette (
Ctrl+Shift+P
→ "1C: ..." or "1С: ...") or 1C Dev Tools panel.
通过命令面板(
Ctrl+Shift+P
→ "1C: ..." 或 "1С: ...")或1C开发工具面板访问。

Information Base

信息库

1C: Create empty infobase
1C: Post-update processing
1C: Prohibit external resources
1C: Export to dt / Import from dt
1C: Create empty infobase
1C: Post-update processing
1C: Prohibit external resources
1C: Export to dt / Import from dt

Configuration Management

配置管理

Load/Export sources:
1C: Load from src/cf          # Load entire configuration from sources
1C: Update from src/cf        # Incremental update (uses build/commit/Commit.txt)
1C: Export to src/cf          # Full export to sources
1C: Export update to src/cf   # Export only changes
Binary files:
1C: Load from 1Cv8.cf         # Import .cf file
1C: Export to 1Cv8.cf         # Export configuration
1C: Export distribution 1Cv8dist.cf
1C: Build 1Cv8.cf from src/cf
1C: Disassemble 1Cv8.cf to src/cf
加载/导出源代码:
1C: Load from src/cf          # 从源代码加载完整配置
1C: Update from src/cf        # 增量更新(使用build/commit/Commit.txt)
1C: Export to src/cf          # 完整导出到源代码
1C: Export update to src/cf   # 仅导出变更内容
二进制文件操作:
1C: Load from 1Cv8.cf         # 导入.cf文件
1C: Export to 1Cv8.cf         # 导出配置
1C: Export distribution 1Cv8dist.cf
1C: Build 1Cv8.cf from src/cf
1C: Disassemble 1Cv8.cf to src/cf

Extension Management

扩展管理

Source operations:
1C: Load from src/cfe         # Load all extensions from sources
1C: Export to src/cfe         # Export all extensions to sources
1C: Export update to src/cfe  # Export only changed extensions
1C: Update from src/cfe       # Incremental update (uses Commit.txt)
Binary operations:
1C: Load from *.cfe
1C: Export to *.cfe
1C: Build *.cfe from src/cfe
1C: Disassemble *.cfe to src/cfe
源代码操作:
1C: Load from src/cfe         # 从源代码加载所有扩展
1C: Export to src/cfe         # 将所有扩展导出到源代码
1C: Export update to src/cfe  # 仅导出变更的扩展
1C: Update from src/cfe       # 增量更新(使用Commit.txt)
二进制文件操作:
1C: Load from *.cfe
1C: Export to *.cfe
1C: Build *.cfe from src/cfe
1C: Disassemble *.cfe to src/cfe

External Files

外部文件

1C: Build external report/processor    # Compile external file
1C: Disassemble external report/processor
1C: Clear cache
1C: Build external report/processor    # 编译外部文件
1C: Disassemble external report/processor
1C: Clear cache

Dependencies

依赖管理

1C: Initialize packagedef      # Create dependency manifest
1C: Install dependencies
1C: Remove dependencies
1C: Initialize packagedef      # 创建依赖清单
1C: Install dependencies
1C: Remove dependencies

Launch

启动

1C: Launch Enterprise         # Start client application
1C: Launch Configurator       # Open Configurator
1C: Launch Enterprise         # 启动客户端应用
1C: Launch Configurator       # 打开Configurator

Debugging BSL Modules

BSL模块调试

Starting Debug Session

启动调试会话

  1. Set breakpoints in
    .bsl
    files (click left margin)
  2. Press
    F5
    or Run → Start Debugging
  3. Select configuration: "1C: Launch with background jobs" or "1C: Attach"
  4. Extension connects to
    dbgs.exe
    on specified port
  5. Launch 1C:Enterprise (manually or via command)
  1. .bsl
    文件中设置断点(点击左侧边距)
  2. 按下
    F5
    或选择Run → Start Debugging
  3. 选择配置:"1C: Launch with background jobs" 或 "1C: Attach"
  4. 扩展连接到指定端口的
    dbgs.exe
  5. 启动1C:Enterprise(手动或通过命令)

Variable Inspection

变量查看

Watch panel (add expressions):
  • Right-click variable in editor → "Show value in separate window"
  • Click "Calculate value" button in Watch panel header
  • Enter expression:
    Query.TemporaryTablesManager.Tables[0]
Supported types:
  • Структура (Structure): Expands with fields and values
  • Соответствие (Map): Expands with Key/Value pairs
  • ТаблицаЗначений (ValueTable): Shows columns, indexes, rows
    [0]
    ,
    [1]
    , etc.
  • МенеджерВременныхТаблиц (TempTablesManager): Shows temporary tables tree
监视面板(添加表达式):
  • 在编辑器中右键点击变量 → "在单独窗口中显示值"
  • 点击监视面板顶部的"计算值"按钮
  • 输入表达式:
    Query.TemporaryTablesManager.Tables[0]
支持的类型:
  • Структура (Structure):展开显示字段与值
  • Соответствие (Map):展开显示键/值对
  • ТаблицаЗначений (ValueTable):显示列、索引、行
    [0]
    [1]
  • МенеджерВременныхТаблиц (TempTablesManager):显示临时表树

Calculate Expression

计算表达式

Right-click in editor → "Calculate value":
bsl
// In stopped context, evaluate:
Query.TemporaryTablesManager.Tables[0].GetColumns()
Result.Find("MyValue", "FieldName")
Collection.Count() > 10
Result displays in table: Property | Value | Type
在编辑器中右键点击 → "计算值":
bsl
// 在暂停的上下文环境中,执行以下表达式:
Query.TemporaryTablesManager.Tables[0].GetColumns()
Result.Find("MyValue", "FieldName")
Collection.Count() > 10
结果将以表格形式显示:属性 | 值 | 类型

Call Stack Navigation

调用栈导航

Note: Local variables don't display in default view. To inspect:
  1. Select stack frame (procedure/function) in Call Stack panel
  2. Add variable to Watch panel
  3. Variable evaluates in selected frame context
注意:默认视图中不会显示局部变量。如需查看:
  1. 调用栈面板中选择栈帧(过程/函数)
  2. 将变量添加到监视面板
  3. 变量将在选中的帧上下文中求值

Step Commands

单步命令

F10 - Step Over
F11 - Step Into
Shift+F11 - Step Out
F5 - Continue
Shift+F5 - Stop
Extension auto-refreshes stack and variables with optimized ping intervals.
F10 - 单步跳过
F11 - 单步进入
Shift+F11 - 单步退出
F5 - 继续
Shift+F5 - 停止
扩展会通过优化的 ping 间隔自动刷新调用栈与变量。

Common Patterns

常用模式

Initial Project Setup

初始项目设置

bash
undefined
bash
undefined

1. Create project structure

1. 创建项目结构

mkdir my-1c-project cd my-1c-project mkdir -p src/cf src/cfe build/ib build/commit
mkdir my-1c-project cd my-1c-project mkdir -p src/cf src/cfe build/ib build/commit

2. Initialize packagedef

2. 初始化packagedef

Open in Cursor, press Ctrl+Shift+P → "1C: Initialize packagedef"

在Cursor中打开项目,按下Ctrl+Shift+P → "1C: Initialize packagedef"

3. Create env.json (see Configuration section)

3. 创建env.json(参考配置章节)

4. Create empty infobase

4. 创建空信息库

Ctrl+Shift+P → "1C: Create empty infobase"

Ctrl+Shift+P → "1C: Create empty infobase"

undefined
undefined

Load Configuration from External Source

从外部源加载配置

bash
undefined
bash
undefined

1. Place 1Cv8.cf in project root

1. 将1Cv8.cf放置在项目根目录

2. Ctrl+Shift+P → "1C: Load from 1Cv8.cf"

2. Ctrl+Shift+P → "1C: Load from 1Cv8.cf"

3. Export to sources: "1C: Export to src/cf"

3. 导出到源代码:"1C: Export to src/cf"

undefined
undefined

Incremental Development Workflow

增量开发工作流

  1. Work in Configurator, make changes
  2. Export changes:
    1C: Export update to src/cf
  3. Commit to version control
  4. Teammates update:
    1C: Update from src/cf
    (reads
    build/commit/Commit.txt
    )
build/commit/Commit.txt format (one file per line):
src/cf/Documents/Документ1/Ext/ManagerModule.bsl
src/cf/Catalogs/Справочник1.xml
src/cfe/Extension1/Documents/Документ1/Ext/ObjectModule.bsl
  1. 在Configurator中工作,进行变更
  2. 导出变更:
    1C: Export update to src/cf
  3. 提交到版本控制
  4. 团队成员更新:
    1C: Update from src/cf
    (读取
    build/commit/Commit.txt
build/commit/Commit.txt格式(每行一个文件):
src/cf/Documents/Документ1/Ext/ManagerModule.bsl
src/cf/Catalogs/Справочник1.xml
src/cfe/Extension1/Documents/Документ1/Ext/ObjectModule.bsl

Working with Multiple Extensions

多扩展协作

bash
undefined
bash
undefined

Extensions stored in subdirectories:

扩展存储在子目录中:

src/cfe/ ├── Extension1/ │ ├── Configuration.xml │ └── Documents/... └── Extension2/ ├── Configuration.xml └── Catalogs/...
src/cfe/ ├── Extension1/ │ ├── Configuration.xml │ └── Documents/... └── Extension2/ ├── Configuration.xml └── Catalogs/...

Commands operate on all extensions:

命令将作用于所有扩展:

1C: Load from src/cfe # Loads Extension1 + Extension2 1C: Export update to src/cfe # Exports changes from all
undefined
1C: Load from src/cfe # 加载Extension1 + Extension2 1C: Export update to src/cfe # 导出所有扩展的变更
undefined

Build External Processor

构建外部处理器

bsl
// src/ExternalReports/MyReport/ObjectModule.bsl
Процедура ПриКомпоновкеРезультата(ДокументРезультат, ДанныеРасшифровки, СтандартнаяОбработка)
    // Report logic
КонецПроцедуры
  1. Place sources in
    src/ExternalReports/MyReport/
  2. Ctrl+Shift+P
    1C: Build external report/processor
  3. Select
    MyReport
  4. Output:
    MyReport.erf
    in project root
bsl
// src/ExternalReports/MyReport/ObjectModule.bsl
Процедура ПриКомпоновкеРезультата(ДокументРезультат, ДанныеРасшифровки, СтандартнаяОбработка)
    // 报表逻辑
КонецПроцедуры
  1. 将源代码放置在
    src/ExternalReports/MyReport/
    目录
  2. Ctrl+Shift+P
    1C: Build external report/processor
  3. 选择
    MyReport
  4. 输出结果:项目根目录下的
    MyReport.erf

Debug BSL Code Example

BSL代码调试示例

bsl
// CommonModule.bsl
Функция ВыполнитьЗапрос(ТекстЗапроса)
    Запрос = Новый Запрос;
    Запрос.Текст = ТекстЗапроса;
    
    // Set breakpoint here ⬅
    Результат = Запрос.Выполнить();
    
    ТЗ = Результат.Выгрузить();
    Возврат ТЗ;
КонецФункции
When stopped at breakpoint:
  1. Add
    Запрос
    to Watch
  2. Expand
    Запрос.МенеджерВременныхТаблиц.Таблицы
  3. Right-click
    ТЗ
    → "Show value in separate window" (after step-over)
bsl
// CommonModule.bsl
Функция ВыполнитьЗапрос(ТекстЗапроса)
    Запрос = Новый Запрос;
    Запрос.Текст = ТекстЗапроса;
    
    // 在此处设置断点 ⬅
    Результат = Запрос.Выполнить();
    
    ТЗ = Результат.Выгрузить();
    Возврат ТЗ;
КонецФункции
当断点触发时:
  1. Запрос
    添加到监视面板
  2. 展开
    Запрос.МенеджерВременныхТаблиц.Таблицы
  3. 右键点击
    ТЗ
    → "在单独窗口中显示值"(单步跳过之后)

Troubleshooting

故障排查

Extension Not Activating

扩展未激活

Symptom: 1C Dev Tools panel not visible
Solution:
  • Ensure
    packagedef
    exists in project root
  • Restart Cursor
  • Check Output panel → "1C Dev Tools" for errors
症状:1C开发工具面板不可见
解决方案
  • 确保项目根目录存在
    packagedef
    文件
  • 重启Cursor
  • 检查输出面板 → "1C Dev Tools"查看错误信息

oscript Command Not Found

oscript命令未找到

Symptom: Commands fail with "oscript not recognized"
Solution:
  • Install OneScript: https://oscript.io/
  • Create Windows environment variable:
    oscript = C:\Program Files\OneScript\bin\oscript.exe
  • Restart Cursor after setting variable
症状:命令执行失败,提示"oscript not recognized"
解决方案
  • 安装OneScript:https://oscript.io/
  • 创建Windows环境变量:
    oscript = C:\Program Files\OneScript\bin\oscript.exe
  • 设置变量后重启Cursor

Debug Server Connection Failed

调试服务器连接失败

Symptom: Cannot connect to debug server
Solution:
  • Verify
    dbgs.exe
    running (Task Manager)
  • Check
    launch.json
    debugServerHost
    matches actual hostname
  • Ensure port
    1560
    (or configured) not blocked by firewall
  • In Configurator: Debug → Change protocol to HTTP
  • Restart debug server manually:
    dbgs.exe --addr localhost --port 1560
症状:无法连接到调试服务器
解决方案
  • 确认
    dbgs.exe
    正在运行(任务管理器)
  • 检查
    launch.json
    debugServerHost
    与实际主机名匹配
  • 确保端口
    1560
    (或配置的端口)未被防火墙阻止
  • 在Configurator中:调试 → 更改协议为HTTP
  • 手动重启调试服务器:
    dbgs.exe --addr localhost --port 1560

Variables Not Showing in Watch

监视面板中变量不显示

Symptom: Watch panel empty or shows "unavailable"
Solution:
  • Select correct Call Stack frame (click procedure name)
  • Manually add variable name to Watch (don't rely on auto-detection)
  • Increase
    varFetchDelayMs
    in settings if timing issue
  • Use "Calculate value" button instead for complex expressions
症状:监视面板为空或显示"不可用"
解决方案
  • 选择正确的调用栈帧(点击过程名称)
  • 手动将变量名添加到监视面板(不要依赖自动检测)
  • 如果是时序问题,增加设置项中的
    varFetchDelayMs
  • 对于复杂表达式,使用"计算值"按钮替代

Load from src/cf Fails

从src/cf加载失败

Symptom: "Configuration load error"
Solution:
  • Verify
    src/cf/Configuration.xml
    exists
  • Check
    env.json
    --ibconnection
    path correct
  • Ensure infobase not locked (close Configurator/Enterprise)
  • Try "1C: Create empty infobase" first
症状:提示"Configuration load error"
解决方案
  • 确认
    src/cf/Configuration.xml
    存在
  • 检查
    env.json
    --ibconnection
    路径正确
  • 确保信息库未被锁定(关闭Configurator/Enterprise)
  • 先尝试执行"1C: Create empty infobase"

Update from src/cfe Skips Files

从src/cfe更新时跳过文件

Symptom: Changes not applied
Solution:
  • Check
    build/commit/Commit.txt
    contains modified file paths
  • Use full export first:
    1C: Export to src/cfe
  • Verify extension names match subdirectory names exactly
  • Manually add missing paths to
    Commit.txt
    (relative to project root)
症状:变更未被应用
解决方案
  • 检查
    build/commit/Commit.txt
    包含修改后的文件路径
  • 先执行完整导出:
    1C: Export to src/cfe
  • 确认扩展名称与子目录名称完全匹配
  • 手动将缺失的路径添加到
    Commit.txt
    (相对于项目根目录)

Build External Processor No Output

构建外部处理器无输出

Symptom: Build completes but no .erf/.epf file
Solution:
  • Check source structure includes
    ObjectModule.bsl
    or
    ManagerModule.bsl
  • Verify XML metadata files present
  • Look in project root and
    build/
    directory
  • Check Output panel for oscript errors
症状:构建完成但未生成.erf/.epf文件
解决方案
  • 检查源代码结构包含
    ObjectModule.bsl
    ManagerModule.bsl
  • 确认XML元数据文件存在
  • 查看项目根目录与
    build/
    目录
  • 检查输出面板中的oscript错误信息

Incremental Update Applies Wrong Files

增量更新应用错误文件

Symptom: Unrelated modules changed after update
Solution:
  • Commit.txt
    format must be: one file path per line, relative to project root
  • Use forward slashes:
    src/cf/Documents/Doc1.xml
    not
    src\cf\Documents\Doc1.xml
  • No empty lines or comments in
    Commit.txt
  • Regenerate with
    1C: Export update to src/cf
    after known state
症状:更新后无关模块被修改
解决方案
  • Commit.txt
    格式要求:每行一个文件路径,相对于项目根目录
  • 使用斜杠:
    src/cf/Documents/Doc1.xml
    而非
    src\cf\Documents\Doc1.xml
  • Commit.txt
    中不能有空行或注释
  • 在已知状态下重新生成:
    1C: Export update to src/cf

TypeScript API (for Extension Development)

TypeScript API(用于扩展开发)

If extending this project:
typescript
import * as vscode from 'vscode';

// Access extension context
const ext = vscode.extensions.getExtension('asweetand-a11y.devtool1c');
if (ext) {
    const api = await ext.activate();
}

// Register custom command
vscode.commands.registerCommand('1c-dev-tools.customCommand', () => {
    // Execute oscript
    const terminal = vscode.window.createTerminal('1C Tools');
    terminal.sendText('oscript build.os');
});

// Read env.json configuration
const workspaceRoot = vscode.workspace.workspaceFolders?.[0].uri.fsPath;
const envPath = path.join(workspaceRoot, 'env.json');
const envConfig = JSON.parse(fs.readFileSync(envPath, 'utf8'));
const ibConnection = envConfig.default['--ibconnection'];
如果要扩展此项目:
typescript
import * as vscode from 'vscode';

// 访问扩展上下文
const ext = vscode.extensions.getExtension('asweetand-a11y.devtool1c');
if (ext) {
    const api = await ext.activate();
}

// 注册自定义命令
vscode.commands.registerCommand('1c-dev-tools.customCommand', () => {
    // 执行oscript
    const terminal = vscode.window.createTerminal('1C Tools');
    terminal.sendText('oscript build.os');
});

// 读取env.json配置
const workspaceRoot = vscode.workspace.workspaceFolders?.[0].uri.fsPath;
const envPath = path.join(workspaceRoot, 'env.json');
const envConfig = JSON.parse(fs.readFileSync(envPath, 'utf8'));
const ibConnection = envConfig.default['--ibconnection'];

References

参考资料


License: MIT
Language: TypeScript
Platform: Cursor IDE on Windows

License: MIT
Language: TypeScript
Platform: Cursor IDE on Windows