diff options
| author | Wayne-Cole <77279425+Wacky404@users.noreply.github.com> | 2026-02-21 04:21:14 -0600 |
|---|---|---|
| committer | Wayne-Cole <77279425+Wacky404@users.noreply.github.com> | 2026-02-21 04:21:28 -0600 |
| commit | bf4e114dfd828ee703c1ee9560d0fc682de84502 (patch) | |
| tree | cd823fe8f1a05a5d863029c532cf99b4bd612a36 | |
| parent | ae6888b5fbf209a1d6fba274a470a67bc69b479f (diff) | |
| download | wackys-dev-env-bf4e114dfd828ee703c1ee9560d0fc682de84502.tar.xz wackys-dev-env-bf4e114dfd828ee703c1ee9560d0fc682de84502.zip | |
feat: update and added in Jac programming language lsp, linter, and formatter
| -rw-r--r-- | .config/aerospace/aerospace.toml | 2 | ||||
| -rw-r--r-- | .config/nvim/after/ftplugin/typescript.lua | 5 | ||||
| -rw-r--r-- | .config/nvim/lua/wacky/plugins-setup.lua | 15 | ||||
| -rw-r--r-- | .config/nvim/lua/wacky/plugins/formatter.lua | 20 | ||||
| -rw-r--r-- | .config/nvim/lua/wacky/plugins/linter-setup.lua | 30 | ||||
| -rw-r--r-- | .config/nvim/lua/wacky/plugins/lsp/lspconfig.lua | 29 |
6 files changed, 94 insertions, 7 deletions
diff --git a/.config/aerospace/aerospace.toml b/.config/aerospace/aerospace.toml index 567b6ce..37018e3 100644 --- a/.config/aerospace/aerospace.toml +++ b/.config/aerospace/aerospace.toml @@ -33,7 +33,7 @@ default-root-container-layout = 'tiles' # Possible values: horizontal|vertical|auto # 'auto' means: wide monitor (anything wider than high) gets horizontal orientation, # tall monitor (anything higher than wide) gets vertical orientation -default-root-container-orientation = 'auto' +default-root-container-orientation = 'vertical' # Mouse follows focus when focused monitor changes # Drop it from your config, if you don't like this behavior diff --git a/.config/nvim/after/ftplugin/typescript.lua b/.config/nvim/after/ftplugin/typescript.lua new file mode 100644 index 0000000..7e76438 --- /dev/null +++ b/.config/nvim/after/ftplugin/typescript.lua @@ -0,0 +1,5 @@ +local opt = vim.opt_local -- for conciseness + +-- tabs and indention +opt.tabstop = 2 +opt.shiftwidth = 2 diff --git a/.config/nvim/lua/wacky/plugins-setup.lua b/.config/nvim/lua/wacky/plugins-setup.lua index dc8b0da..acc6b03 100644 --- a/.config/nvim/lua/wacky/plugins-setup.lua +++ b/.config/nvim/lua/wacky/plugins-setup.lua @@ -111,6 +111,8 @@ return packer.startup(function(use) }) end, }) + -- spec for jaclang lsp + use({ "Jaseci-Labs/jac-vim" }) -- vs-code like icons for autocompletion use("onsails/lspkind.nvim") @@ -182,6 +184,19 @@ return packer.startup(function(use) "nvim-neotest/nvim-nio", }, }) + + -- presenting in nvim + use({ + "sotte/presenting.nvim", + cmd = { "Presenting" }, + config = function() + require("presenting").setup({ + -- fill in your options here + -- see :help Presenting.config + }) + end, + }) + if packer_bootstrap then require("packer").sync() end diff --git a/.config/nvim/lua/wacky/plugins/formatter.lua b/.config/nvim/lua/wacky/plugins/formatter.lua index bc1a427..23cf726 100644 --- a/.config/nvim/lua/wacky/plugins/formatter.lua +++ b/.config/nvim/lua/wacky/plugins/formatter.lua @@ -64,6 +64,22 @@ require("formatter").setup({ vim.lsp.buf.format({ asynce = false }) end, }, + ["jac"] = { + function() + if util.get_current_buffer_file_name() == "special.jac" then + return nil + end + + return { + exe = "sh", + args = { + "-c", + "TMPJAC=/tmp/jacfmt.$RANDOM.jac && cat > $TMPJAC && jac format -s --no-lintfix $TMPJAC && rm -f $TMPJAC", + }, + stdin = true, + } + end, + }, -- Use the special "*" filetype for defining formatter configurations on -- any filetype ["*"] = { @@ -81,3 +97,7 @@ autocmd("BufWritePost", { group = "__formatter__", command = ":FormatWrite", }) +autocmd("FileChangedShellPost", { + group = "__formatter__", + command = "edit!", +}) diff --git a/.config/nvim/lua/wacky/plugins/linter-setup.lua b/.config/nvim/lua/wacky/plugins/linter-setup.lua index f00ab2c..1ddbbb5 100644 --- a/.config/nvim/lua/wacky/plugins/linter-setup.lua +++ b/.config/nvim/lua/wacky/plugins/linter-setup.lua @@ -5,6 +5,36 @@ require("lint").linters_by_ft = { typescript = { "eslint_d" }, javascriptreact = { "eslint_d" }, typescriptreact = { "eslint_d" }, + jac = { "jaclint" }, +} + +require("lint").linters.jaclint = { + cmd = "sh", + args = { "-c", 'jac lint --no-fix "$1" || true', "--" }, + stdin = false, + parser = function(output, bufnr) + if not output or output == "" then + return {} + end + local diagnostics = {} + local cleaned = output:gsub("✖ Error: ", ""):gsub("\ncol ", " col ") + for line in vim.gsplit(cleaned, "\n", { plain = true }) do + local file, line_num, col, message = line:match("(.+), line (%d+), col (%d+): (.+)") + if file and line_num and col and message then + table.insert(diagnostics, { + bufnr = bufnr, + lnum = tonumber(line_num) - 1, + col = tonumber(col) - 1, + end_lnum = tonumber(line_num) - 1, + end_col = tonumber(col), + severity = vim.diagnostic.severity.ERROR, + message = message, + source = "jaclint", + }) + end + end + return diagnostics + end, } vim.api.nvim_create_autocmd({ "BufWritePost" }, { diff --git a/.config/nvim/lua/wacky/plugins/lsp/lspconfig.lua b/.config/nvim/lua/wacky/plugins/lsp/lspconfig.lua index 376214f..ec1b523 100644 --- a/.config/nvim/lua/wacky/plugins/lsp/lspconfig.lua +++ b/.config/nvim/lua/wacky/plugins/lsp/lspconfig.lua @@ -5,6 +5,11 @@ if not cmp_nvim_lsp_status then end -- for sameness +local lspconfig = require("lspconfig") +local root_pattern = lspconfig.util.root_pattern() +-- hopefully this works; this works don't touch unless you want +-- break everything. You need to change the lspconfig var name +-- too lazy local lspconfig = vim.lsp local keymap = vim.keymap @@ -55,6 +60,15 @@ lspconfig.config("gopls", { capabilities = capabilities, }) +lspconfig.config("jac_ls", { + cmd = { "jac", "lsp" }, + filetypes = { "jac" }, + root_dir = root_pattern(".git", "jac-env"), + single_file_support = true, + on_attach = on_attach, + capabilities = capabilities, +}) + lspconfig.config("lua_ls", { cmd = { "lua-language-server", "--force-accept-workspace" }, filetypes = { "lua" }, @@ -67,12 +81,13 @@ lspconfig.config("lua_ls", { diagnostics = { globals = { "vim" }, }, - --workspace = { - -- library = { - -- -- [vim.fn.expand("$VIMRUNTIME/lua")] = true, - -- -- [vim.fn.stdpath("config") .. "/lua"] = true, - -- }, - --}, + workspace = { + library = { + vim.fn.expand("~/.local/share/lua-ls-addons/openresty"), + -- [vim.fn.expand("$VIMRUNTIME/lua")] = true, + -- [vim.fn.stdpath("config") .. "/lua"] = true, + }, + }, }, }, on_attach = on_attach, @@ -89,6 +104,7 @@ local servers = { "tailwindcss", "metals", "htmx", + "jac_ls", } for _, server in pairs(servers) do @@ -111,6 +127,7 @@ local all_servers = { "html", "gopls", "lua_ls", + "jac_ls", } for _, server in pairs(all_servers) do |
