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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3Windows x86

chiz-0.6.1-py3-none-musllinux_1_2_x86_64.whl (1.6 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

chiz-0.6.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

chiz-0.6.1-py3-none-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

chiz-0.6.1-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.1-py3-none-win_amd64.whl.

File metadata

  • Download URL: chiz-0.6.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 1.3 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.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 dbc7ce68ed5586117aa81885e1ffa75e94365aad100e998959fef003fa3ba424
MD5 a4e2c639e8bbcc76bc624b5bb17aa7a2
BLAKE2b-256 cb2fd0fd53c843839637b17381e35a72bdea3499d5549bbbdce2f14d7a25efd9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chiz-0.6.1-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.1-py3-none-win32.whl
Algorithm Hash digest
SHA256 d9b7e7203eaa3593a6ac9be2b359489b051ed62b35ea78a358893e6ccac393d4
MD5 8ccacb625ac1dd80388b5fe5f22c7497
BLAKE2b-256 88494e9593617cb6e851abd50f3908c16d080ab76c3374217fae20cb2b370561

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chiz-0.6.1-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 68311286ffbfaab98d3d6e2f7551920c6511b4d50b200e33c56fc64af306a10b
MD5 ced0b64ceac53ab3a2ac94cb31fb5e78
BLAKE2b-256 750ef201495c0cb23c282817097499703acfcae3ab58df03eb042690159f633d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chiz-0.6.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ec1b52303249276ee1d6a97d504a5fb31e67ebfe243c6f52acde20675482975d
MD5 a082962bbe4f80d653cbc293d3f38ec0
BLAKE2b-256 4fae60396bb1eeb0317ba25bcc133fa768849a32111609e973864f75a7793be8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chiz-0.6.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 94b0e22eaa6f7a686f3f72289b9fd551ec01ae89521b0f63192b643cf327267c
MD5 9d7bb3be5a062a6b3dccece45fa0828c
BLAKE2b-256 ed4990e39fa02c6e7dde67493b74258bec8292b490926046a69cda203e0d06db

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chiz-0.6.1-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ee78324bc6ac6d7455abdc19e8bcbad0e4470744460661e4edcfb8843590c993
MD5 c7f3acad0c2ac9cd44e327d852762a35
BLAKE2b-256 174f9192d74c426278cafc7ac4f6a2310228983cc1b8a036e1604d94975b3002

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