Compare commits

...

3 Commits

Author SHA1 Message Date
csh 540d58e86f v2.3.1 2025-07-10 18:08:09 +08:00
csh a07586d942 update test 2025-07-10 18:04:32 +08:00
csh f109316580 update tsl.vim 2025-07-10 18:04:17 +08:00
7 changed files with 48 additions and 21 deletions

View File

@ -20,6 +20,8 @@ public
property P1 write param1_ read param1_; property P1 write param1_ read param1_;
private private
[weakref]obj: integer;
[weakref]b: MyClass;
param1_: real; param1_: real;
param2_: array of string; param2_: array of string;
end; end;
@ -30,7 +32,7 @@ end;
function MyClass.Func3(a: real = 1; b: string = "123"): array of string; function MyClass.Func3(a: real = 1; b: string = "123"): array of string;
begin begin
obj.P1; obj.P1.P2;
self.P1; self.P1;
end end
@ -70,3 +72,15 @@ b := array((1, 2), (3, 4));
sql += "update ts_xbcheck result set isvalid = "$status$remark$" where checkid in ('"$array2str sql += "update ts_xbcheck result set isvalid = "$status$remark$" where checkid in ('"$array2str
(checkid[(i-1)*len:], "','")$"');\r\n" (checkid[(i-1)*len:], "','")$"');\r\n"
sql += sql +=
// tsl-web块
<?tslx>
<HTML>
<Body>
<p>
<?tsl write("TSL Script");?>
</p>
</Body>
</HTML>

View File

@ -20,7 +20,7 @@ syn keyword tslPrimitiveType string integer boolean int64 real array
# 类型系统和面向对象 # 类型系统和面向对象
syn keyword tslClassType type class fakeclass new syn keyword tslClassType type class fakeclass new
syn keyword tslClassModifier override overload virtual property self inherited syn keyword tslClassModifier override overload virtual property inherited self
syn keyword tslAccessModifier public protected private published syn keyword tslAccessModifier public protected private published
syn keyword tslConstructor create destroy operator syn keyword tslConstructor create destroy operator
syn keyword tslReferenceModifier weakref autoref syn keyword tslReferenceModifier weakref autoref
@ -66,15 +66,17 @@ syn keyword tslBoolean false true
syn keyword tslNull nil syn keyword tslNull nil
syn keyword tslMathConstant inf nan syn keyword tslMathConstant inf nan
# todo
syn keyword tslTodo FIXME NOTE NOTES TODO XXX contained syn keyword tslTodo FIXME NOTE NOTES TODO XXX contained
# Function definitions # Function definitions
syn match tslFuncName '\%(\h\w*\.\)\?\h\w*' contained nextgroup=tslFuncParams skipwhite contains=tslTypeNameInFunc,tslDotInFunc,tslFuncNamePart 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 match tslFuncName '\.\@<=\h\w*' contained
syn region tslFuncParams syn region tslFuncParams
\ matchgroup=Delimiter
\ start='(' \ start='('
\ end=')' \ end=')'
\ contained \ contained
@ -87,12 +89,8 @@ syn match tslReturnType ':\s*[^;]*' contained contains=tslColon
syn match tslParamSep '[;,]' contained syn match tslParamSep '[;,]' contained
syn match tslColon ':' contained syn match tslColon ':' contained
syn match tslVarDecl '\(?\s\)\@<!\h\w\s:=\@!\s[^;?];' contains=tslVarName,tslVarType # Property chain
syn match tslVarName '\(?\s\)\@<!\h\w\ze\s:=\@!' contained syn match tslPropertyChain '\h\w*\%(\.\h\w*\)\+\>' contains=tslObjectName,tslPropertyDot,tslPropertyName
syn match tslVarType ':=\@!\s[^;?]' contained contains=tslColon
# 匹配完整的属性链
syn match tslPropertyChain '\h\w*\%(\.\h\w*\)\+' contains=tslObjectName,tslPropertyDot,tslPropertyName
syn match tslObjectName '\h\w*\ze\.\h\w*' contained 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*\%(\ze\.\|\ze\s*[^(]\|\ze\s*$\)' contained
@ -107,7 +105,7 @@ syn region tslFuncCall
\ contains=tslFuncCallName,tslFuncCall,tslNamedParam,tslPositionalParam,tslString,tslRawString,tslNumber,tslIdentifier,tslOperator,tslParamSep \ contains=tslFuncCallName,tslFuncCall,tslNamedParam,tslPositionalParam,tslString,tslRawString,tslNumber,tslIdentifier,tslOperator,tslParamSep
\ transparent \ transparent
syn match tslNamedParam '\h\w*\s*:\s*[^;,)]*' contained syn match tslNamedParam '\%((\|;\s*\)\zs\h\w*\s*:\s*[^;,)]*' contained
\ contains=tslParamName,tslParamColon,tslParamValue \ contains=tslParamName,tslParamColon,tslParamValue
syn match tslParamName '\h\w*\ze\s*:' contained syn match tslParamName '\h\w*\ze\s*:' contained
@ -118,8 +116,21 @@ syn match tslParamValue ':\s*\zs[^;,)]*' contained
syn match tslPositionalParam '[^;,():]*' contained syn match tslPositionalParam '[^;,():]*' contained
\ contains=tslString,tslNumber,tslIdentifier,tslOperator,tslFuncCall,tslFuncCallName \ contains=tslString,tslNumber,tslIdentifier,tslOperator,tslFuncCall,tslFuncCallName
syn match tslParamSep '[;,]' contained # Variable declaration
syn match tslVarDeclWithTag '\]\@<=\s*\h\w*\ze\s*:\%(=\)\@!'
\ nextgroup=tslVarTypeDecl skipwhite
\ contains=tslVarName
syn match tslVarDeclStart '\%(^\s*\|;\s*\)\zs\h\w*\ze\s*:\%(=\)\@!'
\ nextgroup=tslVarTypeDecl skipwhite
\ contains=tslVarName
syn match tslVarName '\h\w*' contained
syn region tslVarTypeDecl
\ matchgroup=tslVarDelimiter start=':\%(=\)\@!' end=';'
\ contained keepend oneline
\ contains=tslVarType
syn match tslVarType '[^;]*' contained
# Operators and delimiters # Operators and delimiters
syn match tslOperator '[+\-*/<>=!&|^~%]' syn match tslOperator '[+\-*/<>=!&|^~%]'
@ -144,6 +155,7 @@ syn match tslNumber '\<\d\+[eE][+-]\=\d\+[jJ]\=\>'
syn match tslNumber '\<\d\+\.\%([eE][+-]\=\d\+\)\=[jJ]\=\%(\W\|$\)\@=' syn match tslNumber '\<\d\+\.\%([eE][+-]\=\d\+\)\=[jJ]\=\%(\W\|$\)\@='
syn match tslNumber '\%(^\|\W\)\zs\d*\.\d\+\%([eE][+-]\=\d\+\)\=[jJ]\=\>' syn match tslNumber '\%(^\|\W\)\zs\d*\.\d\+\%([eE][+-]\=\d\+\)\=[jJ]\=\>'
# Highlight links # Highlight links
hi def link tslProgramStructure Statement hi def link tslProgramStructure Statement
hi def link tslModuleStructure Statement hi def link tslModuleStructure Statement
@ -179,8 +191,8 @@ hi def link tslNull Constant
hi def link tslMathConstant Number hi def link tslMathConstant Number
# 其他元素的高亮链接保持不变 # 其他元素的高亮链接保持不变
hi def link tslClassName Type hi def link tslObjectName Type
hi def link tslDot Operator hi def link tslPropertyDot Operator
hi def link tslPropertyName Special hi def link tslPropertyName Special
hi def link tslFuncName Function hi def link tslFuncName Function

View File

@ -2,6 +2,10 @@
Notable changes to the `TSL` extension will be documented in thio file. Notable changes to the `TSL` extension will be documented in thio file.
## [2.3.1]: 2025-07-10
- 修复:关键字`initialization`拼写错误
## [2.3.0]: 2025-07-03 ## [2.3.0]: 2025-07-03
- 修改插件名为`tsl-tools` - 修改插件名为`tsl-tools`

View File

@ -1,3 +0,0 @@
cp ../lsp-server/build/arch/tsl-server ./bin/tsl-server
cp ../lsp-server/build/msys2/tsl-server.exe ./bin/tsl-server.exe
npx vsce package

View File

@ -1,7 +1,7 @@
{ {
"name": "tsl-tools", "name": "tsl-tools",
"displayName": "TSL", "displayName": "TSL",
"version": "2.3.0", "version": "2.3.1",
"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",

View File

@ -431,7 +431,7 @@
"patterns": [ "patterns": [
{ {
"name": "keyword.control.program-structure.tsl", "name": "keyword.control.program-structure.tsl",
"match": "(?i)\\b(program|function|procedure|unit|uses|implementation|interface|initalization|finalization)\\b" "match": "(?i)\\b(program|function|procedure|unit|uses|implementation|interface|initialization|finalization)\\b"
}, },
{ {
"name": "keyword.control.interface.tsl", "name": "keyword.control.interface.tsl",