Skip to main content

Chili Pepper Language Linter, Formatter, and Language Server, written in Rust.

Project description

Chiz

Chili & Pepper Language Analyzer, provides Linter, Formatter, and Language Server for chili, a spicy language and runtime for data analysis and engineering

Language Server

  • hover
  • rename symbol
  • go to definition
  • go to reference
  • workspace symbol
  • document highlight
  • document symbol
  • completion
  • signature help
  • semantic highlights
  • call hierarchy

Installation

pip install chiz

Neovim Configuration

Create a ~/.config/nvim/lua/chiz.lua file and add the following code, then include require("chiz") in the init.lua file.

local cmp = require 'cmp'
cmp.setup({
  sources = cmp.config.sources({
    { name = 'nvim_lsp' },
    { name = 'vsnip' },
    { name = 'buffer' },
  }),
  window = {
    completion = cmp.config.window.bordered(),
  },
  mapping = cmp.mapping.preset.insert({
    ['<C-b>'] = cmp.mapping.scroll_docs(-4),
    ['<C-f>'] = cmp.mapping.scroll_docs(4),
    ['<C-Space>'] = cmp.mapping.complete(),
    ['<C-e>'] = cmp.mapping.abort(),
    ['<CR>'] = cmp.mapping.confirm({ select = true }),
  }),
  completion = {
    keyword_length = 2,
  }
})

vim.api.nvim_create_autocmd('FileType', {
  pattern = { "chi", "pep" },
  callback = function()
    vim.lsp.start({
      name = 'chili language server',
      cmd = { 'chiz', 'server' },
      filetypes = { 'chi', 'pep' },
      root_dir = vim.fs.dirname(vim.fs.find({ 'src' }, { upward = true })[1]),
    })
    local group = vim.api.nvim_create_augroup("LSPDocumentHighlight", {})
    vim.opt.updatetime = 1000
    vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
			buffer = bufnr,
			group = group,
			callback = function()
				vim.lsp.buf.document_highlight()
			end,
		})
    vim.api.nvim_create_autocmd({ "CursorMoved" }, {
			buffer = bufnr,
			group = group,
			callback = function()
				vim.lsp.buf.clear_references()
			end,
		})
  end,
})

vim.api.nvim_create_autocmd('LspAttach', {
  group = vim.api.nvim_create_augroup('UserLspConfig', {}),
  callback = function(ev)
    vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'
    local opts = { buffer = ev.buf }
    vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
    vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
    vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
    vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts)
    vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts)
    vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts)
    vim.keymap.set('n', '<space>wl', function()
      print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
    end, opts)
    vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts)
    vim.keymap.set('n', '<space>f', function()
      vim.lsp.buf.format { async = true }
    end, opts)
  end,
})

-- Create an augroup to manage the autocmd
local lsp_augroup = vim.api.nvim_create_augroup("LspFormatting", { clear = true })

-- Apply formatting before saving the buffer
vim.api.nvim_create_autocmd("BufWritePre", {
  group = lsp_augroup,
  callback = function()
    vim.lsp.buf.format({ async = false })
  end,
})

Helix Configuration

Pending...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

chiz-0.6.2-py3-none-win_amd64.whl (1.4 MB view details)

Uploaded Python 3Windows x86-64

chiz-0.6.2-py3-none-win32.whl (1.3 MB view details)

Uploaded Python 3Windows x86

chiz-0.6.2-py3-none-musllinux_1_2_x86_64.whl (1.7 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

chiz-0.6.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

chiz-0.6.2-py3-none-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

chiz-0.6.2-py3-none-macosx_10_12_x86_64.whl (1.4 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file chiz-0.6.2-py3-none-win_amd64.whl.

File metadata

  • Download URL: chiz-0.6.2-py3-none-win_amd64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.11.5

File hashes

Hashes for chiz-0.6.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 0d97c23d38d6f735ffaa7c058e27b9c0d48e753d75d0f6cd17e7cba7fbb01012
MD5 e58a78c18d81fac71f756c3ce9f0e21b
BLAKE2b-256 513134344712ea149effb56c8d9bb0506f83da5bb6e233f5934e60daa414c383

See more details on using hashes here.

File details

Details for the file chiz-0.6.2-py3-none-win32.whl.

File metadata

  • Download URL: chiz-0.6.2-py3-none-win32.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: Python 3, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.11.5

File hashes

Hashes for chiz-0.6.2-py3-none-win32.whl
Algorithm Hash digest
SHA256 79d23ec754fc5ae1355da57538e1c7a5f1159b3156612349e2b0c206d8c58250
MD5 0c420db0f4fa11f5c866e928703049aa
BLAKE2b-256 bfde9a1274158cc4fc2b8f5823657ad7d26c9205eb9af0bca6262c9906f72b20

See more details on using hashes here.

File details

Details for the file chiz-0.6.2-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for chiz-0.6.2-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 0939901d30c9cf06f917f47bb2edd627bba44c0cdeb2089d01e95c1d81b5dcfe
MD5 fe3df0747c25c57905b7a0c518d73dc2
BLAKE2b-256 877ab375324367a8cdfe0a02a29ba0412cca9a7bf7f72288108a5f2db05fabe5

See more details on using hashes here.

File details

Details for the file chiz-0.6.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for chiz-0.6.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 12e107f903b2ecc6f3b64b8c1a87438e2fa6b355c8385ede926af2cef158064a
MD5 ed67eddc3840f6c2c06741058b384791
BLAKE2b-256 09679f2e111df5e54161499ed0777ce6a63728406d04bc7c8aa4ef0241369bb5

See more details on using hashes here.

File details

Details for the file chiz-0.6.2-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for chiz-0.6.2-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d81d85a5ca107c585bd6c37248bfb1ade5f87f68e8e6756e7d93e61bcf198acf
MD5 ce36fbec0ded68848540fa8e0348a1b2
BLAKE2b-256 5f4e76541cfac57ed0765dc5f6fd88a0716acd44580d8fb020763137b0f406e1

See more details on using hashes here.

File details

Details for the file chiz-0.6.2-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for chiz-0.6.2-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 16edf6a1c2ddf500a647dd1a94c3c1bc487ac771c47c8eea032c1822b49daaa6
MD5 3a73250bb94dec356e02335773354ffe
BLAKE2b-256 e6565ea716a7e3382844b7b5533595ac6bba5ffa7b36014d29ef85388eb35e24

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page