Skip to content

Latest commit

 

History

History
156 lines (114 loc) · 3.26 KB

File metadata and controls

156 lines (114 loc) · 3.26 KB

NimbyScript Neovim Support

Language server integration for NimbyScript in Neovim.

Prerequisites

  • Neovim 0.10+ (uses vim.system for async operations)
  • curl available in PATH (for auto-downloading the LSP binary)
  • nvim-treesitter (optional, for syntax highlighting)

The LSP binary is automatically downloaded from GitHub releases on first use.

Installation

Using lazy.nvim

{
    'supermanifolds/nimby_lsp',
    config = function()
        require('nimbyscript').setup({
            -- Optional: specify path to LSP binary
            -- cmd = '/path/to/nimbyscript-lsp',
        })
    end,
    ft = { 'nimbyscript' },
}

Using packer.nvim

use {
    'supermanifolds/nimby_lsp',
    config = function()
        require('nimbyscript').setup()
    end,
}

Manual Installation

  1. Clone the repository
  2. Add the editors/neovim directory to your Neovim runtimepath
  3. Add to your init.lua:
require('nimbyscript').setup()

Configuration Options

require('nimbyscript').setup({
    -- Path to LSP binary (auto-downloads from GitHub if nil)
    cmd = nil,

    -- Automatically check for and install updates on startup
    auto_update = true,

    -- LSP server settings
    settings = {},

    -- File types to attach
    filetypes = { 'nimbyscript' },

    -- Root directory markers
    root_markers = { '.git', 'mod.txt' },

    -- Enable debug logging
    debug = false,

    -- Enable inlay hints (type annotations and parameter names)
    inlay_hints_enabled = true,

    -- Enable semantic token highlighting
    semantic_tokens_enabled = true,
})

Using a Custom Binary

To use a locally built or custom binary instead of auto-downloading:

require('nimbyscript').setup({
    cmd = '/path/to/nimbyscript-lsp',
})

Disabling Auto-Update

To disable automatic update checks on startup:

require('nimbyscript').setup({
    auto_update = false,
})

Features

  • Syntax highlighting (tree-sitter based)
  • Diagnostics (semantic errors and warnings)
  • Completions (keywords, types, functions, methods, fields)
  • Signature help (function parameter hints)
  • Hover information (type info and documentation)
  • Document symbols
  • Semantic tokens (enhanced highlighting from LSP)
  • Filetype icons (nvim-web-devicons and mini.icons)

Tree-sitter Syntax Highlighting

The tree-sitter parser is automatically registered when you call require('nimbyscript').setup().

To install and enable the parser:

:TSInstall nimbyscript

Make sure highlighting is enabled in your nvim-treesitter config:

require('nvim-treesitter.configs').setup({
    highlight = { enable = true },
})

Troubleshooting

LSP not starting

  1. Check if the binary exists (auto-downloaded or custom path):

    # Auto-downloaded location:
    ls ~/.local/share/nvim/nimbyscript/
    # Or check if custom binary is in PATH:
    which nimbyscript-lsp
  2. Check Neovim LSP logs:

    :LspLog
  3. Enable debug mode:

    require('nimbyscript').setup({ debug = true })

No syntax highlighting

  1. Ensure nvim-treesitter is installed and configured
  2. Install the parser: :TSInstall nimbyscript
  3. Check parser status: :TSInstallInfo