
- Syntax highlighting
- Code completion
- Go to definition
- Find references
- Hover information
- Diagnostics
- Code formatting
- Inlay hints
First, clone and build the language server:
git clone https://github.com/i582/language-server
cd language-server
yarn install
yarn build
The easiest way to get started with Tact is using VS Code:
- Run the following command to create the VSIX package:
yarn package
- In VS Code:
- Open the Command Palette (
Ctrl+Shift+P
orCmd+Shift+P
) - Type "Install from VSIX"
- Select the generated
.vsix
file - Reload VS Code
- Open the Command Palette (
The extension will automatically activate when you open any .tact
file.
The language server supports the following settings:
{
tact: {
stdlib: {
path: "",
// Path to Tact standard library. If empty, will try to find in node_modules
},
hints: {
types: true,
// Show type hints for variables and expressions
parameters: true,
// Show parameter name hints in function calls
showMethodId: true,
// Show method ID hints for contract functions
exitCodeFormat: "decimal",
// Format of exit codes in require(): "decimal" or "hex"
},
codeLens: {
enabled: true,
// Enable/disable all code lens
},
},
}
- Make sure you have Helix installed and configured
- Add the following configuration to your
~/.config/helix/languages.toml
:
[[language]]
name = "tact"
language-servers = ["tact-language-server"]
[language-server.tact-language-server]
command = "node"
args = ["path/to/language-server/dist/server.js", "--stdio"]
- Replace
path/to/language-server
with the actual path where you cloned the repository - Restart Helix for changes to take effect
Prerequisites:
- nvim-lspconfig
- Neovim 0.5.0 or newer
Setup steps:
- Add
tact.lua
to yourlua/lspconfig/server_configurations
directory with the following content:
local util = require 'lspconfig.util'
return {
default_config = {
cmd = { 'node', '/absolute/path/to/language-server/dist/server.js', '--stdio' },
filetypes = { 'tact' },
root_dir = util.root_pattern('package.json', '.git'),
},
docs = {
description = [[
Tact Language Server
https://github.com/i582/language-server
]],
default_config = {
root_dir = [[root_pattern("package.json", ".git")]],
},
},
}
- Add the following to your
init.lua
:
require'lspconfig'.tact.setup {}
-
Install LSP package:
- Open Command Palette (
Ctrl+Shift+P
orCmd+Shift+P
) - Select "Package Control: Install Package"
- Search for and select "LSP"
- Open Command Palette (
-
Install the
Tact
package via Package Control for syntax highlighting -
Add the following configuration to your LSP settings (
Preferences > Package Settings > LSP > Settings
):
{
"clients": {
"tact": {
"enabled": true,
"command": ["node", "path/to/language-server/dist/server.js", "--stdio"],
"selector": "source.tact"
}
}
}
- Create a new file with
.tact
extension to verify the setup
Common issues:
- Path to the language server is incorrect
- Node.js is not installed
- Language server wasn't built properly
The language server generates logs that can help diagnose issues:
- For standalone server: logs are written to
dist/tact-language-server.log
in the language server directory - For VS Code extension: logs can be found in:
- Windows:
%USERPROFILE%\.vscode\extensions\tact-[version]\dist\tact-language-server.log
- macOS/Linux:
~/.vscode/extensions/tact-[version]/dist/tact-language-server.log
- Windows:
For more help, please open an issue.
MIT