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.3-py3-none-win_amd64.whl (1.4 MB view details)

Uploaded Python 3Windows x86-64

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

Uploaded Python 3Windows x86

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

Uploaded Python 3musllinux: musl 1.2+ x86-64

chiz-0.6.3-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.3-py3-none-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

chiz-0.6.3-py3-none-macosx_10_12_x86_64.whl (1.5 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: chiz-0.6.3-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.12.2

File hashes

Hashes for chiz-0.6.3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 a05f2e2291deeb469663420a51b2efba5b214bce1fc1b253c95689bb7858f289
MD5 9f849322f27749cff961bbb3a2254f4b
BLAKE2b-256 755e76f995e360599b056a74b7f0068eba85ff9aeaa9434fe586b599ab3828b9

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for chiz-0.6.3-py3-none-win32.whl
Algorithm Hash digest
SHA256 a1ed287935d7f7cdea72852d58797eb5208d4d3ddd06472f4db207930ca54a5e
MD5 ecb10370d8939e82ffbca88d923a2a15
BLAKE2b-256 685a21575a8cd9a5de1fc477306a03c5485ced4ea78cb4889d6ac2640fa94fb1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chiz-0.6.3-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 08f38840f4e4aee8bd358aa591b29f946a60c408acd0e9483b56a5a1a35b6829
MD5 44dd5892e16a96c8833582782f67a485
BLAKE2b-256 5995367174db1d4f6510212699d8e413fcfff49f62dae97d7c06cb8ad179d5dc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chiz-0.6.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 56a73e5a00ff9f4dc5d3d229065f8b5e2818078689a7b03b7d20dd87100544d3
MD5 ed63a7cb69cb580b5194fa082c3bf0b8
BLAKE2b-256 00f001b26da5159364d239de38e1074dd5381afb285efd4bcdd6b5e91cfcbf00

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chiz-0.6.3-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c335a59dae721c28bf32af00d10041a247ae756186e6b44d81e4096b9d88a2a5
MD5 8ab206460eb8ac95d1bcbaf96e305304
BLAKE2b-256 359c5d8b59f3f9f837a848fc512621827f98262003e442251562e4cced2fb542

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chiz-0.6.3-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a4b5dedc887e0cbe8e762a6fe64eb9b688e151ffddeab7293545916e33b7859e
MD5 392d2e42bbf9ff7c83a31fe10e6f3f17
BLAKE2b-256 a03dc1ad92f9845bafd011d1e4d2906c847987610cb5c86fea9d9069c49e4a4e

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