Compare commits

..

No commits in common. "540d58e86fb08e22b810de58c5159ba66ab51f99" and "696618ff1dd27a9a10fa6cd8942b25983d52376d" have entirely different histories.

7 changed files with 21 additions and 48 deletions

View File

@ -20,8 +20,6 @@ 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;
@ -32,7 +30,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.P2; obj.P1;
self.P1; self.P1;
end end
@ -72,15 +70,3 @@ 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 inherited self syn keyword tslClassModifier override overload virtual property self inherited
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,17 +66,15 @@ 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 syn match tslFuncName '\%(\h\w*\.\)\?\h\w*' contained nextgroup=tslFuncParams skipwhite contains=tslTypeNameInFunc,tslDotInFunc,tslFuncNamePart
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
@ -89,8 +87,12 @@ 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 syn match tslVarDecl '\(?\s\)\@<!\h\w\s:=\@!\s[^;?];' contains=tslVarName,tslVarType
syn match tslPropertyChain '\h\w*\%(\.\h\w*\)\+\>' contains=tslObjectName,tslPropertyDot,tslPropertyName syn match tslVarName '\(?\s\)\@<!\h\w\ze\s:=\@!' contained
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
@ -105,7 +107,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 '\%((\|;\s*\)\zs\h\w*\s*:\s*[^;,)]*' contained syn match tslNamedParam '\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
@ -116,21 +118,8 @@ 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
# Variable declaration syn match tslParamSep '[;,]' contained
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 '[+\-*/<>=!&|^~%]'
@ -155,7 +144,6 @@ 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
@ -191,8 +179,8 @@ hi def link tslNull Constant
hi def link tslMathConstant Number hi def link tslMathConstant Number
# 其他元素的高亮链接保持不变 # 其他元素的高亮链接保持不变
hi def link tslObjectName Type hi def link tslClassName Type
hi def link tslPropertyDot Operator hi def link tslDot Operator
hi def link tslPropertyName Special hi def link tslPropertyName Special
hi def link tslFuncName Function hi def link tslFuncName Function

View File

@ -2,10 +2,6 @@
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

@ -0,0 +1,3 @@
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.1", "version": "2.3.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",

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|initialization|finalization)\\b" "match": "(?i)\\b(program|function|procedure|unit|uses|implementation|interface|initalization|finalization)\\b"
}, },
{ {
"name": "keyword.control.interface.tsl", "name": "keyword.control.interface.tsl",