Skip to content

kaiiserni/pinescript.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pinescript.nvim

Pine Script v6 support for Neovim — tree-sitter syntax highlighting and LSP, zero-config.

Features

  • Syntax highlighting — bundled tree-sitter grammar, auto-compiled on first use
  • LSP support — hover, diagnostics, completion via pinescript-vsc-server-rust
  • Filetype detection.pine, .pinescript extensions and //@version= headers
  • Zero-config — everything auto-installs on first use
  • Health checks:checkhealth pinescript

Requirements

  • Neovim >= 0.9.0
  • C compiler (cc or gcc) — for compiling the tree-sitter parser
  • nvim-lspconfig — for LSP features (optional)
  • Rust/Cargo >= 1.85 — for building the LSP server (optional)

Installation

lazy.nvim

{
  "kaiiserni/pinescript.nvim",
  dependencies = {
    "neovim/nvim-lspconfig", -- optional, for LSP features
  },
  ft = "pine",
  opts = {},
}

Configuration

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
  },
})

Usage

Open a .pine file or any file starting with //@version=. On first use:

  1. Filetype detected as pine
  2. Tree-sitter parser compiled from bundled grammar (instant)
  3. LSP server cloned and built via cargo build --release (~1 min)
  4. Syntax highlighting and LSP features activate

Subsequent opens are instant.

Health Check

:checkhealth pinescript verifies all dependencies and installation status.

API

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

Credits

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors