tony-lsp

command
v0.0.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

README

Tony Language Server

A Language Server Protocol (LSP) implementation for the Tony format, providing syntax validation, hover information, formatting, and code completion.

Features

  • Syntax Validation: Real-time diagnostics for Tony format syntax errors
  • Hover Information: Type and value information when hovering over elements
  • Document Formatting: Format Tony documents according to the Tony specification
  • Code Completion: Context-aware completion suggestions for tags, keywords, and constructs

Building

go build ./cmd/tony-lsp

Usage

The language server communicates via stdio using the Language Server Protocol. It can be used with any LSP-compatible editor.

VS Code

Create a VS Code extension configuration or use a generic LSP client:

{
  "name": "tony-lsp",
  "command": "tony-lsp",
  "args": []
}
Neovim

Using nvim-lspconfig:

require('lspconfig').tony_lsp.setup({
  cmd = {'tony-lsp'},
  filetypes = {'tony'},
  root_dir = function(fname)
    return vim.fn.getcwd()
  end,
})
Vim

Using vim-lsp:

if executable('tony-lsp')
  au User lsp_setup call lsp#register_server({
    \ 'name': 'tony-lsp',
    \ 'cmd': {server_info->['tony-lsp']},
    \ 'whitelist': ['tony'],
    \ })
endif

Supported LSP Features

  • textDocument/didOpen - Document opened
  • textDocument/didChange - Document changed (incremental sync)
  • textDocument/didClose - Document closed
  • textDocument/hover - Hover information
  • textDocument/formatting - Document formatting
  • textDocument/completion - Code completion

Implementation Details

The language server uses the existing Tony parser (ytool/parse) and encoder (ytool/encode) to provide language features. It maintains an in-memory document store and publishes diagnostics as documents are edited.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL