Compare commits

...
3 Commits
Author SHA1 Message Date
Christoph b6228503fc Merge pull request 'Highlight braced stored-proc names in lappend arguments' (#42) from #41 into main
build_and_puplish.yml / build_and_publish (release) Successful in 32s
2026-09-21 19:13:31 +00:00
Christoph Brandau 4de05caac7 fix(semantic_tokens): highlight braced stored-proc names in lappend
Treat braced lappend arguments that match custom or standard procedure names as
function tokens for semantic highlighting. This applies the same visual
highlighting as calls but does not treat the literal as executable Tcl. Previously
such braced stored-proc names were not highlighted.
2026-09-21 21:12:47 +02:00
Christoph 5c3ebc4c82 Update version to 2026.9.500 2026-09-21 18:54:48 +00:00
2 changed files with 11 additions and 2 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "nx-post-support",
"displayName": "NX Postprocessor Support",
"description": "VS Code extension for NX CAM postprocessor development with language support and remote Tcl debugging for CDL, TCL, and DEF files",
"version": "2026.9.400",
"version": "2026.9.500",
"publisher": "Christoph",
"icon": "images/nx-1.png",
"activationEvents": [
+10 -1
View File
@@ -4,7 +4,7 @@ from typing import List
import attrs
from common.load_data import standard_items
from tclint.commands.plugins import PluginManager
from tclint.syntax_tree import BareWord, Command, QuotedWord, Visitor
from tclint.syntax_tree import BareWord, BracedWord, Command, QuotedWord, Visitor
from tools.variable_names import variable_name
from tools.tcloo_symbols import class_symbols
from tools.tcloo_completion import _analyze
@@ -173,6 +173,15 @@ class _Highlighter(Visitor):
def visit_command(self, command: Command):
routine = command.routine
# Stored procedure names in braced lappend arguments use the same
# highlighting as calls, without treating the literal as executable Tcl.
if routine.contents in {"lappend", "::lappend"}:
for argument in command.args:
if (isinstance(argument, BracedWord)
and argument.contents in self._custom_function_names | _STANDARD_PROC_NAMES):
line, col = argument.contents_pos
self._append_token((line - 1, col - 1), len(argument.contents), "function", [])
# Highlight functions (custom or standard) when used as the routine
name = getattr(routine, "contents", None)
if name: