Files
Viper_VSCode/packages/viper/package.json
T
TermiNexus 26216889de feat(viper): 新增手动指定 exe 的 VET check 检查
- 新增 viper.checkEnvironment(命令面板 + Environments 视图标题按钮):选择 exe 后经 check 通道校验 PE/.PRVERSN 与 --version 前缀
- 回执按回带的 id 配对;check_msg 九种原因(NOT_FOUND/NO_PRVERSN/TIMEOUT/CHANNEL_UNAVAILABLE 等)映射为可读说明
- stdin 写入改为入队后仅在心跳窗口内逐行送出(check 在前、心跳最后、行间 300ms、按窗口时长限量),规避看门狗对同批多行的读取行为
- 进程退出/停止时唤醒等待中的请求,避免调用方悬挂
2026-09-20 18:19:52 +08:00

321 lines
11 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"name": "viper",
"displayName": "Viper",
"description": "Project management and toolchain for Viper language",
"version": "0.1.0",
"private": true,
"license": "MIT",
"publisher": "terminexus",
"engines": {
"vscode": "^1.101.0"
},
"categories": [
"Programming Languages"
],
"keywords": [
"viper"
],
"activationEvents": [
"onLanguage:viper",
"workspaceContains:**/*.vpj",
"workspaceContains:**/*.vp"
],
"icon": "images/viper-icon.png",
"main": "./dist/extension.js",
"contributes": {
"languages": [
{
"id": "viper-project",
"aliases": [
"Viper Project"
],
"extensions": [
".vpj"
],
"icon": {
"light": "images/vpj-icon.svg",
"dark": "images/vpj-icon.svg"
}
}
],
"grammars": [
{
"language": "viper-project",
"scopeName": "source.json.vpj",
"path": "./syntaxes/vpj.tmLanguage.json"
}
],
"customEditors": [
{
"viewType": "viper.vpjEditor",
"displayName": "Viper Project Editor",
"selector": [
{
"filenamePattern": "*.vpj"
}
],
"priority": "default"
}
],
"configurationDefaults": {
"files.associations": {
"*.vpj": "viper-project"
}
},
"viewsContainers": {
"activitybar": [
{
"id": "viper-explorer",
"title": "Viper",
"icon": "images/viper-icon.svg"
}
]
},
"views": {
"viper-explorer": [
{
"id": "viper.projectView",
"name": "Project"
},
{
"id": "viper.environmentView",
"name": "Environments"
},
{
"id": "viper.toolchainView",
"name": "Toolchain"
},
{
"id": "viper.settingsView",
"name": "Settings"
}
]
},
"viewsWelcome": [
{
"view": "viper.projectView",
"contents": "No Viper project found in this workspace.\n[Create Project](command:viper.createProject)\n[Open Folder](command:workbench.action.files.openFolder)"
},
{
"view": "viper.toolchainView",
"contents": "No Viper toolchain detected.\n[Configure Toolchain](command:viper.selectToolchain)"
}
],
"commands": [
{
"command": "viper.createProject",
"title": "Create Project",
"category": "Viper"
},
{
"command": "viper.selectToolchain",
"title": "Select Toolchain",
"category": "Viper"
},
{
"command": "viper.showProjectInfo",
"title": "Show Project Info",
"category": "Viper"
},
{
"command": "viper.openSettings",
"title": "Open Settings",
"category": "Viper"
},
{
"command": "viper.selectEnvironment",
"title": "Select Environment",
"category": "Viper",
"icon": "$(server-environment)"
},
{
"command": "viper.restartEnvironmentTool",
"title": "Restart VET",
"category": "Viper",
"icon": "$(debug-restart)"
},
{
"command": "viper.stopEnvironmentTool",
"title": "Stop VET",
"category": "Viper",
"icon": "$(debug-stop)"
},
{
"command": "viper.showEnvironmentLog",
"title": "Show VET Output",
"category": "Viper",
"icon": "$(output)"
},
{
"command": "viper.checkEnvironment",
"title": "Check Viper Executable...",
"category": "Viper",
"icon": "$(check)"
},
{
"command": "viper.refreshView",
"title": "Refresh",
"category": "Viper",
"icon": "$(refresh)"
},
{
"command": "viper.openVpjAsJson",
"title": "Open .vpj as JSON",
"category": "Viper"
}
],
"menus": {
"commandPalette": [
{
"command": "viper.selectEnvironment"
},
{
"command": "viper.restartEnvironmentTool"
},
{
"command": "viper.stopEnvironmentTool"
},
{
"command": "viper.showEnvironmentLog"
},
{
"command": "viper.checkEnvironment"
},
{
"command": "viper.openVpjAsJson",
"when": "resourceExtname == .vpj"
}
],
"editor/title/context": [
{
"command": "viper.openVpjAsJson",
"when": "resourceExtname == .vpj",
"group": "1_open"
}
],
"explorer/context": [
{
"command": "viper.openVpjAsJson",
"when": "resourceExtname == .vpj",
"group": "1_open"
}
],
"view/title": [
{
"command": "viper.checkEnvironment",
"when": "view == viper.environmentView",
"group": "navigation"
},
{
"command": "viper.refreshView",
"when": "view == viper.projectView || view == viper.environmentView || view == viper.toolchainView || view == viper.settingsView",
"group": "navigation"
}
]
},
"configuration": {
"title": "Viper",
"properties": {
"viper.environmentTool.enabled": {
"type": "boolean",
"default": true,
"description": "启用 VET(Viper Environment Tool)常驻扫盘发现 Viper 编译器。",
"scope": "window"
},
"viper.environmentTool.path": {
"type": "string",
"default": "D:\\Users\\TermiNexus\\Desktop\\TransPyC\\VET\\.tpv_build\\output\\VET.exe",
"description": "VET 可执行文件路径(Viper 自身实现的环境发现工具)。",
"scope": "window"
},
"viper.environmentTool.scanPaths": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"description": "传给 VET 的 --path 扫描目录。留空则让 VET 自行建立常用目录表;一旦填写则完全替换它(不再自动建表)。",
"scope": "window"
},
"viper.environmentTool.confirmSeconds": {
"type": "number",
"default": 10,
"minimum": 0,
"description": "VET 心跳确认周期(秒,对应 --need-confirm);0 表示关闭确认(不建议:关闭后 VET 不会因超时自杀)。",
"scope": "window"
},
"viper.environmentTool.confirmTimeoutMs": {
"type": "number",
"default": 5000,
"minimum": 0,
"description": "VET 每轮确认窗口长度(毫秒,对应 --need-confirm-timeout);窗口内没收到 {\"ok\":1} 就会退出。",
"scope": "window"
},
"viper.environmentTool.scanIntervalMs": {
"type": "number",
"default": 10000,
"minimum": 0,
"maximum": 86400000,
"description": "VET 每轮扫盘间隔(毫秒,对应 --sleep)。",
"scope": "window"
},
"viper.environmentTool.maxRestarts": {
"type": "number",
"default": 5,
"minimum": 0,
"description": "VET 异常退出后的自动重启次数上限(指数退避,单次最多等 30 秒);超过后通知错误并停止重启。",
"scope": "window"
},
"viper.toolchain.path": {
"type": "string",
"default": "C:\\v.exe",
"description": "Path to Viper compiler executable.",
"scope": "resource"
},
"viper.toolchain.version": {
"type": "string",
"default": "1.0.0",
"description": "Viper compiler version string.",
"scope": "resource",
"readOnly": true
},
"viper.build.parallel": {
"type": "boolean",
"default": true,
"description": "Enable parallel compilation.",
"scope": "resource"
},
"viper.build.onSave": {
"type": "boolean",
"default": false,
"description": "Trigger build on file save.",
"scope": "resource"
},
"viper.analysis.dialect": {
"type": "string",
"enum": [
"python",
"viper"
],
"default": "viper",
"description": "Language dialect for analysis.",
"scope": "resource"
}
}
}
},
"scripts": {
"clean": "shx rm -rf ./dist ./out",
"compile": "tsc -p ./tsconfig.json",
"watch": "tsc -p ./tsconfig.json --watch",
"package": "vsce package"
},
"devDependencies": {
"@types/node": "^25.9.2",
"@types/vscode": "^1.101.0",
"@vscode/vsce": "^3.9.2",
"shx": "^0.4.0",
"typescript": "~6.0.3"
}
}