npk-lsbuilt and in yourPATH(or use full path)npkcbuilt and in yourPATH(or setNPKC_PATH)ikos-analyzeravailable (or setNIKOS_ANALYZER_PATH)
Quick check:
npk-ls --version # or: ./build/npk-ls --version
npkc --version # or: ./build/npkc --version
echo $NIKOS_ANALYZER_PATHNo VS Code extension exists yet for Nitpick. Until one is published, use the generic vscode-glspc extension or configure a custom language client.
Add to .vscode/settings.json:
{
"languageServerExample.serverOptions": {
"command": "npk-ls",
"transport": "stdio"
}
}When diagnostics are visible, NIKOS findings will have:
- Source:
nikos-abstract - Code: e.g.
check_dbz,check_sio
You can filter the Problems panel by source name.
Set in your shell profile or VS Code terminal settings:
export NPKC_PATH=/path/to/build/npkc
export NIKOS_ANALYZER_PATH=/path/to/nikos/build/analyzer/ikos-analyzerInstall nvim-lspconfig if not already installed.
Add to your Neovim config (init.lua or a plugin file):
-- NIKOS/Nitpick Language Server configuration
-- NLS-024: nvim-lspconfig snippet for npk-ls stdio mode
local lspconfig = require('lspconfig')
local configs = require('lspconfig.configs')
-- Register 'npk_ls' as a custom server (not in upstream lspconfig yet)
if not configs.npk_ls then
configs.npk_ls = {
default_config = {
cmd = { 'npk-ls' }, -- or full path: '/home/user/build/npk-ls'
filetypes = { 'nitpick' }, -- associate with .npk files
root_dir = lspconfig.util.root_pattern('*.npk', '.git'),
single_file_support = true,
settings = {},
},
docs = {
description = 'Nitpick Language Server with NIKOS abstract interpretation',
},
}
end
-- Launch the server
lspconfig.npk_ls.setup({
on_attach = function(client, bufnr)
-- Optional: show diagnostic float on cursor hold
vim.api.nvim_create_autocmd('CursorHold', {
buffer = bufnr,
callback = function()
vim.diagnostic.open_float(nil, { focus = false })
end,
})
end,
-- Pass NIKOS env vars to the server process
cmd_env = {
NPKC_PATH = vim.fn.expand('~/Workspace/REPOS/nitpick/build/npkc'),
NIKOS_ANALYZER_PATH = vim.fn.expand('~/Workspace/REPOS/nikos/build/analyzer/ikos-analyzer'),
},
})
-- Register .npk filetype
vim.filetype.add({ extension = { npk = 'nitpick' } })NIKOS diagnostics have source = "nikos-abstract". To show only NIKOS findings:
-- Show only nikos-abstract diagnostics in a split window
vim.keymap.set('n', '<leader>ni', function()
vim.diagnostic.setqflist({ source = 'nikos-abstract' })
vim.cmd('copen')
end, { desc = 'NIKOS diagnostics' })- Open a
.npkfile in Neovim - Save the file (
:w) - Wait 1–5 seconds for NIKOS analysis
- Check
:LspLogfor[nikos-lsp]lines - Errors/warnings should appear as inline diagnostics
Any LSP-compliant editor can use npk-ls. Point the editor at the npk-ls
binary using stdio transport and associate it with *.npk files.
See docs/nikos-lsp-protocol.md for the exact wire format and trigger semantics.