Delegate TCL folding to server, fix bugs, and enhance stability

- Move TCL folding range computation from client to language server, avoiding duplicate regions.
- Serialize language server restarts to prevent multiple server instances running concurrently.
- Pin server-side Python dependencies to specific minor versions for improved stability and predictability.
- Make debug server connection non-fatal, allowing the language server to start even if the debugger isn't attached.
- Optimize semantic token generation by caching Tclint plugin commands.
This commit is contained in:
Christoph Brandau
2026-06-18 20:38:47 +02:00
parent 3ad3847045
commit f60c4563e4
7 changed files with 74 additions and 112 deletions
+11 -1
View File
@@ -27,7 +27,17 @@ if debugger_path:
# 5678 is the default port, If you need to change it update it here
# and in launch.json.
debugpy.connect(5678)
# Connecting requires the "Python debug server" listener (launch.json) to be
# up first. If it isn't (e.g. wrong launch config was used), don't crash the
# whole language server - just continue running without the debugger attached.
try:
debugpy.connect(5678)
except (ConnectionRefusedError, OSError) as exc:
print(
f"debugpy: could not connect to debug adapter on port 5678 "
f"({exc}); continuing without debugging.",
file=sys.stderr,
)
# This will ensure that execution is paused as soon as the debugger
# connects to VS Code. If you don't want to pause here comment this