Skip to content

Latest commit

 

History

History
206 lines (146 loc) · 6.07 KB

README.md

File metadata and controls

206 lines (146 loc) · 6.07 KB

tact-extracted-ls

⚡ Tact language server (of LSP specification), extracted and re-packaged from its official VSCode extension.

⚙ Automatically builds upon updates in the upstream VSCode extension through Github Actions.

Features

  • Code completion for all variables, functions, global parameters and unique types for tact
  • Code completion for all contracts / libraries in the current file and all referenced imports
  • Error highlighting
  • Additional information by hover event (very scarce)

Known issues

  • Formatter from the Tact's VSCode extension is not a part of language server implementation (i.e. not in server.ts), and therefore it's unaccessible in such re-packaged form.

Installation

The only requirement is having a Node.js version 20 or higher installed. Then, run the following command to install the extracted Tact language server:

npm i -g tact-extracted-ls
Alternatives

Using yarn:

yarn global add tact-extracted-ls

Using pnpm:

pnpm add -g tact-extracted-ls

Using bun:

bun add -g tact-extracted-ls

Clients

The following editors and IDEs have available clients:

Sublime Text

First, install the LSP package if it's not installed already.

Then, open its settings (Preferences: LSP Settings in the command palette, Ctrl/Cmd+Shift+P), then add this config:

{
  "clients": {
    "Tact": {
      "enabled": true,
      "command": ["tact-extracted-ls", "--stdio"],
      "selector": "source.tact"
    }
  }
}

Vim

For Vim 8 or later install the plugin prabirshrestha/vim-lsp and add the following to .vimrc:

if executable('tact-extracted-ls')
  au User lsp_setup call lsp#register_server({
        \ 'name': 'tact',
        \ 'cmd': {server_info->['tact-extracted-ls', '--stdio']},
        \ 'allowlist': ['tact'],
        \ })
endif

For Vim 8 or Neovim using YouCompleteMe, add the following to .vimrc:

let g:ycm_language_server =
    \ [
    \   {
    \     'name': 'tact',
    \     'cmdline': [ 'tact-extracted-ls', '--stdio' ],
    \     'filetypes': [ 'tact' ],
    \   }
    \ ]

For Vim 8 or Neovim using neoclide/coc.nvim, according to it's Wiki article, add the following to your coc-settings.json:

  "languageserver": {
    "tact": {
      "command": "tact-extracted-ls",
      "args": ["--stdio"],
      "filetypes": ["tact"],
      "ignoredRootPaths": ["~"]
    }
  }

Neovim

For Neovim 0.8 and later:

vim.api.nvim_create_autocmd('FileType', {
  pattern = 'tact',
  callback = function()
    vim.lsp.start({
      name = 'tact-extracted-ls',
      cmd = { 'tact-extracted-ls', '--stdio' },
    })
  end,
})

For Neovim prior to 0.8 and using autozimu/LanguageClient-neovim, add the following to init.vim:

let g:LanguageClient_serverCommands = {
    \ 'tact': ['tact-extracted-ls', '--stdio']
    \ }

Helix

Create or open ~/.config/helix/languages.toml (Use ~\AppData\Roaming\helix\languages.toml on Windows) and add the following:

[[language]]
name = "tact"
language-servers = ["tact-extracted-ls"]

[language-server.tact-extracted-ls]
command = "tact-extracted-ls"
args = [ "--stdio" ]

Oni

On the config file (File → Preferences → Edit Oni config) add the following configuration:

"language.tact.languageServer.command": "tact-extracted-ls",
"language.tact.languageServer.arguments": ["--stdio"],

JetBrains

As of now, Language Server Protocol support is unofficial and only available in IntelliJ IDEA and related IDEs from JetBrains through 3rd-party plugins. Instead, please use the official extension for all things TON in IntelliJ IDEs: intellij-ton.

The rest

Didn't find your editor on the list? Try searching for tips in the respective documentation or related community resources.

Note, that some editors may not support the Language Server Protocol (LSP), in which case you're out of luck until such support is added by editor maintainers or external contributors, such as yourself.

If you did manage to set up and use the Tact language server in your editor, then please file an issue or submit a PR to this repository and explain how you did it 🤗

Contributing

If you have any issues which arise ONLY in the case of using provided language servers outside of VSCode, please, file an issue to the present repository.

In any other case, please, file issues to the upstream extension repository: Tact VSCode extension.

Credits

Based on The Open Network.

Packaged with 🤍 by Novus Nota.

License