3.0.0
This commit is contained in:
parent
dc713e6893
commit
4385652791
70
README.md
70
README.md
|
|
@ -1,60 +1,48 @@
|
||||||
# TSL Devkit
|
# TSL Devkit
|
||||||
|
|
||||||
该插件提供 `tsl` 语言的语法高亮以及`LSP`代码补全
|
<p align="center">
|
||||||
|
<strong>🚀 TSL 语言开发工具套件</strong><br>
|
||||||
|
为主流编辑器提供完整的 TSL 语言支持
|
||||||
|
</p>
|
||||||
|
|
||||||
支持`LSP`需要安装`nodejs`
|
<p align="center">
|
||||||
|
<img src="https://img.shields.io/badge/VSCode-supported-blue.svg" alt="VSCode">
|
||||||
|
<img src="https://img.shields.io/badge/Vim-supported-green.svg" alt="Vim">
|
||||||
|
</p>
|
||||||
|
|
||||||
## VSCode
|
## 📖 简介
|
||||||
|
|
||||||
### 安装方式一(推荐)
|
TSL Devkit 是一套完整的 TSL 语言开发工具集,为开发者提供专业的编程体验。
|
||||||
|
|
||||||
安装[vsix](./vscode/)扩展
|
### ✨ 核心功能
|
||||||
|
|
||||||
```bash
|
- 🎨 **语法高亮** - 智能代码着色,提升代码可读性
|
||||||
code --install-extension tsl-tools-1.0.0.vsix # 具体版本号以vsix文件为准
|
- 🔧 **语言服务器 (LSP)** - 代码补全、错误诊断、跳转定义
|
||||||
```
|
- 📝 **代码片段** - 常用代码模板,提高编码效率
|
||||||
|
|
||||||
### 安装方式二
|
## 🛠️ 支持的编辑器
|
||||||
|
|
||||||
复制[vscode](./vscode)文件夹到`VSCode`扩展目录(建议更改文件夹名)
|
### VSCode
|
||||||
|
|
||||||
```txt
|
[查看 VSCode 指南](./vscode/README.md)
|
||||||
Windows: %USERPROFILE%\.vscode\extensions
|
|
||||||
macOS: ~/.vscode/extensions
|
|
||||||
Linux: ~/.vscode/extensions
|
|
||||||
```
|
|
||||||
|
|
||||||
### 安装方式三
|
### Vim
|
||||||
|
|
||||||
本项目`vscode`目录下执行
|
[查看 Vim 指南](./vim/README.md)
|
||||||
|
|
||||||
```bash
|
## 🤝 贡献
|
||||||
npm install
|
|
||||||
npx vsce package
|
|
||||||
|
|
||||||
# 安装
|
我们欢迎各种形式的贡献!
|
||||||
code --install-extension tsl-tools-1.0.0.vsix # 具体版本号以vsix文件为准
|
|
||||||
```
|
|
||||||
|
|
||||||
## Vim
|
- 🐛 [报告 Bug](https://git.mytsl.cn/csh/tsl-devkit/issues)
|
||||||
|
- 💡 [提出新功能](https://git.mytsl.cn/csh/tsl-devkit/issues)
|
||||||
|
- 🔧 [提交 PR](https://git.mytsl.cn/csh/tsl-devkit/pulls)
|
||||||
|
- 📖 [改进文档](https://git.mytsl.cn/csh/tsl-devkit/wiki)
|
||||||
|
|
||||||
需要`vim 9.0`以上版本
|
## 👥 维护者
|
||||||
|
|
||||||
将[tsl.vim](./vim/tsl.vim)放入`~/.vim/syntax/`
|
- [@csh](https://git.mytsl.cn/csh) - 项目作者
|
||||||
|
|
||||||
```vim
|
## 🙏 致谢
|
||||||
" vimrc加入,可同时支持tsl和tsf
|
|
||||||
autocmd BufNewFile,BufRead *.ts[lf] setf tsl
|
|
||||||
```
|
|
||||||
|
|
||||||
使用`LSP`,需要在你的`languageserver`设置相关的参数,以`coc.nvim`为例,需要在`coc-settings.json`设置如下内容
|
感谢所有为 TSL Devkit 做出贡献的开发者!
|
||||||
|
|
||||||
```json
|
|
||||||
"languageserver": {
|
|
||||||
"tsl-server": {
|
|
||||||
"command": "tsl-server",
|
|
||||||
"args": ["--log=trace", "--log=stderr"],
|
|
||||||
"filetypes": ["tsl", "tsf"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,83 @@
|
||||||
|
# TSL Tools for Vim
|
||||||
|
|
||||||
|
<p align="left">
|
||||||
|
<strong>强大的 TSL 语言开发工具集</strong><br>
|
||||||
|
为 VSCode 提供完整的 TSL 语言支持
|
||||||
|
</p>
|
||||||
|
<p align="left">
|
||||||
|
<img src="https://img.shields.io/badge/Vim-%3E%3D9.0-green.svg" alt="Vim">
|
||||||
|
</p>
|
||||||
|
|
||||||
|
## 🚀 快速安装
|
||||||
|
|
||||||
|
### 1️⃣ 基础语法高亮
|
||||||
|
|
||||||
|
#### 手动安装
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 创建语法目录(如果不存在)
|
||||||
|
mkdir -p ~/.vim/syntax/
|
||||||
|
|
||||||
|
# 复制语法文件
|
||||||
|
cp vim/tsl.vim ~/.vim/syntax/
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 配置文件关联
|
||||||
|
|
||||||
|
在你的 `~/.vimrc`
|
||||||
|
|
||||||
|
```vim
|
||||||
|
" 自动识别 .tsl 和 .tsf 文件
|
||||||
|
autocmd BufNewFile,BufRead *.ts[lf] setf tsl
|
||||||
|
|
||||||
|
" 或者分开设置
|
||||||
|
autocmd BufNewFile,BufRead *.tsl setf tsl
|
||||||
|
autocmd BufNewFile,BufRead *.tsf setf tsl
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2️⃣ LSP 语言服务器配置
|
||||||
|
|
||||||
|
TSL 提供完整的 LSP 支持,包括代码补全、错误检查、跳转定义等功能。
|
||||||
|
|
||||||
|
#### 使用 coc.nvim
|
||||||
|
|
||||||
|
编辑 `~/.vim/coc-settings.json` 或运行 `:CocConfig`:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"languageserver": {
|
||||||
|
"tsl-server": {
|
||||||
|
"command": "tsl-server",
|
||||||
|
"args": ["--log=info", "--log=stderr", "--interpreter=~/tsl64"],
|
||||||
|
"filetypes": ["tsl", "tsf"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
| 参数 | 说明 | 默认值 |
|
||||||
|
| -------------------- | -------------------------------- | -------- |
|
||||||
|
| `--log` | 日志级别 (trace/info/warn/error) | `info` |
|
||||||
|
| `--log-stderr` | 输出日志到标准错误 | - |
|
||||||
|
| `--log-file=PATH` | 输出日志到文件 | - |
|
||||||
|
| `--interpreter=PATH` | TSL 解释器路径 | 自动检测 |
|
||||||
|
|
||||||
|
更多参数使用`tsl-server --help`获取
|
||||||
|
|
||||||
|
### 3️⃣ 代码片段配置
|
||||||
|
|
||||||
|
#### coc-snippets
|
||||||
|
|
||||||
|
1. 安装 coc-snippets:
|
||||||
|
|
||||||
|
```vim
|
||||||
|
:CocInstall coc-snippets
|
||||||
|
```
|
||||||
|
|
||||||
|
2. 配置片段文件路径:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"snippets.textmateSnippetsRoots": ["~/.vim/snippets"]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
@ -0,0 +1,287 @@
|
||||||
|
{
|
||||||
|
"If Statement": {
|
||||||
|
"prefix": "if",
|
||||||
|
"body": [
|
||||||
|
"if ${1:condition} then",
|
||||||
|
"begin",
|
||||||
|
"\t$0",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "If statement"
|
||||||
|
},
|
||||||
|
"If-Else Statement": {
|
||||||
|
"prefix": "ifelse",
|
||||||
|
"body": [
|
||||||
|
"if ${1:condition} then",
|
||||||
|
"begin",
|
||||||
|
"\t$2",
|
||||||
|
"end",
|
||||||
|
"else",
|
||||||
|
"begin",
|
||||||
|
"\t$0",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "If-else statement"
|
||||||
|
},
|
||||||
|
"If-ElseIf-Else Statement": {
|
||||||
|
"prefix": "ifelif",
|
||||||
|
"body": [
|
||||||
|
"if ${1:condition1} then",
|
||||||
|
"begin",
|
||||||
|
"\t$2",
|
||||||
|
"end",
|
||||||
|
"else if ${3:condition2} then",
|
||||||
|
"begin",
|
||||||
|
"\t$4",
|
||||||
|
"end",
|
||||||
|
"else",
|
||||||
|
"begin",
|
||||||
|
"\t$0",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "If-elseif-else statement"
|
||||||
|
},
|
||||||
|
"For Loop (To)": {
|
||||||
|
"prefix": "for",
|
||||||
|
"body": [
|
||||||
|
"for ${1:i} := ${2:0} to ${3:10} do",
|
||||||
|
"begin",
|
||||||
|
"\t$0",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "For loop with counter"
|
||||||
|
},
|
||||||
|
"For Loop (DownTo)": {
|
||||||
|
"prefix": "fordown",
|
||||||
|
"body": [
|
||||||
|
"for ${1:i} := ${2:10} downto ${3:0} do",
|
||||||
|
"begin",
|
||||||
|
"\t$0",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "For loop with counter (downto)"
|
||||||
|
},
|
||||||
|
"For-In Loop": {
|
||||||
|
"prefix": "forin",
|
||||||
|
"body": [
|
||||||
|
"for ${1:key}, ${2:value} in ${3:collection} do",
|
||||||
|
"begin",
|
||||||
|
"\t$0",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "For-in loop"
|
||||||
|
},
|
||||||
|
"While Loop": {
|
||||||
|
"prefix": "while",
|
||||||
|
"body": [
|
||||||
|
"while ${1:condition} do",
|
||||||
|
"begin",
|
||||||
|
"\t$0",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "While loop"
|
||||||
|
},
|
||||||
|
"Repeat-Until Loop": {
|
||||||
|
"prefix": "repeat",
|
||||||
|
"body": [
|
||||||
|
"repeat",
|
||||||
|
"\t$0",
|
||||||
|
"until ${1:condition};"
|
||||||
|
],
|
||||||
|
"description": "Repeat-until loop"
|
||||||
|
},
|
||||||
|
"Case Statement": {
|
||||||
|
"prefix": "case",
|
||||||
|
"body": [
|
||||||
|
"case ${1:expression} of",
|
||||||
|
"\t${2:value1}:",
|
||||||
|
"\tbegin",
|
||||||
|
"\t\t${3:statements}",
|
||||||
|
"\tend;",
|
||||||
|
"\t${4:value2}:",
|
||||||
|
"\tbegin",
|
||||||
|
"\t\t${5:statements}",
|
||||||
|
"\tend;",
|
||||||
|
"else",
|
||||||
|
"begin",
|
||||||
|
"\t$0",
|
||||||
|
"end",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "Case statement"
|
||||||
|
},
|
||||||
|
"Try-Except Block": {
|
||||||
|
"prefix": "try",
|
||||||
|
"body": [
|
||||||
|
"try",
|
||||||
|
"\t$1",
|
||||||
|
"except",
|
||||||
|
"\t$0",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "Try-except block"
|
||||||
|
},
|
||||||
|
"Function Declaration": {
|
||||||
|
"prefix": "funcdecl",
|
||||||
|
"body": [
|
||||||
|
"function ${1:functionName}(${2:})${3:: ${4:returnType}};$0"
|
||||||
|
],
|
||||||
|
"description": "Function declaration only"
|
||||||
|
},
|
||||||
|
"Function Implementation": {
|
||||||
|
"prefix": "func",
|
||||||
|
"body": [
|
||||||
|
"function ${1:functionName}(${2:})${3:: ${4:returnType}};",
|
||||||
|
"begin",
|
||||||
|
"\t$0",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "Function implementation"
|
||||||
|
},
|
||||||
|
"Function with Parameters": {
|
||||||
|
"prefix": "funcparam",
|
||||||
|
"body": [
|
||||||
|
"function ${1:functionName}(${2:param1}: ${3:type1}; ${4:param2}: ${5:type2})${6:: ${7:returnType}};",
|
||||||
|
"begin",
|
||||||
|
"\t$0",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "Function with typed parameters"
|
||||||
|
},
|
||||||
|
"Function with Var Parameters": {
|
||||||
|
"prefix": "funcvar",
|
||||||
|
"body": [
|
||||||
|
"function ${1:functionName}(var ${2:param1}: ${3:type1}; ${4:param2}: ${5:type2})${6:: ${7:returnType}};",
|
||||||
|
"begin",
|
||||||
|
"\t$0",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "Function with var/out parameters"
|
||||||
|
},
|
||||||
|
"Anonymous Function": {
|
||||||
|
"prefix": "anonfunc",
|
||||||
|
"body": [
|
||||||
|
"function(${1:})${2:: ${3:returnType}}",
|
||||||
|
"begin",
|
||||||
|
"\t$0",
|
||||||
|
"end"
|
||||||
|
],
|
||||||
|
"description": "Anonymous function"
|
||||||
|
},
|
||||||
|
"Unit Module": {
|
||||||
|
"prefix": "unit",
|
||||||
|
"body": [
|
||||||
|
"unit ${1:UnitName};",
|
||||||
|
"",
|
||||||
|
"interface",
|
||||||
|
"\t$2",
|
||||||
|
"",
|
||||||
|
"implementation",
|
||||||
|
"\t$0",
|
||||||
|
"",
|
||||||
|
"end."
|
||||||
|
],
|
||||||
|
"description": "Unit module structure"
|
||||||
|
},
|
||||||
|
"Unit with Initialization": {
|
||||||
|
"prefix": "unitfull",
|
||||||
|
"body": [
|
||||||
|
"unit ${1:UnitName};",
|
||||||
|
"",
|
||||||
|
"interface",
|
||||||
|
"\t${2:// public declarations}",
|
||||||
|
"",
|
||||||
|
"implementation",
|
||||||
|
"\t${3:// implementation}",
|
||||||
|
"",
|
||||||
|
"initialization",
|
||||||
|
"\t${4:// initialization code}",
|
||||||
|
"",
|
||||||
|
"finalization",
|
||||||
|
"\t${5:// cleanup code}",
|
||||||
|
"",
|
||||||
|
"end."
|
||||||
|
],
|
||||||
|
"description": "Complete unit with initialization and finalization"
|
||||||
|
},
|
||||||
|
"Class Definition": {
|
||||||
|
"prefix": "class",
|
||||||
|
"body": [
|
||||||
|
"type ${1:ClassName} = class${2:(${3:ParentClass})}",
|
||||||
|
"\t${4:public}",
|
||||||
|
"\t\t$0",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "Class definition"
|
||||||
|
},
|
||||||
|
"Class with Public/Private": {
|
||||||
|
"prefix": "classfull",
|
||||||
|
"body": [
|
||||||
|
"type ${1:ClassName} = class${2:(${3:ParentClass})}",
|
||||||
|
"\tpublic",
|
||||||
|
"\t\tfunction ${4:methodName}(${5:})${6:: ${7:returnType}};",
|
||||||
|
"\t\t$0",
|
||||||
|
"\tprotected",
|
||||||
|
"\t\t",
|
||||||
|
"\tprivate",
|
||||||
|
"\t\t",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "Class with public/protected/private sections"
|
||||||
|
},
|
||||||
|
"Class Method Implementation": {
|
||||||
|
"prefix": "classmethod",
|
||||||
|
"body": [
|
||||||
|
"function ${1:ClassName}.${2:methodName}(${3:})${4:: ${5:returnType}};",
|
||||||
|
"begin",
|
||||||
|
"\t$0",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "Class method implementation"
|
||||||
|
},
|
||||||
|
"Class Method with Override": {
|
||||||
|
"prefix": "methodoverride",
|
||||||
|
"body": [
|
||||||
|
"function ${1:methodName}(${2:})${3:: ${4:returnType}};",
|
||||||
|
"override;",
|
||||||
|
"begin",
|
||||||
|
"\t$0",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "Override method in class"
|
||||||
|
},
|
||||||
|
"Class Method with Virtual": {
|
||||||
|
"prefix": "methodvirtual",
|
||||||
|
"body": [
|
||||||
|
"function ${1:methodName}(${2:})${3:: ${4:returnType}};",
|
||||||
|
"virtual;",
|
||||||
|
"begin",
|
||||||
|
"\t$0",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "Virtual method in class"
|
||||||
|
},
|
||||||
|
"Property Declaration": {
|
||||||
|
"prefix": "prop",
|
||||||
|
"body": [
|
||||||
|
"property ${1:propertyName}: ${2:type} read ${3:getter} write ${4:setter};$0"
|
||||||
|
],
|
||||||
|
"description": "Property with getter and setter"
|
||||||
|
},
|
||||||
|
"Property Read Only": {
|
||||||
|
"prefix": "propread",
|
||||||
|
"body": [
|
||||||
|
"property ${1:propertyName}: ${2:type} read ${3:getter};$0"
|
||||||
|
],
|
||||||
|
"description": "Read-only property"
|
||||||
|
},
|
||||||
|
"Begin-End Block": {
|
||||||
|
"prefix": "begin",
|
||||||
|
"body": [
|
||||||
|
"begin",
|
||||||
|
"\t$0",
|
||||||
|
"end"
|
||||||
|
],
|
||||||
|
"description": "Begin-end block"
|
||||||
|
}
|
||||||
|
}
|
||||||
77
vim/tsl.vim
77
vim/tsl.vim
|
|
@ -69,52 +69,40 @@ syn keyword tslMathConstant inf nan
|
||||||
# todo
|
# todo
|
||||||
syn keyword tslTodo FIXME NOTE NOTES TODO XXX contained
|
syn keyword tslTodo FIXME NOTE NOTES TODO XXX contained
|
||||||
|
|
||||||
|
# Identifier
|
||||||
|
syn match tslIdentifier '\h\w*'
|
||||||
|
|
||||||
|
# Operators and delimiters
|
||||||
|
syn match tslOperator '[+\-*/<>=!&|^~%]'
|
||||||
|
syn match tslDelimiter '[,;:.@?$]'
|
||||||
|
|
||||||
# Function definitions
|
# Function definitions
|
||||||
syn match tslFuncName '\%(\h\w*\.\)\?\h\w*' contained nextgroup=tslFuncParams skipwhite contains=tslTypeNameInFunc,tslDotInFunc
|
syn match tslFuncName '\%(\h\w*\.\)\?\h\w*' contained nextgroup=tslFuncParams skipwhite contains=tslTypeNameInFunc,tslDotInFunc
|
||||||
syn match tslTypeNameInFunc '\h\w*\ze\.\h\w*' contained
|
syn match tslTypeNameInFunc '\h\w*\ze\.\h\w*' contained
|
||||||
syn match tslDotInFunc '\.' contained
|
syn match tslDotInFunc '\.' contained
|
||||||
syn match tslFuncName '\.\@<=\h\w*' contained
|
|
||||||
|
|
||||||
syn region tslFuncParams
|
syn region tslFuncParams
|
||||||
\ matchgroup=Delimiter
|
\ matchgroup=Delimiter
|
||||||
\ start='('
|
\ start='('
|
||||||
\ end=')'
|
\ end=')'
|
||||||
\ contained
|
\ contained
|
||||||
\ contains=tslParam,tslParamType,tslParamSep,tslNumber,tslString,tslPropertyChain
|
\ contains=tslParam,tslParamType,tslParamSep,tslNumber,tslString,tslPropertyChain,tslOperator
|
||||||
\ nextgroup=tslReturnType skipwhite
|
\ nextgroup=tslReturnType skipwhite
|
||||||
|
|
||||||
syn match tslParam '\h\w*' contained nextgroup=tslParamType skipnl skipwhite
|
syn match tslParam '\h\w*' contained nextgroup=tslParamType skipwhite
|
||||||
syn match tslParamType ':\s*[^;,)=]*' contained contains=tslColon
|
syn match tslParamType ':\s*[^;,)=]*' contained contains=tslColon
|
||||||
syn match tslReturnType ':\s*[^;]*' contained contains=tslColon
|
syn match tslReturnType ':\s*[^;]*' contained contains=tslColon
|
||||||
syn match tslParamSep '[;,]' contained
|
syn match tslParamSep '[;,]' contained
|
||||||
syn match tslColon ':' contained
|
syn match tslColon ':' contained
|
||||||
|
|
||||||
# Property chain
|
# Property chain
|
||||||
syn match tslPropertyChain '\h\w*\%(\.\h\w*\)\+\>' contains=tslObjectName,tslPropertyDot,tslPropertyName
|
syn match tslPropertyChain '\.\h\w*' contains=tslPropertyDot,tslPropertyName
|
||||||
syn match tslObjectName '\h\w*\ze\.\h\w*' contained
|
|
||||||
syn match tslPropertyDot '\.' contained
|
syn match tslPropertyDot '\.' contained
|
||||||
syn match tslPropertyName '\.\@<=\h\w*\%(\ze\.\|\ze\s*[^(]\|\ze\s*$\)' contained
|
syn match tslPropertyName '\h\w*' contained
|
||||||
|
|
||||||
# Function calls
|
# Function calls
|
||||||
syn match tslFuncCallName '\%(\<\%(function\|procedure\)\s\+\%(\h\w*\.\)\?\)\@<!\h\w*\ze\s*('
|
syn match tslFuncCallName '\h\w*\ze\s*(' containedin=tslPropertyChain
|
||||||
\ containedin=ALLBUT,tslFuncParams,tslPropertyChain,tslFunction,tslFuncName,tslFuncNamePart,tslComment,tslString,tslRawString
|
|
||||||
|
|
||||||
syn region tslFuncCall
|
|
||||||
\ start='\h\w*\s*(\zs'
|
|
||||||
\ end='\ze)'
|
|
||||||
\ contains=tslFuncCallName,tslFuncCall,tslNamedParam,tslPositionalParam,tslString,tslRawString,tslNumber,tslIdentifier,tslOperator,tslParamSep
|
|
||||||
\ transparent
|
|
||||||
|
|
||||||
syn match tslNamedParam '\%((\|;\s*\)\zs\h\w*\s*:\s*[^;,)]*' contained
|
|
||||||
\ contains=tslParamName,tslParamColon,tslParamValue
|
|
||||||
|
|
||||||
syn match tslParamName '\h\w*\ze\s*:' contained
|
|
||||||
syn match tslParamColon ':' contained
|
|
||||||
syn match tslParamValue ':\s*\zs[^;,)]*' contained
|
|
||||||
\ contains=tslString,tslNumber,tslIdentifier,tslOperator,tslFuncCall,tslFuncCallName
|
|
||||||
|
|
||||||
syn match tslPositionalParam '[^;,():]*' contained
|
|
||||||
\ contains=tslString,tslNumber,tslIdentifier,tslOperator,tslFuncCall,tslFuncCallName
|
|
||||||
|
|
||||||
# Variable declaration
|
# Variable declaration
|
||||||
syn match tslVarDeclWithTag '\]\@<=\s*\h\w*\ze\s*:\%(=\)\@!'
|
syn match tslVarDeclWithTag '\]\@<=\s*\h\w*\ze\s*:\%(=\)\@!'
|
||||||
|
|
@ -131,29 +119,30 @@ syn region tslVarTypeDecl
|
||||||
\ contained keepend oneline
|
\ contained keepend oneline
|
||||||
\ contains=tslVarType
|
\ contains=tslVarType
|
||||||
syn match tslVarType '[^;]*' contained
|
syn match tslVarType '[^;]*' contained
|
||||||
|
# 冒号的情况
|
||||||
# Operators and delimiters
|
# 1. 简单赋值a := 1; 不需要匹配
|
||||||
syn match tslOperator '[+\-*/<>=!&|^~%]'
|
# 2. 三元表达式a ? b : c; 不需要匹配
|
||||||
syn match tslDelimiter '[()[\]{},;:.@?]'
|
# 3. 普通类型变量声明 a: string; b: array of number; c: obj.A; 匹配:;中的字符,包括.和空格
|
||||||
|
# 4. 声明类型时候有tag,比如[werkref]a: string; 不需要匹配[xxx],只需要和3一样匹配
|
||||||
|
# 5. 变量声明时候带初始化a: number = 1; :=之间的内容是类型,=之后的内容由tslnumber,tslstring等匹配
|
||||||
|
# 6. gloabl var 等是关键字,global a: string = "123"; 不能把global匹配为identifier
|
||||||
|
# 7. 多变量声明, global a, b: number = 1; // 需要匹配的类型是: =之间的number
|
||||||
|
# 8. 不能匹配到函数调用的指定参数模式func(a: 123; b: "sss");
|
||||||
|
|
||||||
# Comments
|
# Comments
|
||||||
syn match tslComment '//.*$' contains=tslTodo,@Spell
|
syn match tslComment '//.*$' contains=tslTodo,@Spell
|
||||||
syn region tslComment start='(\*' end='\*)' contains=tslTodo,@Spell keepend
|
|
||||||
syn region tslComment start='{' end='}' contains=tslTodo,@Spell keepend
|
syn region tslComment start='{' end='}' contains=tslTodo,@Spell keepend
|
||||||
|
syn region tslComment start='(\*' end='\*)' contains=tslTodo,@Spell keepend
|
||||||
|
|
||||||
# Strings
|
# Strings
|
||||||
syn region tslString start=+[uU]\=\z(['"]\)+ end='\z1' skip='\\\\\|\\\z1'
|
syn region tslString start=+[uU]\=\z(['"]\)+ end='\z1' skip='\\\z1'
|
||||||
syn region tslRawString start=+[uU]\=[rR]\z(['"]\)+ end='\z1' skip='\\\\\|\\\z1'
|
syn region tslRawString start=+[uU]\=[rR]\z(['"]\)+ end='\z1'
|
||||||
|
|
||||||
# Numbers
|
# Numbers
|
||||||
syn match tslNumber '\<0[oO]\=\o\+[Ll]\=\>'
|
|
||||||
syn match tslNumber '\<0[xX]\x\+[Ll]\=\>'
|
syn match tslNumber '\<0[xX]\x\+[Ll]\=\>'
|
||||||
|
syn match tslNumber '\<0[oO]\o\+[Ll]\=\>'
|
||||||
syn match tslNumber '\<0[bB][01]\+[Ll]\=\>'
|
syn match tslNumber '\<0[bB][01]\+[Ll]\=\>'
|
||||||
syn match tslNumber '\<\%([1-9]\d*\|0\)[Ll]\=\>'
|
syn match tslNumber '\<\d\+\%(\.\d*\)\=\%([eE][+-]\=\d\+\)\=[jJlL]\=\>'
|
||||||
syn match tslNumber '\<\d\+[jJ]\>'
|
|
||||||
syn match tslNumber '\<\d\+[eE][+-]\=\d\+[jJ]\=\>'
|
|
||||||
syn match tslNumber '\<\d\+\.\%([eE][+-]\=\d\+\)\=[jJ]\=\%(\W\|$\)\@='
|
|
||||||
syn match tslNumber '\%(^\|\W\)\zs\d*\.\d\+\%([eE][+-]\=\d\+\)\=[jJ]\=\>'
|
|
||||||
|
|
||||||
|
|
||||||
# Highlight links
|
# Highlight links
|
||||||
|
|
@ -161,7 +150,7 @@ hi def link tslProgramStructure Statement
|
||||||
hi def link tslModuleStructure Statement
|
hi def link tslModuleStructure Statement
|
||||||
hi def link tslPrimitiveType Type
|
hi def link tslPrimitiveType Type
|
||||||
hi def link tslClassType Statement
|
hi def link tslClassType Statement
|
||||||
hi def link tslClassModifier Identifier
|
hi def link tslClassModifier StorageClass
|
||||||
hi def link tslAccessModifier Statement
|
hi def link tslAccessModifier Statement
|
||||||
hi def link tslPropertyAccessor Operator
|
hi def link tslPropertyAccessor Operator
|
||||||
hi def link tslConstructor Special
|
hi def link tslConstructor Special
|
||||||
|
|
@ -185,16 +174,16 @@ hi def link tslSqlOperator Special
|
||||||
hi def link tslSystemKeyword Special
|
hi def link tslSystemKeyword Special
|
||||||
hi def link tslCallingConvention Special
|
hi def link tslCallingConvention Special
|
||||||
hi def link tslBuiltinVar Constant
|
hi def link tslBuiltinVar Constant
|
||||||
hi def link tslBuiltinFunction Constant
|
hi def link tslBuiltinFunction Special
|
||||||
hi def link tslBoolean Boolean
|
hi def link tslBoolean Boolean
|
||||||
hi def link tslNull Constant
|
hi def link tslNull Constant
|
||||||
hi def link tslMathConstant Number
|
hi def link tslMathConstant Number
|
||||||
|
|
||||||
# 其他元素的高亮链接保持不变
|
|
||||||
hi def link tslObjectName Type
|
|
||||||
hi def link tslPropertyDot Operator
|
hi def link tslPropertyDot Operator
|
||||||
hi def link tslPropertyName Special
|
hi def link tslPropertyName Special
|
||||||
|
|
||||||
|
hi def link tslFuncCallName Function
|
||||||
|
|
||||||
hi def link tslFuncName Function
|
hi def link tslFuncName Function
|
||||||
hi def link tslTypeNameInFunc Type
|
hi def link tslTypeNameInFunc Type
|
||||||
hi def link tslParam Identifier
|
hi def link tslParam Identifier
|
||||||
|
|
@ -206,11 +195,7 @@ hi def link tslColon Delimiter
|
||||||
hi def link tslVarName Identifier
|
hi def link tslVarName Identifier
|
||||||
hi def link tslVarType Type
|
hi def link tslVarType Type
|
||||||
|
|
||||||
hi def link tslFuncCallName Function
|
hi def link tslIdentifier PreProc
|
||||||
hi def link tslCallParam Identifier
|
|
||||||
hi def link tslCallValue Type
|
|
||||||
hi def link tslCallSep Delimiter
|
|
||||||
|
|
||||||
hi def link tslOperator Operator
|
hi def link tslOperator Operator
|
||||||
hi def link tslDelimiter Delimiter
|
hi def link tslDelimiter Delimiter
|
||||||
hi def link tslTodo Todo
|
hi def link tslTodo Todo
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,11 @@
|
||||||
|
|
||||||
Notable changes to the `TSL` extension will be documented in thio file.
|
Notable changes to the `TSL` extension will be documented in thio file.
|
||||||
|
|
||||||
|
## [3.0.0]: 2025-09-28
|
||||||
|
|
||||||
|
- 支持`lsp`全局函数补全
|
||||||
|
- 降低`vscode`支持版本到`1.90.0`
|
||||||
|
|
||||||
## [2.3.1]: 2025-07-10
|
## [2.3.1]: 2025-07-10
|
||||||
|
|
||||||
- 修复:关键字`initialization`拼写错误
|
- 修复:关键字`initialization`拼写错误
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,80 @@
|
||||||
# TSL-Devkit
|
# TSL Tools for VSCode
|
||||||
|
|
||||||
`tsl`的`vscode`插件工具集
|
<p align="left">
|
||||||
|
<strong>强大的 TSL 语言开发工具集</strong><br>
|
||||||
|
为 VSCode 提供完整的 TSL 语言支持
|
||||||
|
</p>
|
||||||
|
|
||||||
- 支持`textMate`语法高亮
|
## ✨ 功能特性
|
||||||
- 支持`LSP`补全
|
|
||||||
|
|
||||||
|
- 🎨 **语法高亮** - 基于 TextMate 语法的智能代码着色
|
||||||
|
- 🔧 **语言服务器协议 (LSP)** - 提供智能代码补全、错误检查、跳转定义等功能
|
||||||
|
- 📝 **代码片段 (Snippets)** - 快速插入常用代码模板
|
||||||
|
|
||||||
|
## 📦 安装方式
|
||||||
|
|
||||||
|
### 方式一:通过 VSIX 文件安装(推荐)
|
||||||
|
|
||||||
|
直接使用预编译的扩展包:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 命令行安装
|
||||||
|
code --install-extension tsl-tools-3.0.0.vsix
|
||||||
|
```
|
||||||
|
|
||||||
|
或者在 VSCode 中:
|
||||||
|
|
||||||
|
1. 打开命令面板 (`Ctrl+Shift+P` / `Cmd+Shift+P`)
|
||||||
|
2. 输入 `Install from VSIX`
|
||||||
|
3. 选择 `tsl-tools-3.0.0.vsix` 文件
|
||||||
|
|
||||||
|
### 方式二:从源码构建
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 克隆仓库
|
||||||
|
git clone https://git.mytsl.cn/csh/tsl-devkit.git
|
||||||
|
cd tsl-devkit
|
||||||
|
|
||||||
|
# 安装依赖
|
||||||
|
npm install
|
||||||
|
|
||||||
|
# 打包扩展
|
||||||
|
npx vsce package
|
||||||
|
|
||||||
|
# 安装生成的 VSIX 文件
|
||||||
|
code --install-extension tsl-tools-3.0.0.vsix
|
||||||
|
```
|
||||||
|
|
||||||
|
### 方式三:手动安装
|
||||||
|
|
||||||
|
将扩展文件夹复制到 VSCode 扩展目录:
|
||||||
|
|
||||||
|
| 操作系统 | 扩展目录路径 |
|
||||||
|
| -------- | ---------------------------------- |
|
||||||
|
| Windows | `%USERPROFILE%\.vscode\extensions` |
|
||||||
|
| macOS | `~/.vscode/extensions` |
|
||||||
|
| Linux | `~/.vscode/extensions` |
|
||||||
|
|
||||||
|
## ⚙️ 配置选项
|
||||||
|
|
||||||
|
在 VSCode 设置中配置 TSL 扩展:
|
||||||
|
|
||||||
|
### 语言服务器配置
|
||||||
|
|
||||||
|
| 配置项 | 类型 | 默认值 | 描述 |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| `tsl.server.executable` | `string` | `""` | TSL 语言服务器可执行文件路径<br>_留空自动检测_ |
|
||||||
|
| `tsl.server.arguments` | `string[]` | `["--log=trace", "--log-stderr"]` | 语言服务器启动参数<br>_使用 `./tsl-server --help` 查看所有选项_ |
|
||||||
|
| `tsl.interpreter.executable` | `string` | `""` | TSL 解释器路径<br>_用于识别 funcext 下的 .tsf 文件_ |
|
||||||
|
|
||||||
|
### 配置示例
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"tsl.server.executable": "/usr/local/bin/tsl-server",
|
||||||
|
"tsl.server.arguments": ["--log=info", "--log-stderr"],
|
||||||
|
"tsl.interpreter.executable": "/usr/local/bin/tsl"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
> ⚠️ **注意**: `tsl.interpreter.executable` 与服务器参数 `--interpreter=PATH` 冲突,请只使用其中一个
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,25 @@
|
||||||
{
|
{
|
||||||
"name": "tsl-tools",
|
"name": "tsl-tools",
|
||||||
"version": "2.4.0",
|
"version": "3.0.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "tsl-tools",
|
"name": "tsl-tools",
|
||||||
"version": "2.4.0",
|
"version": "3.0.0",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"vscode-languageclient": "^9.0.1"
|
"vscode-languageclient": "^9.0.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^24.0.3",
|
"@types/node": "^24.5.2",
|
||||||
"@types/vscode": "^1.101.0",
|
"@types/vscode": "^1.90.0",
|
||||||
"@vscode/vsce": "^3.6.0",
|
"@vscode/vsce": "^3.6.0",
|
||||||
"prettier": "^3.5.3",
|
"prettier": "^3.6.2",
|
||||||
"typescript": "^5.8.3"
|
"typescript": "^5.9.2"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "^1.101.0"
|
"vscode": "^1.90.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@azu/format-text": {
|
"node_modules/@azu/format-text": {
|
||||||
|
|
@ -171,22 +171,22 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@azure/msal-browser": {
|
"node_modules/@azure/msal-browser": {
|
||||||
"version": "4.23.0",
|
"version": "4.24.0",
|
||||||
"resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-4.23.0.tgz",
|
"resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-4.24.0.tgz",
|
||||||
"integrity": "sha512-uHnfRwGAEHaYVXzpCtYsruy6PQxL2v76+MJ3+n/c/3PaTiTIa5ch7VofTUNoA39nHyjJbdiqTwFZK40OOTOkjw==",
|
"integrity": "sha512-BNoiUEx4olj16U9ZiquvIhG1dZBnwWSzSXiSclq/9qiFQXYeLOKqEaEv98+xLXJ3oLw9APwHTR1eY2Qk0v6XBQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@azure/msal-common": "15.12.0"
|
"@azure/msal-common": "15.13.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.8.0"
|
"node": ">=0.8.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@azure/msal-common": {
|
"node_modules/@azure/msal-common": {
|
||||||
"version": "15.12.0",
|
"version": "15.13.0",
|
||||||
"resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-15.12.0.tgz",
|
"resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-15.13.0.tgz",
|
||||||
"integrity": "sha512-4ucXbjVw8KJ5QBgnGJUeA07c8iznwlk5ioHIhI4ASXcXgcf2yRFhWzYOyWg/cI49LC9ekpFJeQtO3zjDTbl6TQ==",
|
"integrity": "sha512-8oF6nj02qX7eE/6+wFT5NluXRHc05AgdCC3fJnkjiJooq8u7BcLmxaYYSwc2AfEkWRMRi6Eyvvbeqk4U4412Ag==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
@ -194,13 +194,13 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@azure/msal-node": {
|
"node_modules/@azure/msal-node": {
|
||||||
"version": "3.7.4",
|
"version": "3.8.0",
|
||||||
"resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-3.7.4.tgz",
|
"resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-3.8.0.tgz",
|
||||||
"integrity": "sha512-fjqvhrThwzzPvqhFOdkkGRJCHPQZTNijpceVy8QjcfQuH482tOVEjHyamZaioOhVtx+FK1u+eMpJA2Zz4U9LVg==",
|
"integrity": "sha512-23BXm82Mp5XnRhrcd4mrHa0xuUNRp96ivu3nRatrfdAqjoeWAGyD0eEAafxAOHAEWWmdlyFK4ELFcdziXyw2sA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@azure/msal-common": "15.12.0",
|
"@azure/msal-common": "15.13.0",
|
||||||
"jsonwebtoken": "^9.0.0",
|
"jsonwebtoken": "^9.0.0",
|
||||||
"uuid": "^8.3.0"
|
"uuid": "^8.3.0"
|
||||||
},
|
},
|
||||||
|
|
@ -655,17 +655,17 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@vscode/vsce": {
|
"node_modules/@vscode/vsce": {
|
||||||
"version": "3.6.0",
|
"version": "3.6.2",
|
||||||
"resolved": "https://registry.npmjs.org/@vscode/vsce/-/vsce-3.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/@vscode/vsce/-/vsce-3.6.2.tgz",
|
||||||
"integrity": "sha512-u2ZoMfymRNJb14aHNawnXJtXHLXDVKc1oKZaH4VELKT/9iWKRVgtQOdwxCgtwSxJoqYvuK4hGlBWQJ05wxADhg==",
|
"integrity": "sha512-gvBfarWF+Ii20ESqjA3dpnPJpQJ8fFJYtcWtjwbRADommCzGg1emtmb34E+DKKhECYvaVyAl+TF9lWS/3GSPvg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@azure/identity": "^4.1.0",
|
"@azure/identity": "^4.1.0",
|
||||||
"@secretlint/node": "^10.1.1",
|
"@secretlint/node": "^10.1.2",
|
||||||
"@secretlint/secretlint-formatter-sarif": "^10.1.1",
|
"@secretlint/secretlint-formatter-sarif": "^10.1.2",
|
||||||
"@secretlint/secretlint-rule-no-dotenv": "^10.1.1",
|
"@secretlint/secretlint-rule-no-dotenv": "^10.1.2",
|
||||||
"@secretlint/secretlint-rule-preset-recommend": "^10.1.1",
|
"@secretlint/secretlint-rule-preset-recommend": "^10.1.2",
|
||||||
"@vscode/vsce-sign": "^2.0.0",
|
"@vscode/vsce-sign": "^2.0.0",
|
||||||
"azure-devops-node-api": "^12.5.0",
|
"azure-devops-node-api": "^12.5.0",
|
||||||
"chalk": "^4.1.2",
|
"chalk": "^4.1.2",
|
||||||
|
|
@ -682,7 +682,7 @@
|
||||||
"minimatch": "^3.0.3",
|
"minimatch": "^3.0.3",
|
||||||
"parse-semver": "^1.1.1",
|
"parse-semver": "^1.1.1",
|
||||||
"read": "^1.0.7",
|
"read": "^1.0.7",
|
||||||
"secretlint": "^10.1.1",
|
"secretlint": "^10.1.2",
|
||||||
"semver": "^7.5.2",
|
"semver": "^7.5.2",
|
||||||
"tmp": "^0.2.3",
|
"tmp": "^0.2.3",
|
||||||
"typed-rest-client": "^1.8.4",
|
"typed-rest-client": "^1.8.4",
|
||||||
|
|
@ -702,28 +702,28 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@vscode/vsce-sign": {
|
"node_modules/@vscode/vsce-sign": {
|
||||||
"version": "2.0.6",
|
"version": "2.0.7",
|
||||||
"resolved": "https://registry.npmjs.org/@vscode/vsce-sign/-/vsce-sign-2.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/@vscode/vsce-sign/-/vsce-sign-2.0.7.tgz",
|
||||||
"integrity": "sha512-j9Ashk+uOWCDHYDxgGsqzKq5FXW9b9MW7QqOIYZ8IYpneJclWTBeHZz2DJCSKQgo+JAqNcaRRE1hzIx0dswqAw==",
|
"integrity": "sha512-cz0GFW8qCxpypOy3y509u26K1FIPMlDIHBwGmDyvEbgoma2v3y5YIHHuijr8zCYBp9kzCCOJd28s/0PG7cA7ew==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "SEE LICENSE IN LICENSE.txt",
|
"license": "SEE LICENSE IN LICENSE.txt",
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@vscode/vsce-sign-alpine-arm64": "2.0.5",
|
"@vscode/vsce-sign-alpine-arm64": "2.0.6",
|
||||||
"@vscode/vsce-sign-alpine-x64": "2.0.5",
|
"@vscode/vsce-sign-alpine-x64": "2.0.6",
|
||||||
"@vscode/vsce-sign-darwin-arm64": "2.0.5",
|
"@vscode/vsce-sign-darwin-arm64": "2.0.6",
|
||||||
"@vscode/vsce-sign-darwin-x64": "2.0.5",
|
"@vscode/vsce-sign-darwin-x64": "2.0.6",
|
||||||
"@vscode/vsce-sign-linux-arm": "2.0.5",
|
"@vscode/vsce-sign-linux-arm": "2.0.6",
|
||||||
"@vscode/vsce-sign-linux-arm64": "2.0.5",
|
"@vscode/vsce-sign-linux-arm64": "2.0.6",
|
||||||
"@vscode/vsce-sign-linux-x64": "2.0.5",
|
"@vscode/vsce-sign-linux-x64": "2.0.6",
|
||||||
"@vscode/vsce-sign-win32-arm64": "2.0.5",
|
"@vscode/vsce-sign-win32-arm64": "2.0.6",
|
||||||
"@vscode/vsce-sign-win32-x64": "2.0.5"
|
"@vscode/vsce-sign-win32-x64": "2.0.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@vscode/vsce-sign-alpine-arm64": {
|
"node_modules/@vscode/vsce-sign-alpine-arm64": {
|
||||||
"version": "2.0.5",
|
"version": "2.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/@vscode/vsce-sign-alpine-arm64/-/vsce-sign-alpine-arm64-2.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/@vscode/vsce-sign-alpine-arm64/-/vsce-sign-alpine-arm64-2.0.6.tgz",
|
||||||
"integrity": "sha512-XVmnF40APwRPXSLYA28Ye+qWxB25KhSVpF2eZVtVOs6g7fkpOxsVnpRU1Bz2xG4ySI79IRuapDJoAQFkoOgfdQ==",
|
"integrity": "sha512-wKkJBsvKF+f0GfsUuGT0tSW0kZL87QggEiqNqK6/8hvqsXvpx8OsTEc3mnE1kejkh5r+qUyQ7PtF8jZYN0mo8Q==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
|
|
@ -735,9 +735,9 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@vscode/vsce-sign-alpine-x64": {
|
"node_modules/@vscode/vsce-sign-alpine-x64": {
|
||||||
"version": "2.0.5",
|
"version": "2.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/@vscode/vsce-sign-alpine-x64/-/vsce-sign-alpine-x64-2.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/@vscode/vsce-sign-alpine-x64/-/vsce-sign-alpine-x64-2.0.6.tgz",
|
||||||
"integrity": "sha512-JuxY3xcquRsOezKq6PEHwCgd1rh1GnhyH6urVEWUzWn1c1PC4EOoyffMD+zLZtFuZF5qR1I0+cqDRNKyPvpK7Q==",
|
"integrity": "sha512-YoAGlmdK39vKi9jA18i4ufBbd95OqGJxRvF3n6ZbCyziwy3O+JgOpIUPxv5tjeO6gQfx29qBivQ8ZZTUF2Ba0w==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
|
|
@ -749,9 +749,9 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@vscode/vsce-sign-darwin-arm64": {
|
"node_modules/@vscode/vsce-sign-darwin-arm64": {
|
||||||
"version": "2.0.5",
|
"version": "2.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/@vscode/vsce-sign-darwin-arm64/-/vsce-sign-darwin-arm64-2.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/@vscode/vsce-sign-darwin-arm64/-/vsce-sign-darwin-arm64-2.0.6.tgz",
|
||||||
"integrity": "sha512-z2Q62bk0ptADFz8a0vtPvnm6vxpyP3hIEYMU+i1AWz263Pj8Mc38cm/4sjzxu+LIsAfhe9HzvYNS49lV+KsatQ==",
|
"integrity": "sha512-5HMHaJRIQuozm/XQIiJiA0W9uhdblwwl2ZNDSSAeXGO9YhB9MH5C4KIHOmvyjUnKy4UCuiP43VKpIxW1VWP4tQ==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
|
|
@ -763,9 +763,9 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@vscode/vsce-sign-darwin-x64": {
|
"node_modules/@vscode/vsce-sign-darwin-x64": {
|
||||||
"version": "2.0.5",
|
"version": "2.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/@vscode/vsce-sign-darwin-x64/-/vsce-sign-darwin-x64-2.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/@vscode/vsce-sign-darwin-x64/-/vsce-sign-darwin-x64-2.0.6.tgz",
|
||||||
"integrity": "sha512-ma9JDC7FJ16SuPXlLKkvOD2qLsmW/cKfqK4zzM2iJE1PbckF3BlR08lYqHV89gmuoTpYB55+z8Y5Fz4wEJBVDA==",
|
"integrity": "sha512-25GsUbTAiNfHSuRItoQafXOIpxlYj+IXb4/qarrXu7kmbH94jlm5sdWSCKrrREs8+GsXF1b+l3OB7VJy5jsykw==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
|
|
@ -777,9 +777,9 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@vscode/vsce-sign-linux-arm": {
|
"node_modules/@vscode/vsce-sign-linux-arm": {
|
||||||
"version": "2.0.5",
|
"version": "2.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/@vscode/vsce-sign-linux-arm/-/vsce-sign-linux-arm-2.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/@vscode/vsce-sign-linux-arm/-/vsce-sign-linux-arm-2.0.6.tgz",
|
||||||
"integrity": "sha512-cdCwtLGmvC1QVrkIsyzv01+o9eR+wodMJUZ9Ak3owhcGxPRB53/WvrDHAFYA6i8Oy232nuen1YqWeEohqBuSzA==",
|
"integrity": "sha512-UndEc2Xlq4HsuMPnwu7420uqceXjs4yb5W8E2/UkaHBB9OWCwMd3/bRe/1eLe3D8kPpxzcaeTyXiK3RdzS/1CA==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm"
|
"arm"
|
||||||
],
|
],
|
||||||
|
|
@ -791,9 +791,9 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@vscode/vsce-sign-linux-arm64": {
|
"node_modules/@vscode/vsce-sign-linux-arm64": {
|
||||||
"version": "2.0.5",
|
"version": "2.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/@vscode/vsce-sign-linux-arm64/-/vsce-sign-linux-arm64-2.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/@vscode/vsce-sign-linux-arm64/-/vsce-sign-linux-arm64-2.0.6.tgz",
|
||||||
"integrity": "sha512-Hr1o0veBymg9SmkCqYnfaiUnes5YK6k/lKFA5MhNmiEN5fNqxyPUCdRZMFs3Ajtx2OFW4q3KuYVRwGA7jdLo7Q==",
|
"integrity": "sha512-cfb1qK7lygtMa4NUl2582nP7aliLYuDEVpAbXJMkDq1qE+olIw/es+C8j1LJwvcRq1I2yWGtSn3EkDp9Dq5FdA==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
|
|
@ -805,9 +805,9 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@vscode/vsce-sign-linux-x64": {
|
"node_modules/@vscode/vsce-sign-linux-x64": {
|
||||||
"version": "2.0.5",
|
"version": "2.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/@vscode/vsce-sign-linux-x64/-/vsce-sign-linux-x64-2.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/@vscode/vsce-sign-linux-x64/-/vsce-sign-linux-x64-2.0.6.tgz",
|
||||||
"integrity": "sha512-XLT0gfGMcxk6CMRLDkgqEPTyG8Oa0OFe1tPv2RVbphSOjFWJwZgK3TYWx39i/7gqpDHlax0AP6cgMygNJrA6zg==",
|
"integrity": "sha512-/olerl1A4sOqdP+hjvJ1sbQjKN07Y3DVnxO4gnbn/ahtQvFrdhUi0G1VsZXDNjfqmXw57DmPi5ASnj/8PGZhAA==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
|
|
@ -819,9 +819,9 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@vscode/vsce-sign-win32-arm64": {
|
"node_modules/@vscode/vsce-sign-win32-arm64": {
|
||||||
"version": "2.0.5",
|
"version": "2.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/@vscode/vsce-sign-win32-arm64/-/vsce-sign-win32-arm64-2.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/@vscode/vsce-sign-win32-arm64/-/vsce-sign-win32-arm64-2.0.6.tgz",
|
||||||
"integrity": "sha512-hco8eaoTcvtmuPhavyCZhrk5QIcLiyAUhEso87ApAWDllG7djIrWiOCtqn48k4pHz+L8oCQlE0nwNHfcYcxOPw==",
|
"integrity": "sha512-ivM/MiGIY0PJNZBoGtlRBM/xDpwbdlCWomUWuLmIxbi1Cxe/1nooYrEQoaHD8ojVRgzdQEUzMsRbyF5cJJgYOg==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
|
|
@ -833,9 +833,9 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@vscode/vsce-sign-win32-x64": {
|
"node_modules/@vscode/vsce-sign-win32-x64": {
|
||||||
"version": "2.0.5",
|
"version": "2.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/@vscode/vsce-sign-win32-x64/-/vsce-sign-win32-x64-2.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/@vscode/vsce-sign-win32-x64/-/vsce-sign-win32-x64-2.0.6.tgz",
|
||||||
"integrity": "sha512-1ixKFGM2FwM+6kQS2ojfY3aAelICxjiCzeg4nTHpkeU1Tfs4RC+lVLrgq5NwcBC7ZLr6UfY3Ct3D6suPeOf7BQ==",
|
"integrity": "sha512-mgth9Kvze+u8CruYMmhHw6Zgy3GRX2S+Ed5oSokDEK5vPEwGGKnmuXua9tmFhomeAnhgJnL4DCna3TiNuGrBTQ==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
|
|
@ -874,9 +874,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/ansi-escapes": {
|
"node_modules/ansi-escapes": {
|
||||||
"version": "7.1.0",
|
"version": "7.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.1.1.tgz",
|
||||||
"integrity": "sha512-YdhtCd19sKRKfAAUsrcC1wzm4JuzJoiX4pOJqIoW2qmKj5WzG/dL8uUJ0361zaXtHqK7gEhOwtAtz7t3Yq3X5g==",
|
"integrity": "sha512-Zhl0ErHcSRUaVfGUeUdDuLgpkEo8KIFjB4Y9uAc46ScOpdDiU1Dbyplh7qWJeJ/ZHpbyMSM26+X3BySgnIz40Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
@ -1415,9 +1415,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/detect-libc": {
|
"node_modules/detect-libc": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.1.tgz",
|
||||||
"integrity": "sha512-vEtk+OcP7VBRtQZ1EJ3bdgzSfBjgnEalLTp5zjJrS+2Z1w2KZly4SBdac/WDU3hhsNAZ9E8SC96ME4Ey8MZ7cg==",
|
"integrity": "sha512-ecqj/sy1jcK1uWrwpR67UhYrIFQ+5WlGxth34WquCbamhFA6hkkwiu37o6J5xCHdo1oixJRfVRw+ywV+Hq/0Aw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
|
|
@ -2119,9 +2119,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/index-to-position": {
|
"node_modules/index-to-position": {
|
||||||
"version": "1.1.0",
|
"version": "1.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/index-to-position/-/index-to-position-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/index-to-position/-/index-to-position-1.2.0.tgz",
|
||||||
"integrity": "sha512-XPdx9Dq4t9Qk1mTMbWONJqU7boCoumEH7fRET37HX5+khDUl3J2W6PdALxhILYlIYx2amlwYcRPp28p0tSiojg==",
|
"integrity": "sha512-Yg7+ztRkqslMAS2iFaU+Oa4KTSidr63OsFGlOrJoW981kIYO3CGCS3wA95P1mUi/IVSJkn0D479KTJpVpvFNuw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
@ -2944,9 +2944,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/path-scurry/node_modules/lru-cache": {
|
"node_modules/path-scurry/node_modules/lru-cache": {
|
||||||
"version": "11.2.1",
|
"version": "11.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.2.tgz",
|
||||||
"integrity": "sha512-r8LA6i4LP4EeWOhqBaZZjDWwehd1xUJPCJd9Sv300H0ZmcUER4+JPh7bqqZeqs1o5pgtgvXm+d9UGrB5zZGDiQ==",
|
"integrity": "sha512-F9ODfyqML2coTIsQpSkRHnLSZMtkU8Q+mSfcaIyKwy58u+8k5nvAYeiNhsyMARvzNcXJ9QfWVrcPsC9e9rAxtg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "tsl-tools",
|
"name": "tsl-tools",
|
||||||
"displayName": "TSL",
|
"displayName": "TSL",
|
||||||
"version": "2.4.0",
|
"version": "3.0.0",
|
||||||
"description": "VSCode extension for TSL, with syntax highlighting, code completion, and formatting",
|
"description": "VSCode extension for TSL, with syntax highlighting, code completion, and formatting",
|
||||||
"publisher": "csh",
|
"publisher": "csh",
|
||||||
"homepage": "https://git.mytsl.cn/csh/tsl-devkit",
|
"homepage": "https://git.mytsl.cn/csh/tsl-devkit",
|
||||||
|
|
@ -43,6 +43,12 @@
|
||||||
"path": "./syntaxes/tsl.tmLanguage.json"
|
"path": "./syntaxes/tsl.tmLanguage.json"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"snippets": [
|
||||||
|
{
|
||||||
|
"language": "tsl",
|
||||||
|
"path": "./snippets/tsl.json"
|
||||||
|
}
|
||||||
|
],
|
||||||
"configuration": {
|
"configuration": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "TSL",
|
"title": "TSL",
|
||||||
|
|
@ -55,7 +61,7 @@
|
||||||
"tsl.server.arguments": {
|
"tsl.server.arguments": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"default": [
|
"default": [
|
||||||
"--log=trace",
|
"--log=info",
|
||||||
"--log-stderr"
|
"--log-stderr"
|
||||||
],
|
],
|
||||||
"description": "Arguments for TSL server",
|
"description": "Arguments for TSL server",
|
||||||
|
|
@ -84,13 +90,13 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^24.5.2",
|
"@types/node": "^24.5.2",
|
||||||
"@types/vscode": "^1.101.0",
|
"@types/vscode": "^1.90.0",
|
||||||
"@vscode/vsce": "^3.6.0",
|
"@vscode/vsce": "^3.6.0",
|
||||||
"prettier": "^3.6.2",
|
"prettier": "^3.6.2",
|
||||||
"typescript": "^5.9.2"
|
"typescript": "^5.9.2"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "^1.101.0"
|
"vscode": "^1.90.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"vscode-languageclient": "^9.0.1"
|
"vscode-languageclient": "^9.0.1"
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,287 @@
|
||||||
|
{
|
||||||
|
"If Statement": {
|
||||||
|
"prefix": "if",
|
||||||
|
"body": [
|
||||||
|
"if ${1:condition} then",
|
||||||
|
"begin",
|
||||||
|
"\t$0",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "If statement"
|
||||||
|
},
|
||||||
|
"If-Else Statement": {
|
||||||
|
"prefix": "ifelse",
|
||||||
|
"body": [
|
||||||
|
"if ${1:condition} then",
|
||||||
|
"begin",
|
||||||
|
"\t$2",
|
||||||
|
"end",
|
||||||
|
"else",
|
||||||
|
"begin",
|
||||||
|
"\t$0",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "If-else statement"
|
||||||
|
},
|
||||||
|
"If-ElseIf-Else Statement": {
|
||||||
|
"prefix": "ifelif",
|
||||||
|
"body": [
|
||||||
|
"if ${1:condition1} then",
|
||||||
|
"begin",
|
||||||
|
"\t$2",
|
||||||
|
"end",
|
||||||
|
"else if ${3:condition2} then",
|
||||||
|
"begin",
|
||||||
|
"\t$4",
|
||||||
|
"end",
|
||||||
|
"else",
|
||||||
|
"begin",
|
||||||
|
"\t$0",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "If-elseif-else statement"
|
||||||
|
},
|
||||||
|
"For Loop (To)": {
|
||||||
|
"prefix": "for",
|
||||||
|
"body": [
|
||||||
|
"for ${1:i} := ${2:0} to ${3:10} do",
|
||||||
|
"begin",
|
||||||
|
"\t$0",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "For loop with counter"
|
||||||
|
},
|
||||||
|
"For Loop (DownTo)": {
|
||||||
|
"prefix": "fordown",
|
||||||
|
"body": [
|
||||||
|
"for ${1:i} := ${2:10} downto ${3:0} do",
|
||||||
|
"begin",
|
||||||
|
"\t$0",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "For loop with counter (downto)"
|
||||||
|
},
|
||||||
|
"For-In Loop": {
|
||||||
|
"prefix": "forin",
|
||||||
|
"body": [
|
||||||
|
"for ${1:key}, ${2:value} in ${3:collection} do",
|
||||||
|
"begin",
|
||||||
|
"\t$0",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "For-in loop"
|
||||||
|
},
|
||||||
|
"While Loop": {
|
||||||
|
"prefix": "while",
|
||||||
|
"body": [
|
||||||
|
"while ${1:condition} do",
|
||||||
|
"begin",
|
||||||
|
"\t$0",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "While loop"
|
||||||
|
},
|
||||||
|
"Repeat-Until Loop": {
|
||||||
|
"prefix": "repeat",
|
||||||
|
"body": [
|
||||||
|
"repeat",
|
||||||
|
"\t$0",
|
||||||
|
"until ${1:condition};"
|
||||||
|
],
|
||||||
|
"description": "Repeat-until loop"
|
||||||
|
},
|
||||||
|
"Case Statement": {
|
||||||
|
"prefix": "case",
|
||||||
|
"body": [
|
||||||
|
"case ${1:expression} of",
|
||||||
|
"\t${2:value1}:",
|
||||||
|
"\tbegin",
|
||||||
|
"\t\t${3:statements}",
|
||||||
|
"\tend;",
|
||||||
|
"\t${4:value2}:",
|
||||||
|
"\tbegin",
|
||||||
|
"\t\t${5:statements}",
|
||||||
|
"\tend;",
|
||||||
|
"else",
|
||||||
|
"begin",
|
||||||
|
"\t$0",
|
||||||
|
"end",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "Case statement"
|
||||||
|
},
|
||||||
|
"Try-Except Block": {
|
||||||
|
"prefix": "try",
|
||||||
|
"body": [
|
||||||
|
"try",
|
||||||
|
"\t$1",
|
||||||
|
"except",
|
||||||
|
"\t$0",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "Try-except block"
|
||||||
|
},
|
||||||
|
"Function Declaration": {
|
||||||
|
"prefix": "funcdecl",
|
||||||
|
"body": [
|
||||||
|
"function ${1:functionName}(${2:})${3:: ${4:returnType}};$0"
|
||||||
|
],
|
||||||
|
"description": "Function declaration only"
|
||||||
|
},
|
||||||
|
"Function Implementation": {
|
||||||
|
"prefix": "func",
|
||||||
|
"body": [
|
||||||
|
"function ${1:functionName}(${2:})${3:: ${4:returnType}};",
|
||||||
|
"begin",
|
||||||
|
"\t$0",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "Function implementation"
|
||||||
|
},
|
||||||
|
"Function with Parameters": {
|
||||||
|
"prefix": "funcparam",
|
||||||
|
"body": [
|
||||||
|
"function ${1:functionName}(${2:param1}: ${3:type1}; ${4:param2}: ${5:type2})${6:: ${7:returnType}};",
|
||||||
|
"begin",
|
||||||
|
"\t$0",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "Function with typed parameters"
|
||||||
|
},
|
||||||
|
"Function with Var Parameters": {
|
||||||
|
"prefix": "funcvar",
|
||||||
|
"body": [
|
||||||
|
"function ${1:functionName}(var ${2:param1}: ${3:type1}; ${4:param2}: ${5:type2})${6:: ${7:returnType}};",
|
||||||
|
"begin",
|
||||||
|
"\t$0",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "Function with var/out parameters"
|
||||||
|
},
|
||||||
|
"Anonymous Function": {
|
||||||
|
"prefix": "anonfunc",
|
||||||
|
"body": [
|
||||||
|
"function(${1:})${2:: ${3:returnType}}",
|
||||||
|
"begin",
|
||||||
|
"\t$0",
|
||||||
|
"end"
|
||||||
|
],
|
||||||
|
"description": "Anonymous function"
|
||||||
|
},
|
||||||
|
"Unit Module": {
|
||||||
|
"prefix": "unit",
|
||||||
|
"body": [
|
||||||
|
"unit ${1:UnitName};",
|
||||||
|
"",
|
||||||
|
"interface",
|
||||||
|
"\t$2",
|
||||||
|
"",
|
||||||
|
"implementation",
|
||||||
|
"\t$0",
|
||||||
|
"",
|
||||||
|
"end."
|
||||||
|
],
|
||||||
|
"description": "Unit module structure"
|
||||||
|
},
|
||||||
|
"Unit with Initialization": {
|
||||||
|
"prefix": "unitfull",
|
||||||
|
"body": [
|
||||||
|
"unit ${1:UnitName};",
|
||||||
|
"",
|
||||||
|
"interface",
|
||||||
|
"\t${2:// public declarations}",
|
||||||
|
"",
|
||||||
|
"implementation",
|
||||||
|
"\t${3:// implementation}",
|
||||||
|
"",
|
||||||
|
"initialization",
|
||||||
|
"\t${4:// initialization code}",
|
||||||
|
"",
|
||||||
|
"finalization",
|
||||||
|
"\t${5:// cleanup code}",
|
||||||
|
"",
|
||||||
|
"end."
|
||||||
|
],
|
||||||
|
"description": "Complete unit with initialization and finalization"
|
||||||
|
},
|
||||||
|
"Class Definition": {
|
||||||
|
"prefix": "class",
|
||||||
|
"body": [
|
||||||
|
"type ${1:ClassName} = class${2:(${3:ParentClass})}",
|
||||||
|
"\t${4:public}",
|
||||||
|
"\t\t$0",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "Class definition"
|
||||||
|
},
|
||||||
|
"Class with Public/Private": {
|
||||||
|
"prefix": "classfull",
|
||||||
|
"body": [
|
||||||
|
"type ${1:ClassName} = class${2:(${3:ParentClass})}",
|
||||||
|
"\tpublic",
|
||||||
|
"\t\tfunction ${4:methodName}(${5:})${6:: ${7:returnType}};",
|
||||||
|
"\t\t$0",
|
||||||
|
"\tprotected",
|
||||||
|
"\t\t",
|
||||||
|
"\tprivate",
|
||||||
|
"\t\t",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "Class with public/protected/private sections"
|
||||||
|
},
|
||||||
|
"Class Method Implementation": {
|
||||||
|
"prefix": "classmethod",
|
||||||
|
"body": [
|
||||||
|
"function ${1:ClassName}.${2:methodName}(${3:})${4:: ${5:returnType}};",
|
||||||
|
"begin",
|
||||||
|
"\t$0",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "Class method implementation"
|
||||||
|
},
|
||||||
|
"Class Method with Override": {
|
||||||
|
"prefix": "methodoverride",
|
||||||
|
"body": [
|
||||||
|
"function ${1:methodName}(${2:})${3:: ${4:returnType}};",
|
||||||
|
"override;",
|
||||||
|
"begin",
|
||||||
|
"\t$0",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "Override method in class"
|
||||||
|
},
|
||||||
|
"Class Method with Virtual": {
|
||||||
|
"prefix": "methodvirtual",
|
||||||
|
"body": [
|
||||||
|
"function ${1:methodName}(${2:})${3:: ${4:returnType}};",
|
||||||
|
"virtual;",
|
||||||
|
"begin",
|
||||||
|
"\t$0",
|
||||||
|
"end;"
|
||||||
|
],
|
||||||
|
"description": "Virtual method in class"
|
||||||
|
},
|
||||||
|
"Property Declaration": {
|
||||||
|
"prefix": "prop",
|
||||||
|
"body": [
|
||||||
|
"property ${1:propertyName}: ${2:type} read ${3:getter} write ${4:setter};$0"
|
||||||
|
],
|
||||||
|
"description": "Property with getter and setter"
|
||||||
|
},
|
||||||
|
"Property Read Only": {
|
||||||
|
"prefix": "propread",
|
||||||
|
"body": [
|
||||||
|
"property ${1:propertyName}: ${2:type} read ${3:getter};$0"
|
||||||
|
],
|
||||||
|
"description": "Read-only property"
|
||||||
|
},
|
||||||
|
"Begin-End Block": {
|
||||||
|
"prefix": "begin",
|
||||||
|
"body": [
|
||||||
|
"begin",
|
||||||
|
"\t$0",
|
||||||
|
"end"
|
||||||
|
],
|
||||||
|
"description": "Begin-end block"
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue