Pine Script v6 support for Neovim — tree-sitter syntax highlighting and LSP, zero-config.
- Syntax highlighting — bundled tree-sitter grammar, auto-compiled on first use
- LSP support — hover, diagnostics, completion via pinescript-vsc-server-rust
- Filetype detection —
.pine,.pinescriptextensions and//@version=headers - Zero-config — everything auto-installs on first use
- Health checks —
:checkhealth pinescript
- Neovim >= 0.9.0
- C compiler (
ccorgcc) — for compiling the tree-sitter parser - nvim-lspconfig — for LSP features (optional)
- Rust/Cargo >= 1.85 — for building the LSP server (optional)
{
"kaiiserni/pinescript.nvim",
dependencies = {
"neovim/nvim-lspconfig", -- optional, for LSP features
},
ft = "pine",
opts = {},
}All options with defaults:
require("pinescript").setup({
lsp = {
enabled = true, -- enable LSP features
auto_install = true, -- auto-build LSP server on first use
path = nil, -- custom path to LSP binary (nil = auto-managed)
},
treesitter = {
enabled = true, -- enable tree-sitter highlighting
auto_install = true, -- auto-compile parser on first use
},
})Open a .pine file or any file starting with //@version=. On first use:
- Filetype detected as
pine - Tree-sitter parser compiled from bundled grammar (instant)
- LSP server cloned and built via
cargo build --release(~1 min) - Syntax highlighting and LSP features activate
Subsequent opens are instant.
:checkhealth pinescript verifies all dependencies and installation status.
local pinescript = require("pinescript")
pinescript.is_lsp_installed() -- bool
pinescript.is_treesitter_installed() -- bool
pinescript.get_lsp_path() -- string
pinescript.ensure_lsp(callback) -- manually install/rebuild LSP- Tree-sitter grammar: mushroom-men-Trading/pinescript-pro
- LSP server: zelosleone/pinescript-vsc-server-rust
MIT