1.0.5 清理不必要文件,api-functions.json不释放
This commit is contained in:
@@ -2,7 +2,15 @@
|
||||
.vscode-test/**
|
||||
node_modules/**
|
||||
.gitignore
|
||||
.git/**
|
||||
*.log
|
||||
package-lock.json
|
||||
*.map
|
||||
日志信息.txt
|
||||
*.vsix
|
||||
*.sh
|
||||
*.bat
|
||||
*.md
|
||||
src/**
|
||||
日志信息.txt
|
||||
test*.nut
|
||||
CLAUDE.md
|
||||
@@ -1,292 +0,0 @@
|
||||
{
|
||||
"functions": [
|
||||
{
|
||||
"name": "print",
|
||||
"description": "打印消息到控制台",
|
||||
"params": [
|
||||
{
|
||||
"name": "message",
|
||||
"type": "string",
|
||||
"description": "要打印的消息"
|
||||
}
|
||||
],
|
||||
"returns": {
|
||||
"type": "void",
|
||||
"description": "无返回值"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "len",
|
||||
"description": "返回字符串、数组或表的长度",
|
||||
"params": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "string|table|array",
|
||||
"description": "要计算长度的对象"
|
||||
}
|
||||
],
|
||||
"returns": {
|
||||
"type": "integer",
|
||||
"description": "对象的长度"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "type",
|
||||
"description": "返回对象的类型",
|
||||
"params": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "any",
|
||||
"description": "要检查类型的对象"
|
||||
}
|
||||
],
|
||||
"returns": {
|
||||
"type": "string",
|
||||
"description": "对象的类型字符串"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "clone",
|
||||
"description": "创建对象的浅拷贝",
|
||||
"params": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "any",
|
||||
"description": "要克隆的对象"
|
||||
}
|
||||
],
|
||||
"returns": {
|
||||
"type": "any",
|
||||
"description": "克隆的对象"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "tostring",
|
||||
"description": "将对象转换为字符串",
|
||||
"params": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "any",
|
||||
"description": "要转换的对象"
|
||||
}
|
||||
],
|
||||
"returns": {
|
||||
"type": "string",
|
||||
"description": "转换后的字符串"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "tointeger",
|
||||
"description": "将对象转换为整数",
|
||||
"params": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "any",
|
||||
"description": "要转换的对象"
|
||||
}
|
||||
],
|
||||
"returns": {
|
||||
"type": "integer",
|
||||
"description": "转换后的整数"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "tofloat",
|
||||
"description": "将对象转换为浮点数",
|
||||
"params": [
|
||||
{
|
||||
"name": "obj",
|
||||
"type": "any",
|
||||
"description": "要转换的对象"
|
||||
}
|
||||
],
|
||||
"returns": {
|
||||
"type": "float",
|
||||
"description": "转换后的浮点数"
|
||||
}
|
||||
}
|
||||
],
|
||||
"classes": [
|
||||
{
|
||||
"name": "String",
|
||||
"description": "字符串类,提供字符串操作方法",
|
||||
"methods": [
|
||||
{
|
||||
"name": "len",
|
||||
"description": "返回字符串长度",
|
||||
"params": [],
|
||||
"returns": {
|
||||
"type": "integer",
|
||||
"description": "字符串的长度"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "slice",
|
||||
"description": "返回字符串的子串",
|
||||
"params": [
|
||||
{
|
||||
"name": "start",
|
||||
"type": "integer",
|
||||
"description": "起始位置"
|
||||
},
|
||||
{
|
||||
"name": "end",
|
||||
"type": "integer",
|
||||
"description": "结束位置(可选)",
|
||||
"optional": true
|
||||
}
|
||||
],
|
||||
"returns": {
|
||||
"type": "string",
|
||||
"description": "子串"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "find",
|
||||
"description": "查找子串在字符串中的位置",
|
||||
"params": [
|
||||
{
|
||||
"name": "substr",
|
||||
"type": "string",
|
||||
"description": "要查找的子串"
|
||||
}
|
||||
],
|
||||
"returns": {
|
||||
"type": "integer",
|
||||
"description": "子串的位置,未找到返回-1"
|
||||
}
|
||||
}
|
||||
],
|
||||
"properties": [
|
||||
{
|
||||
"name": "length",
|
||||
"type": "integer",
|
||||
"description": "字符串的长度"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Array",
|
||||
"description": "数组类,提供数组操作方法",
|
||||
"methods": [
|
||||
{
|
||||
"name": "len",
|
||||
"description": "返回数组长度",
|
||||
"params": [],
|
||||
"returns": {
|
||||
"type": "integer",
|
||||
"description": "数组的长度"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "append",
|
||||
"description": "向数组末尾添加元素",
|
||||
"params": [
|
||||
{
|
||||
"name": "value",
|
||||
"type": "any",
|
||||
"description": "要添加的元素"
|
||||
}
|
||||
],
|
||||
"returns": {
|
||||
"type": "void",
|
||||
"description": "无返回值"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "pop",
|
||||
"description": "移除并返回数组最后一个元素",
|
||||
"params": [],
|
||||
"returns": {
|
||||
"type": "any",
|
||||
"description": "被移除的元素"
|
||||
}
|
||||
}
|
||||
],
|
||||
"properties": [
|
||||
{
|
||||
"name": "length",
|
||||
"type": "integer",
|
||||
"description": "数组的长度"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Table",
|
||||
"description": "表类,提供表操作方法",
|
||||
"methods": [
|
||||
{
|
||||
"name": "len",
|
||||
"description": "返回表中键值对的数量",
|
||||
"params": [],
|
||||
"returns": {
|
||||
"type": "integer",
|
||||
"description": "键值对的数量"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "rawget",
|
||||
"description": "获取指定键的值",
|
||||
"params": [
|
||||
{
|
||||
"name": "key",
|
||||
"type": "any",
|
||||
"description": "键"
|
||||
}
|
||||
],
|
||||
"returns": {
|
||||
"type": "any",
|
||||
"description": "键对应的值"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "rawset",
|
||||
"description": "设置指定键的值",
|
||||
"params": [
|
||||
{
|
||||
"name": "key",
|
||||
"type": "any",
|
||||
"description": "键"
|
||||
},
|
||||
{
|
||||
"name": "value",
|
||||
"type": "any",
|
||||
"description": "值"
|
||||
}
|
||||
],
|
||||
"returns": {
|
||||
"type": "void",
|
||||
"description": "无返回值"
|
||||
}
|
||||
}
|
||||
],
|
||||
"properties": []
|
||||
}
|
||||
],
|
||||
"constants": [
|
||||
{
|
||||
"name": "PI",
|
||||
"value": "3.14159",
|
||||
"description": "圆周率",
|
||||
"category": "math"
|
||||
},
|
||||
{
|
||||
"name": "true",
|
||||
"value": "true",
|
||||
"description": "布尔真值",
|
||||
"category": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "false",
|
||||
"value": "false",
|
||||
"description": "布尔假值",
|
||||
"category": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "null",
|
||||
"value": "null",
|
||||
"description": "空值",
|
||||
"category": "general"
|
||||
}
|
||||
]
|
||||
}
|
||||
2
build.sh
2
build.sh
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
echo "构建 squirrel-main 项目..."
|
||||
|
||||
cd "e:\_Projects\squirrelVsis\wordk\squirrel-main"
|
||||
cd "e:\_Projects\squirrelVsis\squirrel-main"
|
||||
|
||||
# 检查 node_modules 是否存在
|
||||
if [ ! -d "node_modules" ]; then
|
||||
|
||||
2
dist/providers/apiParser.js
vendored
2
dist/providers/apiParser.js
vendored
@@ -73,7 +73,7 @@ class ApiParser {
|
||||
else {
|
||||
// 如果JSON文件不存在,使用默认数据并创建文件
|
||||
this.initializeDefaultApiDocumentation();
|
||||
this.saveApiDocumentation();
|
||||
//this.saveApiDocumentation();
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
|
||||
2
dist/providers/apiParser.js.map
vendored
2
dist/providers/apiParser.js.map
vendored
File diff suppressed because one or more lines are too long
@@ -2,7 +2,7 @@
|
||||
"name": "squirrel-nut-explorer",
|
||||
"displayName": "Squirrel NUT Explorer",
|
||||
"description": "通过 pvfUtility API 浏览和编辑 NUT 文件",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"publisher": "local",
|
||||
"engines": {
|
||||
"vscode": "^1.99.0"
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -92,7 +92,7 @@ export class ApiParser {
|
||||
} else {
|
||||
// 如果JSON文件不存在,使用默认数据并创建文件
|
||||
this.initializeDefaultApiDocumentation();
|
||||
this.saveApiDocumentation();
|
||||
//this.saveApiDocumentation();
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('读取API函数JSON文件失败:', error);
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
// 测试注释中的代码不会被错误检测
|
||||
|
||||
// ========== 正常代码 - 应该检测错误 ==========
|
||||
|
||||
functoin normalError() { // 这个应该被检测为拼写错误
|
||||
loacl x = "test; // 这个也应该被检测
|
||||
if (x = 5) { // 赋值操作符错误
|
||||
retun true; // 拼写错误
|
||||
}
|
||||
}
|
||||
|
||||
// ========== 注释掉的代码 - 不应该检测错误 ==========
|
||||
|
||||
// functoin commentedFunction() { // 这个不应该被检测
|
||||
// loacl badVariable = "unclosed string;
|
||||
// if (array[0 = 10) { // 各种错误,但在注释中
|
||||
// retun false;
|
||||
// }
|
||||
|
||||
/*
|
||||
块注释中的代码也不应该检测错误:
|
||||
functoin anotherBadFunction() {
|
||||
loacl x = "unclosed;
|
||||
if (x = bad) {
|
||||
retun nothing;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// ========== 混合情况 ==========
|
||||
|
||||
local validCode = "This is fine"; // 这行正常
|
||||
// functoin commentedBad() { // 这行注释掉的不应该检测
|
||||
|
||||
// 内联注释测试
|
||||
local test = 5; // functoin在注释中不应该报错
|
||||
|
||||
/* 多行注释测试
|
||||
functoin 在这里
|
||||
loacl bad = "test
|
||||
应该都不报错
|
||||
*/
|
||||
|
||||
// ========== 字符串和括号测试 ==========
|
||||
|
||||
// 注释中的未闭合字符串: "this is not closed
|
||||
// 注释中的未闭合括号: function test() { missing close
|
||||
|
||||
local realString = "This should work fine";
|
||||
local realArray = [1, 2, 3];
|
||||
if (realArray.len() > 0) {
|
||||
return "success";
|
||||
}
|
||||
|
||||
// 验证正常代码仍然工作
|
||||
local message = "Hello World";
|
||||
function greeting() {
|
||||
return message;
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
// 测试文件 - 用于验证代码错误检测功能
|
||||
|
||||
// 正常的字符串 - 应该没有错误
|
||||
local validString = "This is a valid string";
|
||||
local validSingleQuote = 'This is also valid';
|
||||
|
||||
// 正常的括号 - 应该没有错误
|
||||
function validFunction() {
|
||||
local array = [1, 2, 3];
|
||||
if (array.len() > 0) {
|
||||
return array[0];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// 测试拼写错误 - 应该被检测到并提供修复
|
||||
functoin badSpelling() { // functoin -> function
|
||||
loacl x = 10; // loacl -> local
|
||||
retun x; // retun -> return
|
||||
}
|
||||
|
||||
// 测试赋值操作符错误 - 应该被检测到
|
||||
function testAssignment() {
|
||||
local x = 5;
|
||||
if (x = 10) { // = 应该是 ==
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 测试未闭合的字符串 - 应该被检测到
|
||||
// local unclosedString = "This string is not closed
|
||||
|
||||
// 测试未闭合的括号 - 应该被检测到
|
||||
// function unclosedBrackets() {
|
||||
// local array = [1, 2, 3;
|
||||
// if (true {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
|
||||
// 测试字符串中的引号 - 不应该报错
|
||||
local stringWithQuotes = "He said 'Hello World'";
|
||||
local escapedQuotes = "She said \"Hello\" to me";
|
||||
|
||||
// 测试括号在字符串中 - 不应该报错
|
||||
local stringWithBrackets = "Array access: array[0]";
|
||||
|
||||
// 测试注释中的内容 - 不应该报错
|
||||
// This is a comment with "unclosed string and (brackets
|
||||
/*
|
||||
Multi-line comment with "quotes" and (brackets)
|
||||
functoin should not be flagged here
|
||||
*/
|
||||
|
||||
// 测试正常的标识符 - 不应该报错
|
||||
local myVariable = 100;
|
||||
local MAX_COUNT = 50;
|
||||
local getUserName = function() { return "user"; };
|
||||
local isReady = true;
|
||||
local hasPermission = false;
|
||||
Reference in New Issue
Block a user