VS Code¶
The extension provides Tcl language support for VS Code 1.90 or newer. It
recognizes .tcl, .tm, and .test files and starts the server over stdio.
Install¶
Download the .vsix for your platform from
GitHub Releases. Release
extensions include the server, so no separate Python installation is needed.
The server still requires tclsh on VS Code’s PATH.
Use Extensions: Install from VSIX… in VS Code, or run:
code --install-extension /path/to/tcl-ls-vscode-<version>@<target>.vsix
Server settings¶
The extension selects a server in this order:
tcl-ls.server.command, if setthe virtual environment under
tcl-ls.server.repoRoot, if setthe server bundled with the extension
tcl-lsonPATH
Setting |
Purpose |
|---|---|
|
Executable path or name. Empty by default. |
|
Arguments for an explicit command. Defaults to |
|
tcl-ls checkout to use when no command is set. Empty by default. |
|
Server working directory. Relative paths start at the first workspace folder. Empty uses the launcher’s default. |
|
Restart when |
For an explicitly installed server:
{
"tcl-ls.server.command": "/absolute/path/to/tcl-ls",
"tcl-ls.server.args": []
}
If server.args is empty, server.command can contain a full command line;
quote paths containing spaces. The repoRoot and cwd settings accept
${workspaceFolder} and ${workspaceFolderBasename} placeholders. Clear a
path setting with an empty string.
Use tcl-ls: Restart Language Server to restart manually. Startup errors and restart details appear in the tcl-ls output channel.
Ordinary Tcl plugin scripts, such as .tcl-ls/options.tcl, are not watched
by the restart setting. After saving a plugin, edit or reopen a source file
to trigger analysis, or restart the server manually.
Use a checkout¶
Run uv sync in the tcl-ls repository, then set:
{
"tcl-ls.server.repoRoot": "/absolute/path/to/tcl-ls"
}
Clear tcl-ls.server.command so this setting takes effect.
Build the extension¶
From a prepared repository checkout, with Node.js and npm available:
make -C editors/vscode bundled-vsix
This builds the server and writes
dist/tcl-ls-vscode-<version>@<target>.vsix. Install it as described above.
Use make -C editors/vscode vsix to package the extension without a server
and select one through the settings. The F5 Extension Development Host is
also available for debugging.