├── .github └── FUNDING.yml ├── lua └── bexx │ ├── impatient.lua │ ├── lsp │ ├── init.lua │ ├── settings │ │ ├── sumneko_lua.lua │ │ ├── pyright.lua │ │ ├── clangd.lua │ │ ├── rust_analyzer.lua │ │ ├── ftplugin │ │ │ └── java.lua │ │ └── jsonls.lua │ ├── null-ls.lua │ ├── configs.lua │ └── handlers.lua │ ├── colorscheme.lua │ ├── package-lock.json │ ├── comment.lua │ ├── airline.lua │ ├── treesitter.lua │ ├── autopairs.lua │ ├── autocommands.lua │ ├── toggleterm.lua │ ├── alpha.lua │ ├── node_modules │ ├── prettier │ │ ├── package.json │ │ ├── bin-prettier.js │ │ ├── README.md │ │ ├── esm │ │ │ └── parser-graphql.mjs │ │ └── parser-graphql.js │ └── .bin │ │ └── prettier │ ├── gitsigns.lua │ ├── keymaps.lua │ ├── project.lua │ ├── indentline.lua │ ├── lualine.lua │ ├── options.lua │ ├── nvim-tree.lua │ ├── telescope.lua │ ├── cmp.lua │ ├── plugins.lua │ ├── bufferline.lua │ └── whichkey.lua ├── .gitignore ├── init.lua ├── howto.md ├── README.md └── LICENSE /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: christianchiarulli 4 | patreon: chrisatmachine 5 | -------------------------------------------------------------------------------- /lua/bexx/impatient.lua: -------------------------------------------------------------------------------- 1 | local status_ok, impatient = pcall(require, "impatient") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | impatient.enable_profile() 7 | -------------------------------------------------------------------------------- /lua/bexx/lsp/init.lua: -------------------------------------------------------------------------------- 1 | local status_ok, _ = pcall(require, "lspconfig") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | require("bexx.lsp.configs") 7 | require("bexx.lsp.handlers").setup() 8 | require("bexx.lsp.null-ls") 9 | -------------------------------------------------------------------------------- /lua/bexx/colorscheme.lua: -------------------------------------------------------------------------------- 1 | local colorscheme = "gruvbox" 2 | 3 | local status_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme) 4 | 5 | if not status_ok then 6 | vim.notify("colorscheme " .. colorscheme .. " not found!") 7 | return 8 | end 9 | -------------------------------------------------------------------------------- /lua/bexx/lsp/settings/sumneko_lua.lua: -------------------------------------------------------------------------------- 1 | return { 2 | settings = { 3 | 4 | Lua = { 5 | diagnostics = { 6 | globals = { "vim" }, 7 | }, 8 | workspace = { 9 | library = { 10 | [vim.fn.expand("$VIMRUNTIME/lua")] = true, 11 | [vim.fn.stdpath("config") .. "/lua"] = true, 12 | }, 13 | }, 14 | }, 15 | }, 16 | } 17 | -------------------------------------------------------------------------------- /lua/bexx/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "requires": true, 3 | "lockfileVersion": 1, 4 | "dependencies": { 5 | "prettier": { 6 | "version": "2.7.1", 7 | "resolved": "https://nexus.corp.indeed.com/repository/npm/prettier/-/prettier-2.7.1.tgz", 8 | "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", 9 | "dev": true 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Lua sources 2 | luac.out 3 | 4 | # luarocks build files 5 | *.src.rock 6 | *.zip 7 | *.tar.gz 8 | 9 | # Object files 10 | *.o 11 | *.os 12 | *.ko 13 | *.obj 14 | *.elf 15 | 16 | # Precompiled Headers 17 | *.gch 18 | *.pch 19 | 20 | # Libraries 21 | *.lib 22 | *.a 23 | *.la 24 | *.lo 25 | *.def 26 | *.exp 27 | 28 | # Shared objects (inc. Windows DLLs) 29 | *.dll 30 | *.so 31 | *.so.* 32 | *.dylib 33 | 34 | # Executables 35 | *.exe 36 | *.out 37 | *.app 38 | *.i*86 39 | *.x86_64 40 | *.hex 41 | 42 | 43 | plugin/packer_compiled.lua -------------------------------------------------------------------------------- /init.lua: -------------------------------------------------------------------------------- 1 | 2 | require "bexx.options" 3 | require "bexx.keymaps" 4 | require "bexx.plugins" 5 | require "bexx.colorscheme" 6 | require "bexx.cmp" 7 | require "bexx.lsp" 8 | require "bexx.telescope" 9 | require "bexx.treesitter" 10 | require "bexx.autopairs" 11 | require "bexx.comment" 12 | require "bexx.gitsigns" 13 | require "bexx.bufferline" 14 | require "bexx.toggleterm" 15 | require "bexx.project" 16 | -- require "bexx.impatient" 17 | require "bexx.indentline" 18 | -- require "bexx.alpha" 19 | require "bexx.whichkey" 20 | require "bexx.autocommands" 21 | require "bexx.airline" 22 | -------------------------------------------------------------------------------- /lua/bexx/lsp/null-ls.lua: -------------------------------------------------------------------------------- 1 | local null_ls_status_ok, null_ls = pcall(require, "null-ls") 2 | if not null_ls_status_ok then 3 | return 4 | end 5 | 6 | -- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting 7 | local formatting = null_ls.builtins.formatting 8 | -- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics 9 | local diagnostics = null_ls.builtins.diagnostics 10 | 11 | null_ls.setup({ 12 | debug = false, 13 | sources = { 14 | formatting.prettier.with({ 15 | extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote" } 16 | }), 17 | formatting.black.with({ extra_args = { "--fast" } }), 18 | formatting.stylua, 19 | diagnostics.shellcheck, 20 | }, 21 | }) 22 | -------------------------------------------------------------------------------- /lua/bexx/comment.lua: -------------------------------------------------------------------------------- 1 | local status_ok, comment = pcall(require, "Comment") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | comment.setup { 7 | pre_hook = function(ctx) 8 | local U = require "Comment.utils" 9 | 10 | local location = nil 11 | if ctx.ctype == U.ctype.block then 12 | location = require("ts_context_commentstring.utils").get_cursor_location() 13 | elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then 14 | location = require("ts_context_commentstring.utils").get_visual_start_location() 15 | end 16 | 17 | return require("ts_context_commentstring.internal").calculate_commentstring { 18 | key = ctx.ctype == U.ctype.line and "__default" or "__multiline", 19 | location = location, 20 | } 21 | end, 22 | } 23 | -------------------------------------------------------------------------------- /lua/bexx/lsp/configs.lua: -------------------------------------------------------------------------------- 1 | local status_ok, lsp_installer = pcall(require, "nvim-lsp-installer") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | local lspconfig = require("lspconfig") 7 | 8 | local servers = { "pyright", "jdtls", "rust_analyzer", "jsonls", "sumneko_lua", "clangd" } 9 | 10 | lsp_installer.setup { 11 | ensure_installed = servers 12 | } 13 | 14 | for _, server in pairs(servers) do 15 | local opts = { 16 | on_attach = require("bexx.lsp.handlers").on_attach, 17 | capabilities = require("bexx.lsp.handlers").capabilities, 18 | } 19 | local has_custom_opts, server_custom_opts = pcall(require, "bexx.lsp.settings." .. server) 20 | if has_custom_opts then 21 | opts = vim.tbl_deep_extend("force", server_custom_opts, opts) 22 | end 23 | lspconfig[server].setup(opts) 24 | end 25 | -------------------------------------------------------------------------------- /lua/bexx/airline.lua: -------------------------------------------------------------------------------- 1 | vim.cmd([[ 2 | " Set airline theme 3 | let g:airline_theme='tomorrow' 4 | let g:airline#extensions#branch#enabled = 1 5 | let g:airline#extensions#hunks#enabled=0 6 | 7 | " Note: You must define the dictionary first before setting values. 8 | " Also, it's a good idea to check whether it exists as to avoid 9 | " accidentally overwriting its contents. 10 | 11 | if !exists('g:airline_symbols') 12 | let g:airline_symbols = {} 13 | endif 14 | 15 | " powerline symbols 16 | let g:airline_left_sep = '' 17 | let g:airline_left_alt_sep = '' 18 | let g:airline_right_sep = '' 19 | let g:airline_right_alt_sep = '' 20 | let g:airline_symbols.branch = '' 21 | let g:airline_symbols.readonly = '' 22 | let g:airline_symbols.linenr = '☰' 23 | let g:airline_symbols.maxlinenr = '' 24 | let g:airline_symbols.dirty='⚡' 25 | ]]) 26 | -------------------------------------------------------------------------------- /lua/bexx/treesitter.lua: -------------------------------------------------------------------------------- 1 | local status_ok, configs = pcall(require, "nvim-treesitter.configs") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | configs.setup { 7 | ensure_installed = "all", -- one of "all", "maintained" (parsers with maintainers), or a list of languages 8 | sync_install = false, -- install languages synchronously (only applied to `ensure_installed`) 9 | ignore_install = { "phpdoc" }, -- List of parsers to ignore installing 10 | autopairs = { 11 | enable = true, 12 | }, 13 | highlight = { 14 | enable = true, -- false will disable the whole extension 15 | disable = { "" }, -- list of language that will be disabled 16 | additional_vim_regex_highlighting = true, 17 | }, 18 | indent = { enable = true, disable = { "yaml" } }, 19 | context_commentstring = { 20 | enable = true, 21 | enable_autocmd = false, 22 | }, 23 | rainbow = { 24 | enable = true, 25 | extended_mode = true, 26 | max_file_lines = nil, 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lua/bexx/autopairs.lua: -------------------------------------------------------------------------------- 1 | -- Setup nvim-cmp. 2 | local status_ok, npairs = pcall(require, "nvim-autopairs") 3 | if not status_ok then 4 | return 5 | end 6 | 7 | npairs.setup { 8 | check_ts = true, 9 | ts_config = { 10 | lua = { "string", "source" }, 11 | javascript = { "string", "template_string" }, 12 | java = false, 13 | }, 14 | disable_filetype = { "TelescopePrompt", "spectre_panel" }, 15 | fast_wrap = { 16 | map = "", 17 | chars = { "{", "[", "(", '"', "'" }, 18 | pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""), 19 | offset = 0, -- Offset from pattern match 20 | end_key = "$", 21 | keys = "qwertyuiopzxcvbnmasdfghjkl", 22 | check_comma = true, 23 | highlight = "PmenuSel", 24 | highlight_grey = "LineNr", 25 | }, 26 | } 27 | 28 | -- Integration with cmp 29 | local cmp_autopairs = require "nvim-autopairs.completion.cmp" 30 | local cmp_status_ok, cmp = pcall(require, "cmp") 31 | if not cmp_status_ok then 32 | return 33 | end 34 | cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done { map_char = { tex = "" } }) 35 | -------------------------------------------------------------------------------- /howto.md: -------------------------------------------------------------------------------- 1 | ## LSP 2 | 3 | Check which language supports are installed and install from the list by typing `:LspInstallInfo` in nvim. 4 | Then click `i` to install language support. 5 | 6 | Check the status of installed languages with `:LspInfo` 7 | 8 | - `gl` : show line diagnostics 9 | - `K` : get documentation 10 | - `gr` : get references of give function/method 11 | - `gd` : go to definition 12 | 13 | - `Alt+e` : used with auto pairing parenthesis. It allows to chose where to place bracket closing 14 | - `gc` : select lines and use this command to comment/uncomment them 15 | 16 | - `H` : move between opened buffers 17 | - `gt` : switch between tabs (you can open new tab with `:tabnew`) 18 | - `bd` : close tab 19 | 20 | - `t` : open NERDTree (I have set as leader) 21 | - `Ctrl+\` : open terminal inside neovim 22 | 23 | ### Search/find 24 | 25 | - `Ctrl + t, g` : telescope live grep 26 | - ` f` : telescope find files 27 | 28 | ### Project 29 | 30 | - `:ProjectRoot` : to manually change root directory 31 | 32 | ---------- 33 | 34 | Things to install: 35 | 36 | ``` 37 | lazygit 38 | ripgrep 39 | ``` 40 | -------------------------------------------------------------------------------- /lua/bexx/autocommands.lua: -------------------------------------------------------------------------------- 1 | vim.cmd [[ 2 | augroup _general_settings 3 | autocmd! 4 | autocmd FileType qf,help,man,lspinfo nnoremap q :close 5 | autocmd TextYankPost * silent!lua require('vim.highlight').on_yank({higroup = 'Visual', timeout = 200}) 6 | autocmd BufWinEnter * :set formatoptions-=cro 7 | autocmd FileType qf set nobuflisted 8 | augroup end 9 | 10 | augroup _git 11 | autocmd! 12 | autocmd FileType gitcommit setlocal wrap 13 | autocmd FileType gitcommit setlocal spell 14 | augroup end 15 | 16 | augroup _markdown 17 | autocmd! 18 | autocmd FileType markdown setlocal wrap 19 | autocmd FileType markdown setlocal spell 20 | augroup end 21 | 22 | augroup _auto_resize 23 | autocmd! 24 | autocmd VimResized * tabdo wincmd = 25 | augroup end 26 | 27 | augroup _alpha 28 | autocmd! 29 | autocmd User AlphaReady set showtabline=0 | autocmd BufUnload set showtabline=2 30 | augroup end 31 | 32 | augroup numbertobble 33 | autocmd! BufEnter,FocusGained,InsertLeave * set relativenumber 34 | autocmd! BufLeave,FocusLost,InsertEnter * set norelativenumber 35 | augroup END 36 | ]] 37 | 38 | -- Autoformat 39 | -- augroup _lsp 40 | -- autocmd! 41 | -- autocmd BufWritePre * lua vim.lsp.buf.formatting() 42 | -- augroup end 43 | -------------------------------------------------------------------------------- /lua/bexx/lsp/settings/pyright.lua: -------------------------------------------------------------------------------- 1 | local util = require 'lspconfig.util' 2 | 3 | local bin_name = 'pyright-langserver' 4 | local cmd = { bin_name, '--stdio' } 5 | 6 | if vim.fn.has 'win32' == 1 then 7 | cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } 8 | end 9 | 10 | local root_files = { 11 | 'pyproject.toml', 12 | 'setup.py', 13 | 'setup.cfg', 14 | 'requirements.txt', 15 | 'Pipfile', 16 | 'pyrightconfig.json', 17 | } 18 | 19 | local function organize_imports() 20 | local params = { 21 | command = 'pyright.organizeimports', 22 | arguments = { vim.uri_from_bufnr(0) }, 23 | } 24 | vim.lsp.buf.execute_command(params) 25 | end 26 | 27 | return { 28 | settings = { 29 | 30 | python = { 31 | analysis = { 32 | autoSearchPaths = true, 33 | autoImportCompletions = true, 34 | diagnosticMode = "workspace", 35 | useLibraryCodeForTypes = true, 36 | } 37 | } 38 | }, 39 | default_config = { 40 | cmd = cmd, 41 | filetypes = { 'python' }, 42 | root_dir = util.root_pattern(unpack(root_files)), 43 | single_file_support = true, 44 | settings = { 45 | python = { 46 | analysis = { 47 | autoSearchPaths = true, 48 | useLibraryCodeForTypes = true, 49 | diagnosticMode = 'workspace', 50 | }, 51 | }, 52 | }, 53 | }, 54 | commands = { 55 | PyrightOrganizeImports = { 56 | organize_imports, 57 | description = 'Organize Imports', 58 | }, 59 | }, 60 | docs = { 61 | description = [[ 62 | https://github.com/microsoft/pyright 63 | `pyright`, a static type checker and language server for python 64 | ]], 65 | }, 66 | } 67 | -------------------------------------------------------------------------------- /lua/bexx/toggleterm.lua: -------------------------------------------------------------------------------- 1 | local status_ok, toggleterm = pcall(require, "toggleterm") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | toggleterm.setup({ 7 | size = 30, 8 | open_mapping = [[]], 9 | hide_numbers = true, 10 | shade_filetypes = {}, 11 | shading_factor = 2, 12 | start_in_insert = true, 13 | insert_mappings = true, 14 | persist_size = true, 15 | direction = "float", 16 | close_on_exit = true, 17 | shell = vim.o.shell, 18 | float_opts = { 19 | border = "curved", 20 | winblend = 0, 21 | highlights = { 22 | border = "Normal", 23 | background = "Normal", 24 | }, 25 | }, 26 | }) 27 | 28 | function _G.set_terminal_keymaps() 29 | local opts = {noremap = true} 30 | vim.api.nvim_buf_set_keymap(0, 't', '', [[]], opts) 31 | vim.api.nvim_buf_set_keymap(0, 't', 'jk', [[]], opts) 32 | vim.api.nvim_buf_set_keymap(0, 't', '', [[h]], opts) 33 | vim.api.nvim_buf_set_keymap(0, 't', '', [[j]], opts) 34 | vim.api.nvim_buf_set_keymap(0, 't', '', [[k]], opts) 35 | vim.api.nvim_buf_set_keymap(0, 't', '', [[l]], opts) 36 | end 37 | 38 | vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()') 39 | 40 | local Terminal = require("toggleterm.terminal").Terminal 41 | local lazygit = Terminal:new({ cmd = "lazygit", hidden = true }) 42 | 43 | function _LAZYGIT_TOGGLE() 44 | lazygit:toggle() 45 | end 46 | 47 | local htop = Terminal:new({ cmd = "htop", hidden = true }) 48 | 49 | function _HTOP_TOGGLE() 50 | htop:toggle() 51 | end 52 | 53 | local python = Terminal:new({ cmd = "python", hidden = true }) 54 | 55 | function _PYTHON_TOGGLE() 56 | python:toggle() 57 | end 58 | -------------------------------------------------------------------------------- /lua/bexx/alpha.lua: -------------------------------------------------------------------------------- 1 | local status_ok, alpha = pcall(require, "alpha") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | local dashboard = require("alpha.themes.dashboard") 7 | dashboard.section.header.val = { 8 | [[ __ ]], 9 | [[ ___ ___ ___ __ __ /\_\ ___ ___ ]], 10 | [[ / _ `\ / __`\ / __`\/\ \/\ \\/\ \ / __` __`\ ]], 11 | [[/\ \/\ \/\ __//\ \_\ \ \ \_/ |\ \ \/\ \/\ \/\ \ ]], 12 | [[\ \_\ \_\ \____\ \____/\ \___/ \ \_\ \_\ \_\ \_\]], 13 | [[ \/_/\/_/\/____/\/___/ \/__/ \/_/\/_/\/_/\/_/]], 14 | } 15 | dashboard.section.buttons.val = { 16 | dashboard.button("f", " Find file", ":Telescope find_files "), 17 | dashboard.button("e", " New file", ":ene startinsert "), 18 | dashboard.button("p", " Find project", ":Telescope projects "), 19 | dashboard.button("r", " Recently used files", ":Telescope oldfiles "), 20 | dashboard.button("t", " Find text", ":Telescope live_grep "), 21 | dashboard.button("c", " Configuration", ":e ~/.config/nvim/init.lua "), 22 | dashboard.button("q", " Quit Neovim", ":qa"), 23 | } 24 | 25 | local function footer() 26 | -- NOTE: requires the fortune-mod package to work 27 | -- local handle = io.popen("fortune") 28 | -- local fortune = handle:read("*a") 29 | -- handle:close() 30 | -- return fortune 31 | return "chrisatmachine.com" 32 | end 33 | 34 | dashboard.section.footer.val = footer() 35 | 36 | dashboard.section.footer.opts.hl = "Type" 37 | dashboard.section.header.opts.hl = "Include" 38 | dashboard.section.buttons.opts.hl = "Keyword" 39 | 40 | dashboard.opts.opts.noautocmd = true 41 | -- vim.cmd([[autocmd User AlphaReady echo 'ready']]) 42 | alpha.setup(dashboard.opts) 43 | -------------------------------------------------------------------------------- /lua/bexx/node_modules/prettier/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "prettier", 3 | "_id": "prettier@2.7.1", 4 | "_inBundle": false, 5 | "_integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", 6 | "_location": "/prettier", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "tag", 10 | "registry": true, 11 | "raw": "prettier", 12 | "name": "prettier", 13 | "escapedName": "prettier", 14 | "rawSpec": "", 15 | "saveSpec": null, 16 | "fetchSpec": "latest" 17 | }, 18 | "_requiredBy": [ 19 | "#DEV:/", 20 | "#USER" 21 | ], 22 | "_resolved": "https://nexus.corp.indeed.com/repository/npm/prettier/-/prettier-2.7.1.tgz", 23 | "_shasum": "e235806850d057f97bb08368a4f7d899f7760c64", 24 | "_spec": "prettier", 25 | "_where": "/home/bmodebadze/.config/nvim/lua/bexx", 26 | "author": { 27 | "name": "James Long" 28 | }, 29 | "bin": { 30 | "prettier": "bin-prettier.js" 31 | }, 32 | "browser": "./standalone.js", 33 | "bugs": { 34 | "url": "https://github.com/prettier/prettier/issues" 35 | }, 36 | "bundleDependencies": false, 37 | "deprecated": false, 38 | "description": "Prettier is an opinionated code formatter", 39 | "engines": { 40 | "node": ">=10.13.0" 41 | }, 42 | "files": [ 43 | "*.js", 44 | "esm/*.mjs" 45 | ], 46 | "funding": "https://github.com/prettier/prettier?sponsor=1", 47 | "homepage": "https://prettier.io", 48 | "license": "MIT", 49 | "main": "./index.js", 50 | "name": "prettier", 51 | "repository": { 52 | "type": "git", 53 | "url": "git+https://github.com/prettier/prettier.git" 54 | }, 55 | "unpkg": "./standalone.js", 56 | "version": "2.7.1" 57 | } 58 | -------------------------------------------------------------------------------- /lua/bexx/gitsigns.lua: -------------------------------------------------------------------------------- 1 | local status_ok, gitsigns = pcall(require, "gitsigns") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | gitsigns.setup { 7 | signs = { 8 | add = { hl = "GitSignsAdd", text = "▎", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" }, 9 | change = { hl = "GitSignsChange", text = "▎", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" }, 10 | delete = { hl = "GitSignsDelete", text = "契", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" }, 11 | topdelete = { hl = "GitSignsDelete", text = "契", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" }, 12 | changedelete = { hl = "GitSignsChange", text = "▎", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" }, 13 | }, 14 | signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` 15 | numhl = false, -- Toggle with `:Gitsigns toggle_numhl` 16 | linehl = false, -- Toggle with `:Gitsigns toggle_linehl` 17 | word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` 18 | watch_gitdir = { 19 | interval = 1000, 20 | follow_files = true, 21 | }, 22 | attach_to_untracked = true, 23 | current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` 24 | current_line_blame_opts = { 25 | virt_text = true, 26 | virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align' 27 | delay = 1000, 28 | ignore_whitespace = false, 29 | }, 30 | current_line_blame_formatter_opts = { 31 | relative_time = false, 32 | }, 33 | sign_priority = 6, 34 | update_debounce = 100, 35 | status_formatter = nil, -- Use default 36 | max_file_length = 40000, 37 | preview_config = { 38 | -- Options passed to nvim_open_win 39 | border = "single", 40 | style = "minimal", 41 | relative = "cursor", 42 | row = 0, 43 | col = 1, 44 | }, 45 | yadm = { 46 | enable = false, 47 | }, 48 | } 49 | -------------------------------------------------------------------------------- /lua/bexx/keymaps.lua: -------------------------------------------------------------------------------- 1 | local opts = { noremap = true, silent = false } 2 | 3 | -- Shorten function name 4 | local keymap = vim.api.nvim_set_keymap 5 | 6 | --Remap space as leader key 7 | keymap("", "", "", opts) 8 | vim.g.mapleader = " " 9 | vim.g.maplocalleader = " " 10 | 11 | keymap("n", "e", ":Lex 30", opts) 12 | keymap("n", "sv", ":vsplit", opts) 13 | keymap("n", "sh", ":split", opts) 14 | 15 | -- Modes 16 | -- normal_mode = "n", 17 | -- insert_mode = "i", 18 | -- visual_mode = "v", 19 | -- visual_block_mode = "x", 20 | -- term_mode = "t", 21 | -- command_mode = "c", 22 | 23 | -- NORMAL -- 24 | -- Better window navigation 25 | keymap("n", "", "h", opts) 26 | keymap("n", "", "j", opts) 27 | keymap("n", "", "k", opts) 28 | keymap("n", "", "l", opts) 29 | 30 | -- Resize with arrows 31 | keymap("n", "", ":resize -2", opts) 32 | keymap("n", "", ":resize +2", opts) 33 | keymap("n", "", ":vertical resize -2", opts) 34 | keymap("n", "", ":vertical resize +2", opts) 35 | 36 | -- Navigate buffers 37 | keymap("n", "", ":bnext", opts) 38 | keymap("n", "", ":bprevious", opts) 39 | 40 | -- Move text up and down 41 | keymap("n", "", ":m .+1==gi", opts) 42 | keymap("n", "", ":m .-2==gi", opts) 43 | 44 | -- Visual -- 45 | -- Stay in indent mode 46 | keymap("v", "<", "", ">gv", opts) 48 | 49 | -- Move text up and down 50 | keymap("v", "", ":m .+1==", opts) 51 | keymap("v", "", ":m .-2==", opts) 52 | keymap("v", "p", '"_dP', opts) -- when yanking this keeps original buffer when pasting 53 | 54 | -- Visual Block -- 55 | -- Move text up and down 56 | keymap("x", "", ":move '>+1gv-gv", opts) 57 | keymap("x", "", ":move '<-2gv-gv", opts) 58 | 59 | -- Telescope 60 | -- Search for file 61 | keymap("n", "f", "Telescope find_files", opts) 62 | keymap("n", "g", "Telescope live_grep", opts) -- Ctrl + t, g 63 | 64 | -- NERDTree 65 | keymap("n", "t", ":NERDTree", opts) 66 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Neovim from scratch 2 | 3 | Each video will be associated with a branch so checkout the one you are interested in, you can follow along with this [playlist](https://www.youtube.com/watch?v=ctH-a-1eUME&list=PLhoH5vyxr6Qq41NFL4GvhFp-WLd5xzIzZ). 4 | 5 | ## Try out this config 6 | 7 | Make sure to remove or move your current `nvim` directory 8 | 9 | **IMPORTANT** Requires [Neovim v0.8.0]](https://github.com/neovim/neovim/releases). [Upgrade](#upgrade-to-latest-release) if you're on an earlier version. 10 | ``` 11 | git clone https://github.com/LunarVim/Neovim-from-scratch.git ~/.config/nvim 12 | ``` 13 | 14 | Run `nvim` and wait for the plugins to be installed 15 | 16 | **NOTE** (You will notice treesitter pulling in a bunch of parsers the next time you open Neovim) 17 | 18 | ## Get healthy 19 | 20 | Open `nvim` and enter the following: 21 | 22 | ``` 23 | :checkhealth 24 | ``` 25 | 26 | You'll probably notice you don't have support for copy/paste also that python and node haven't been setup 27 | 28 | So let's fix that 29 | 30 | First we'll fix copy/paste 31 | 32 | - On mac `pbcopy` should be builtin 33 | 34 | - On Ubuntu 35 | 36 | ``` 37 | sudo apt install xsel 38 | ``` 39 | 40 | - On Arch Linux 41 | 42 | ``` 43 | sudo pacman -S xsel 44 | ``` 45 | 46 | Next we need to install python support (node is optional) 47 | 48 | - Neovim python support 49 | 50 | ``` 51 | pip install pynvim 52 | ``` 53 | 54 | - Neovim node support 55 | 56 | ``` 57 | npm i -g neovim 58 | ``` 59 | --- 60 | 61 | **NOTE** make sure you have [node](https://nodejs.org/en/) installed, I recommend a node manager like [fnm](https://github.com/Schniz/fnm). 62 | 63 | ### Upgrade to latest release 64 | 65 | Assuming you [built from source](https://github.com/neovim/neovim/wiki/Building-Neovim#quick-start), `cd` into the folder where you cloned `neovim` and run the following commands. 66 | ``` 67 | git pull 68 | make distclean && make CMAKE_BUILD_TYPE=Release 69 | sudo make install 70 | nvim -v 71 | ``` 72 | 73 | > The computing scientist's main challenge is not to get confused by the complexities of his own making. 74 | 75 | \- Edsger W. Dijkstra 76 | -------------------------------------------------------------------------------- /lua/bexx/project.lua: -------------------------------------------------------------------------------- 1 | local status_ok, project = pcall(require, "project_nvim") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | require("nvim-tree").setup({ 7 | respect_buf_cwd = true, 8 | update_cwd = true, 9 | update_focused_file = { 10 | enable = true, 11 | update_cwd = true 12 | }, 13 | }) 14 | 15 | 16 | project.setup({ 17 | ---@usage set to false to disable project.nvim. 18 | --- This is on by default since it's currently the expected behavior. 19 | active = true, 20 | 21 | on_config_done = nil, 22 | 23 | ---@usage set to true to disable setting the current-woriking directory 24 | --- Manual mode doesn't automatically change your root directory, so you have 25 | --- the option to manually do so using `:ProjectRoot` command. 26 | manual_mode = false, 27 | 28 | ---@usage Methods of detecting the root directory 29 | --- Allowed values: **"lsp"** uses the native neovim lsp 30 | --- **"pattern"** uses vim-rooter like glob pattern matching. Here 31 | --- order matters: if one is not detected, the other is used as fallback. You 32 | --- can also delete or rearangne the detection methods. 33 | -- detection_methods = { "lsp", "pattern" }, -- NOTE: lsp detection will get annoying with multiple langs in one project 34 | detection_methods = { "pattern" }, 35 | 36 | ---@usage patterns used to detect root dir, when **"pattern"** is in detection_methods 37 | patterns = { ".git", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json" }, 38 | 39 | ---@ Show hidden files in telescope when searching for files in a project 40 | show_hidden = false, 41 | 42 | ---@usage When set to false, you will get a message when project.nvim changes your directory. 43 | -- When set to false, you will get a message when project.nvim changes your directory. 44 | silent_chdir = true, 45 | 46 | ---@usage list of lsp client names to ignore when using **lsp** detection. eg: { "efm", ... } 47 | ignore_lsp = {}, 48 | 49 | ---@type string 50 | ---@usage path to store the project history for use in telescope 51 | datapath = vim.fn.stdpath("data"), 52 | }) 53 | 54 | local tele_status_ok, _ = pcall(require, "telescope") 55 | if not tele_status_ok then 56 | return 57 | end 58 | -------------------------------------------------------------------------------- /lua/bexx/node_modules/.bin/prettier: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | "use strict"; 3 | var __getOwnPropNames = Object.getOwnPropertyNames; 4 | var __commonJS = function(cb, mod) { 5 | return function __require() { 6 | return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; 7 | }; 8 | }; 9 | 10 | // node_modules/semver-compare/index.js 11 | var require_semver_compare = __commonJS({ 12 | "node_modules/semver-compare/index.js": function(exports2, module2) { 13 | module2.exports = function cmp(a, b) { 14 | var pa = a.split("."); 15 | var pb = b.split("."); 16 | for (var i = 0; i < 3; i++) { 17 | var na = Number(pa[i]); 18 | var nb = Number(pb[i]); 19 | if (na > nb) 20 | return 1; 21 | if (nb > na) 22 | return -1; 23 | if (!isNaN(na) && isNaN(nb)) 24 | return 1; 25 | if (isNaN(na) && !isNaN(nb)) 26 | return -1; 27 | } 28 | return 0; 29 | }; 30 | } 31 | }); 32 | 33 | // node_modules/please-upgrade-node/index.js 34 | var require_please_upgrade_node = __commonJS({ 35 | "node_modules/please-upgrade-node/index.js": function(exports2, module2) { 36 | var semverCompare = require_semver_compare(); 37 | module2.exports = function pleaseUpgradeNode2(pkg, opts) { 38 | var opts = opts || {}; 39 | var requiredVersion = pkg.engines.node.replace(">=", ""); 40 | var currentVersion = process.version.replace("v", ""); 41 | if (semverCompare(currentVersion, requiredVersion) === -1) { 42 | if (opts.message) { 43 | console.error(opts.message(requiredVersion)); 44 | } else { 45 | console.error(pkg.name + " requires at least version " + requiredVersion + " of Node, please upgrade"); 46 | } 47 | if (opts.hasOwnProperty("exitCode")) { 48 | process.exit(opts.exitCode); 49 | } else { 50 | process.exit(1); 51 | } 52 | } 53 | }; 54 | } 55 | }); 56 | 57 | // bin/prettier.js 58 | var pleaseUpgradeNode = require_please_upgrade_node(); 59 | var packageJson = require("./package.json"); 60 | pleaseUpgradeNode(packageJson); 61 | var cli = require("./cli.js"); 62 | module.exports = cli.run(process.argv.slice(2)); 63 | -------------------------------------------------------------------------------- /lua/bexx/node_modules/prettier/bin-prettier.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | "use strict"; 3 | var __getOwnPropNames = Object.getOwnPropertyNames; 4 | var __commonJS = function(cb, mod) { 5 | return function __require() { 6 | return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; 7 | }; 8 | }; 9 | 10 | // node_modules/semver-compare/index.js 11 | var require_semver_compare = __commonJS({ 12 | "node_modules/semver-compare/index.js": function(exports2, module2) { 13 | module2.exports = function cmp(a, b) { 14 | var pa = a.split("."); 15 | var pb = b.split("."); 16 | for (var i = 0; i < 3; i++) { 17 | var na = Number(pa[i]); 18 | var nb = Number(pb[i]); 19 | if (na > nb) 20 | return 1; 21 | if (nb > na) 22 | return -1; 23 | if (!isNaN(na) && isNaN(nb)) 24 | return 1; 25 | if (isNaN(na) && !isNaN(nb)) 26 | return -1; 27 | } 28 | return 0; 29 | }; 30 | } 31 | }); 32 | 33 | // node_modules/please-upgrade-node/index.js 34 | var require_please_upgrade_node = __commonJS({ 35 | "node_modules/please-upgrade-node/index.js": function(exports2, module2) { 36 | var semverCompare = require_semver_compare(); 37 | module2.exports = function pleaseUpgradeNode2(pkg, opts) { 38 | var opts = opts || {}; 39 | var requiredVersion = pkg.engines.node.replace(">=", ""); 40 | var currentVersion = process.version.replace("v", ""); 41 | if (semverCompare(currentVersion, requiredVersion) === -1) { 42 | if (opts.message) { 43 | console.error(opts.message(requiredVersion)); 44 | } else { 45 | console.error(pkg.name + " requires at least version " + requiredVersion + " of Node, please upgrade"); 46 | } 47 | if (opts.hasOwnProperty("exitCode")) { 48 | process.exit(opts.exitCode); 49 | } else { 50 | process.exit(1); 51 | } 52 | } 53 | }; 54 | } 55 | }); 56 | 57 | // bin/prettier.js 58 | var pleaseUpgradeNode = require_please_upgrade_node(); 59 | var packageJson = require("./package.json"); 60 | pleaseUpgradeNode(packageJson); 61 | var cli = require("./cli.js"); 62 | module.exports = cli.run(process.argv.slice(2)); 63 | -------------------------------------------------------------------------------- /lua/bexx/indentline.lua: -------------------------------------------------------------------------------- 1 | local status_ok, indent_blankline = pcall(require, "indent_blankline") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | vim.g.indent_blankline_buftype_exclude = { "terminal", "nofile" } 7 | vim.g.indent_blankline_filetype_exclude = { 8 | "help", 9 | "startify", 10 | "dashboard", 11 | "packer", 12 | "neogitstatus", 13 | "nerdtree", 14 | "Trouble", 15 | } 16 | vim.g.indentLine_enabled = 1 17 | -- vim.g.indent_blankline_char = "│" 18 | vim.g.indent_blankline_char = "▏" 19 | -- vim.g.indent_blankline_char = "▎" 20 | vim.g.indent_blankline_show_trailing_blankline_indent = false 21 | vim.g.indent_blankline_show_first_indent_level = true 22 | vim.g.indent_blankline_use_treesitter = true 23 | vim.g.indent_blankline_show_current_context = true 24 | vim.g.indent_blankline_context_patterns = { 25 | "class", 26 | "return", 27 | "function", 28 | "method", 29 | "^if", 30 | "^while", 31 | "jsx_element", 32 | "^for", 33 | "^object", 34 | "^table", 35 | "block", 36 | "arguments", 37 | "if_statement", 38 | "else_clause", 39 | "jsx_element", 40 | "jsx_self_closing_element", 41 | "try_statement", 42 | "catch_clause", 43 | "import_statement", 44 | "operation_type", 45 | } 46 | -- HACK: work-around for https://github.com/lukas-reineke/indent-blankline.nvim/issues/59 47 | vim.wo.colorcolumn = "80" 48 | 49 | -- vim.cmd [[highlight IndentBlanklineIndent1 guifg=#E06C75 gui=nocombine]] 50 | -- vim.cmd [[highlight IndentBlanklineIndent2 guifg=#E5C07B gui=nocombine]] 51 | -- vim.cmd [[highlight IndentBlanklineIndent3 guifg=#98C379 gui=nocombine]] 52 | -- vim.cmd [[highlight IndentBlanklineIndent4 guifg=#56B6C2 gui=nocombine]] 53 | -- vim.cmd [[highlight IndentBlanklineIndent5 guifg=#61AFEF gui=nocombine]] 54 | -- vim.cmd [[highlight IndentBlanklineIndent6 guifg=#C678DD gui=nocombine]] 55 | -- vim.opt.list = true 56 | -- vim.opt.listchars:append "space:⋅" 57 | -- vim.opt.listchars:append "space:" 58 | -- vim.opt.listchars:append "eol:↴" 59 | 60 | indent_blankline.setup({ 61 | -- show_end_of_line = true, 62 | -- space_char_blankline = " ", 63 | show_current_context = true, 64 | -- show_current_context_start = true, 65 | -- char_highlight_list = { 66 | -- "IndentBlanklineIndent1", 67 | -- "IndentBlanklineIndent2", 68 | -- "IndentBlanklineIndent3", 69 | -- }, 70 | }) 71 | -------------------------------------------------------------------------------- /lua/bexx/lualine.lua: -------------------------------------------------------------------------------- 1 | local status_ok, lualine = pcall(require, "lualine") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | local hide_in_width = function() 7 | return vim.fn.winwidth(0) > 80 8 | end 9 | 10 | local diagnostics = { 11 | "diagnostics", 12 | sources = { "nvim_diagnostic" }, 13 | sections = { "error", "warn" }, 14 | symbols = { error = " ", warn = " " }, 15 | colored = false, 16 | update_in_insert = false, 17 | always_visible = true, 18 | } 19 | 20 | local diff = { 21 | "diff", 22 | colored = false, 23 | symbols = { added = " ", modified = " ", removed = " " }, -- changes diff symbols 24 | cond = hide_in_width 25 | } 26 | 27 | local mode = { 28 | "mode", 29 | fmt = function(str) 30 | return "-- " .. str .. " --" 31 | end, 32 | } 33 | 34 | local filetype = { 35 | "filetype", 36 | icons_enabled = false, 37 | icon = nil, 38 | } 39 | 40 | local branch = { 41 | "branch", 42 | icons_enabled = true, 43 | icon = "", 44 | } 45 | 46 | local location = { 47 | "location", 48 | padding = 0, 49 | } 50 | 51 | -- cool function for progress 52 | local progress = function() 53 | local current_line = vim.fn.line(".") 54 | local total_lines = vim.fn.line("$") 55 | local chars = { "__", "▁▁", "▂▂", "▃▃", "▄▄", "▅▅", "▆▆", "▇▇", "██" } 56 | local line_ratio = current_line / total_lines 57 | local index = math.ceil(line_ratio * #chars) 58 | return chars[index] 59 | end 60 | 61 | local spaces = function() 62 | return "spaces: " .. vim.api.nvim_buf_get_option(0, "shiftwidth") 63 | end 64 | 65 | lualine.setup({ 66 | options = { 67 | icons_enabled = true, 68 | theme = "auto", 69 | component_separators = { left = "", right = "" }, 70 | section_separators = { left = "", right = "" }, 71 | disabled_filetypes = { "alpha", "dashboard", "NvimTree", "Outline" }, 72 | always_divide_middle = true, 73 | }, 74 | sections = { 75 | lualine_a = { branch, diagnostics }, 76 | lualine_b = { mode }, 77 | lualine_c = {}, 78 | -- lualine_x = { "encoding", "fileformat", "filetype" }, 79 | lualine_x = { diff, spaces, "encoding", filetype }, 80 | lualine_y = { location }, 81 | lualine_z = { progress }, 82 | }, 83 | inactive_sections = { 84 | lualine_a = {}, 85 | lualine_b = {}, 86 | lualine_c = { "filename" }, 87 | lualine_x = { "location" }, 88 | lualine_y = {}, 89 | lualine_z = {}, 90 | }, 91 | tabline = {}, 92 | extensions = {}, 93 | }) 94 | -------------------------------------------------------------------------------- /lua/bexx/options.lua: -------------------------------------------------------------------------------- 1 | local options = { 2 | encoding=utf8 3 | , compatible=false -- disable compatibility to old-time vi 4 | , mouse='va' -- middle-click paste with, enable mouse clicks 5 | , hlsearch=true -- highlight search 6 | , incsearch=true -- incremental search 7 | , tabstop=4 -- number of columns occupied by a tab 8 | , expandtab=false -- make sure that every file uses real tabs, not spaces 9 | , shiftround=true -- round indent to multiple of 'sw' 10 | , softtabstop=4 -- see multiple spaces as tabstops so does the right thing 11 | , smarttab=true 12 | , smartindent=true -- do smart indenting when starting a new line 13 | , shiftwidth=4 -- width for autoindents 14 | , autoindent=true -- indent a new line the same amount as the line just typed 15 | , number=true -- add line numbers 16 | , wildmode={'longest','list'} -- get bash-like tab completions 17 | , clipboard="unnamedplus" -- copy paste between vim and everything else 18 | , cursorline=true -- highlight current cursorline 19 | , signcolumn='yes' -- ??? 20 | , showmatch=true -- show the matching brackets 21 | , ttyfast=true -- Speed up scrolling in Vim 22 | , spell=true -- spell-checker 23 | , backup=false -- create backup file 24 | , cmdheight=2 -- more space in command line for displaying msg 25 | , scrolloff=8 -- number of lines to keep above and below the cursor 26 | , termguicolors=true 27 | , showtabline=2 -- always show tabs 28 | , laststatus=0 -- Always display the status line 29 | , completeopt={'menuone', 'noselect', 'noinsert', 'menu'} -- mostly just for cmp 30 | , cc='80' -- set an 80 column border for good coding style 31 | , guifont={"FiraCode Nerd Font", "h10"} 32 | } 33 | 34 | vim.opt.shortmess:append "c" 35 | 36 | for k, v in pairs(options) do 37 | vim.opt[k] = v 38 | end 39 | 40 | -- Let Airline display icons and use Fira Code font 41 | vim.cmd "let g:airline_powerline_fonts = 1" 42 | -- vim.cmd "syntax on" 43 | -- vim.cmd "filetype plugin indent on" 44 | -- vim.cmd "filetype plugin on" 45 | -- let g:ale_completion_enabled = 1 46 | vim.cmd "let g:ale_sign_error = '👹'" 47 | vim.cmd "let g:ale_sign_warning = '☢️'" 48 | vim.cmd "let g:ale_fixers = { 'rust': ['rustfmt', 'trim_whitespace', 'remove_trailing_lines'] }" 49 | vim.cmd "let g:polyglot_disabled = ['autoindent']" 50 | -------------------------------------------------------------------------------- /lua/bexx/lsp/settings/clangd.lua: -------------------------------------------------------------------------------- 1 | local util = require 'lspconfig.util' 2 | 3 | -- https://clangd.llvm.org/extensions.html#switch-between-sourceheader 4 | local function switch_source_header(bufnr) 5 | bufnr = util.validate_bufnr(bufnr) 6 | local clangd_client = util.get_active_client_by_name(bufnr, 'clangd') 7 | local params = { uri = vim.uri_from_bufnr(bufnr) } 8 | if clangd_client then 9 | clangd_client.request('textDocument/switchSourceHeader', params, function(err, result) 10 | if err then 11 | error(tostring(err)) 12 | end 13 | if not result then 14 | print 'Corresponding file cannot be determined' 15 | return 16 | end 17 | vim.api.nvim_command('edit ' .. vim.uri_to_fname(result)) 18 | end, bufnr) 19 | else 20 | print 'method textDocument/switchSourceHeader is not supported by any servers active on the current buffer' 21 | end 22 | end 23 | 24 | local root_files = { 25 | '.clangd', 26 | '.clang-tidy', 27 | '.clang-format', 28 | 'compile_commands.json', 29 | 'compile_flags.txt', 30 | 'configure.ac', -- AutoTools 31 | } 32 | 33 | local default_capabilities = { 34 | textDocument = { 35 | completion = { 36 | editsNearCursor = true, 37 | }, 38 | }, 39 | offsetEncoding = { 'utf-8', 'utf-16' }, 40 | } 41 | 42 | return { 43 | default_config = { 44 | cmd = { 'clangd' }, 45 | filetypes = { 'c', 'cpp', 'objc', 'objcpp', 'cuda', 'h', 'hpp' }, 46 | root_dir = function(fname) 47 | return util.root_pattern(unpack(root_files))(fname) or util.find_git_ancestor(fname) 48 | end, 49 | single_file_support = true, 50 | capabilities = default_capabilities, 51 | }, 52 | commands = { 53 | ClangdSwitchSourceHeader = { 54 | function() 55 | switch_source_header(0) 56 | end, 57 | description = 'Switch between source/header', 58 | }, 59 | }, 60 | docs = { 61 | description = [[ 62 | https://clangd.llvm.org/installation.html 63 | - **NOTE:** Clang >= 11 is recommended! See [#23](https://github.com/neovim/nvim-lsp/issues/23). 64 | - If `compile_commands.json` lives in a build directory, you should 65 | symlink it to the root of your source tree. 66 | ``` 67 | ln -s /path/to/myproject/build/compile_commands.json /path/to/myproject/ 68 | ``` 69 | - clangd relies on a [JSON compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html) 70 | specified as compile_commands.json, see https://clangd.llvm.org/installation#compile_commandsjson 71 | ]], 72 | default_config = { 73 | root_dir = [[ 74 | root_pattern( 75 | '.clangd', 76 | '.clang-tidy', 77 | '.clang-format', 78 | 'compile_commands.json', 79 | 'compile_flags.txt', 80 | 'configure.ac', 81 | '.git' 82 | ) 83 | ]], 84 | capabilities = [[default capabilities, with offsetEncoding utf-8]], 85 | }, 86 | }, 87 | } 88 | -------------------------------------------------------------------------------- /lua/bexx/lsp/settings/rust_analyzer.lua: -------------------------------------------------------------------------------- 1 | local util = require 'lspconfig.util' 2 | 3 | local function reload_workspace(bufnr) 4 | bufnr = util.validate_bufnr(bufnr) 5 | vim.lsp.buf_request(bufnr, 'rust-analyzer/reloadWorkspace', nil, function(err) 6 | if err then 7 | error(tostring(err)) 8 | end 9 | vim.notify 'Cargo workspace reloaded' 10 | end) 11 | end 12 | 13 | return { 14 | tools = { 15 | autoSetHints = true, 16 | hover_with_actions = true, 17 | inlay_hints = { 18 | show_parameter_hints = false, 19 | parameter_hints_prefix = "", 20 | other_hints_prefix = "", 21 | }, 22 | }, 23 | default_config = { 24 | cmd = { 'rust-analyzer' }, 25 | filetypes = { 'rust', 'rs' }, 26 | root_dir = function(fname) 27 | local cargo_crate_dir = util.root_pattern 'Cargo.toml'(fname) 28 | local cmd = { 'cargo', 'metadata', '--no-deps', '--format-version', '1' } 29 | if cargo_crate_dir ~= nil then 30 | cmd[#cmd + 1] = '--manifest-path' 31 | cmd[#cmd + 1] = util.path.join(cargo_crate_dir, 'Cargo.toml') 32 | end 33 | local cargo_metadata = '' 34 | local cargo_metadata_err = '' 35 | local cm = vim.fn.jobstart(cmd, { 36 | on_stdout = function(_, d, _) 37 | cargo_metadata = table.concat(d, '\n') 38 | end, 39 | on_stderr = function(_, d, _) 40 | cargo_metadata_err = table.concat(d, '\n') 41 | end, 42 | stdout_buffered = true, 43 | stderr_buffered = true, 44 | }) 45 | if cm > 0 then 46 | cm = vim.fn.jobwait({ cm })[1] 47 | else 48 | cm = -1 49 | end 50 | local cargo_workspace_dir = nil 51 | if cm == 0 then 52 | cargo_workspace_dir = vim.fn.json_decode(cargo_metadata)['workspace_root'] 53 | else 54 | vim.notify( 55 | string.format('[lspconfig] cmd (%q) failed:\n%s', table.concat(cmd, ' '), cargo_metadata_err), 56 | vim.log.levels.WARN 57 | ) 58 | end 59 | return cargo_workspace_dir 60 | or cargo_crate_dir 61 | or util.root_pattern 'rust-project.json'(fname) 62 | or util.find_git_ancestor(fname) 63 | end, 64 | settings = { 65 | ['rust-analyzer'] = {}, 66 | checkOnSave = { 67 | command = "clippy" 68 | }, 69 | }, 70 | }, 71 | commands = { 72 | CargoReload = { 73 | function() 74 | reload_workspace(0) 75 | end, 76 | description = 'Reload current cargo workspace', 77 | }, 78 | }, 79 | docs = { 80 | description = [[ 81 | https://github.com/rust-analyzer/rust-analyzer 82 | rust-analyzer (aka rls 2.0), a language server for Rust 83 | See [docs](https://github.com/rust-analyzer/rust-analyzer/tree/master/docs/user#settings) for extra settings. 84 | ]], 85 | default_config = { 86 | root_dir = [[root_pattern("Cargo.toml", "rust-project.json")]], 87 | }, 88 | }, 89 | } 90 | -------------------------------------------------------------------------------- /lua/bexx/nvim-tree.lua: -------------------------------------------------------------------------------- 1 | -- following options are the default 2 | -- each of these are documented in `:help nvim-tree.OPTION_NAME` 3 | vim.g.nvim_tree_icons = { 4 | default = "", 5 | symlink = "", 6 | git = { 7 | unstaged = "", 8 | staged = "S", 9 | unmerged = "", 10 | renamed = "➜", 11 | deleted = "", 12 | untracked = "U", 13 | ignored = "◌", 14 | }, 15 | folder = { 16 | default = "", 17 | open = "", 18 | empty = "", 19 | empty_open = "", 20 | symlink = "", 21 | }, 22 | } 23 | 24 | local status_ok, nvim_tree = pcall(require, "nvim-tree") 25 | if not status_ok then 26 | return 27 | end 28 | 29 | local config_status_ok, nvim_tree_config = pcall(require, "nvim-tree.config") 30 | if not config_status_ok then 31 | return 32 | end 33 | 34 | -- Replaces auto_close 35 | local tree_cb = nvim_tree_config.nvim_tree_callback 36 | vim.api.nvim_create_autocmd("BufEnter", { 37 | nested = true, 38 | callback = function() 39 | if #vim.api.nvim_list_wins() == 1 and vim.api.nvim_buf_get_name(0):match("NvimTree_") ~= nil then 40 | vim.cmd "quit" 41 | end 42 | end 43 | }) 44 | 45 | nvim_tree.setup { 46 | disable_netrw = true, 47 | hijack_netrw = true, 48 | open_on_setup = false, 49 | ignore_ft_on_setup = { 50 | "startify", 51 | "dashboard", 52 | "alpha", 53 | }, 54 | open_on_tab = false, 55 | hijack_cursor = false, 56 | update_cwd = true, 57 | diagnostics = { 58 | enable = true, 59 | icons = { 60 | hint = "", 61 | info = "", 62 | warning = "", 63 | error = "", 64 | }, 65 | }, 66 | update_focused_file = { 67 | enable = true, 68 | update_cwd = true, 69 | ignore_list = {}, 70 | }, 71 | system_open = { 72 | cmd = nil, 73 | args = {}, 74 | }, 75 | filters = { 76 | dotfiles = false, 77 | custom = {}, 78 | }, 79 | git = { 80 | enable = true, 81 | ignore = true, 82 | timeout = 500, 83 | }, 84 | view = { 85 | width = 30, 86 | height = 30, 87 | hide_root_folder = false, 88 | side = "left", 89 | mappings = { 90 | custom_only = false, 91 | list = { 92 | { key = { "l", "", "o" }, cb = tree_cb "edit" }, 93 | { key = "h", cb = tree_cb "close_node" }, 94 | { key = "v", cb = tree_cb "vsplit" }, 95 | }, 96 | }, 97 | number = false, 98 | relativenumber = false, 99 | }, 100 | trash = { 101 | cmd = "trash", 102 | require_confirm = true, 103 | }, 104 | actions = { 105 | open_file = { 106 | quit_on_open = true, 107 | window_picker = { 108 | enable = false, 109 | }, 110 | }, 111 | }, 112 | 113 | -- unknown options as of 22.05 114 | -- 115 | -- update_to_buf_dir = { 116 | -- enable = true, 117 | -- auto_open = true, 118 | -- }, 119 | -- auto_resize = true, 120 | -- git_hl = 1, 121 | -- root_folder_modifier = ":t", 122 | 123 | } 124 | -------------------------------------------------------------------------------- /lua/bexx/lsp/handlers.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | -- TODO: backfill this to template 4 | M.setup = function() 5 | local signs = { 6 | { name = "DiagnosticSignError", text = "♨️" }, 7 | { name = "DiagnosticSignWarn", text = "⚠️" }, 8 | { name = "DiagnosticSignHint", text = "🔮" }, 9 | { name = "DiagnosticSignInfo", text = "📚" }, 10 | } 11 | 12 | for _, sign in ipairs(signs) do 13 | vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" }) 14 | end 15 | 16 | local config = { 17 | -- disable virtual text 18 | virtual_text = false, 19 | -- show signs 20 | signs = { 21 | active = signs, 22 | }, 23 | update_in_insert = true, 24 | underline = true, 25 | severity_sort = true, 26 | float = { 27 | focusable = false, 28 | style = "minimal", 29 | border = "rounded", 30 | source = "always", 31 | header = "", 32 | prefix = "", 33 | }, 34 | } 35 | 36 | vim.diagnostic.config(config) 37 | 38 | vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { 39 | border = "rounded", 40 | }) 41 | 42 | vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { 43 | border = "rounded", 44 | }) 45 | end 46 | 47 | local function lsp_highlight_document(client) 48 | -- Set autocommands conditional on server_capabilities 49 | local status_ok, illuminate = pcall(require, "illuminate") 50 | if not status_ok then 51 | return 52 | end 53 | illuminate.on_attach(client) 54 | -- end 55 | end 56 | 57 | local function lsp_keymaps(bufnr) 58 | local opts = { noremap = true, silent = true } 59 | vim.api.nvim_buf_set_keymap(bufnr, "n", "gD", "lua vim.lsp.buf.declaration()", opts) 60 | vim.api.nvim_buf_set_keymap(bufnr, "n", "gd", "lua vim.lsp.buf.definition()", opts) 61 | vim.api.nvim_buf_set_keymap(bufnr, "n", "K", "lua vim.lsp.buf.hover()", opts) 62 | vim.api.nvim_buf_set_keymap(bufnr, "n", "gi", "lua vim.lsp.buf.implementation()", opts) 63 | vim.api.nvim_buf_set_keymap(bufnr, "n", "", "lua vim.lsp.buf.signature_help()", opts) 64 | vim.api.nvim_buf_set_keymap(bufnr, "n", "gr", "lua vim.lsp.buf.references()", opts) 65 | vim.api.nvim_buf_set_keymap(bufnr, "n", "[d", 'lua vim.diagnostic.goto_prev({ border = "rounded" })', opts) 66 | vim.api.nvim_buf_set_keymap( bufnr, "n", "gl", 'lua vim.diagnostic.open_float({ border = "rounded" })', opts) 67 | vim.api.nvim_buf_set_keymap(bufnr, "n", "]d", 'lua vim.diagnostic.goto_next({ border = "rounded" })', opts) 68 | vim.api.nvim_buf_set_keymap(bufnr, "n", "q", "lua vim.diagnostic.setloclist()", opts) 69 | vim.cmd [[ command! Format execute 'lua vim.lsp.buf.formatting()' ]] 70 | end 71 | 72 | M.on_attach = function(client, bufnr) 73 | 74 | -- TODO: refactor this into a method that checks if string in list 75 | if client.name == "tsserver" then 76 | client.resolved_capabilities.document_formatting = false 77 | end 78 | lsp_keymaps(bufnr) 79 | lsp_highlight_document(client) 80 | end 81 | 82 | local capabilities = vim.lsp.protocol.make_client_capabilities() 83 | 84 | local status_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp") 85 | if not status_ok then 86 | return 87 | end 88 | 89 | M.capabilities = cmp_nvim_lsp.default_capabilities(capabilities) 90 | 91 | return M 92 | -------------------------------------------------------------------------------- /lua/bexx/telescope.lua: -------------------------------------------------------------------------------- 1 | local status_ok, telescope = pcall(require, "telescope") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | local actions = require "telescope.actions" 7 | 8 | telescope.setup { 9 | defaults = { 10 | 11 | prompt_prefix = "🔎 ", 12 | selection_caret = "➡️ ", 13 | path_display = { "smart" }, 14 | 15 | mappings = { 16 | i = { 17 | [""] = actions.cycle_history_next, 18 | [""] = actions.cycle_history_prev, 19 | 20 | [""] = actions.move_selection_next, 21 | [""] = actions.move_selection_previous, 22 | 23 | [""] = actions.close, 24 | 25 | [""] = actions.move_selection_next, 26 | [""] = actions.move_selection_previous, 27 | 28 | [""] = actions.select_default, 29 | [""] = actions.select_horizontal, 30 | [""] = actions.select_vertical, 31 | [""] = actions.select_tab, 32 | 33 | [""] = actions.preview_scrolling_up, 34 | [""] = actions.preview_scrolling_down, 35 | 36 | [""] = actions.results_scrolling_up, 37 | [""] = actions.results_scrolling_down, 38 | 39 | [""] = actions.toggle_selection + actions.move_selection_worse, 40 | [""] = actions.toggle_selection + actions.move_selection_better, 41 | [""] = actions.send_to_qflist + actions.open_qflist, 42 | [""] = actions.send_selected_to_qflist + actions.open_qflist, 43 | [""] = actions.complete_tag, 44 | [""] = actions.which_key, -- keys from pressing 45 | }, 46 | 47 | n = { 48 | [""] = actions.close, 49 | [""] = actions.select_default, 50 | [""] = actions.select_horizontal, 51 | [""] = actions.select_vertical, 52 | [""] = actions.select_tab, 53 | 54 | [""] = actions.toggle_selection + actions.move_selection_worse, 55 | [""] = actions.toggle_selection + actions.move_selection_better, 56 | [""] = actions.send_to_qflist + actions.open_qflist, 57 | [""] = actions.send_selected_to_qflist + actions.open_qflist, 58 | 59 | ["j"] = actions.move_selection_next, 60 | ["k"] = actions.move_selection_previous, 61 | ["H"] = actions.move_to_top, 62 | ["M"] = actions.move_to_middle, 63 | ["L"] = actions.move_to_bottom, 64 | 65 | [""] = actions.move_selection_next, 66 | [""] = actions.move_selection_previous, 67 | ["gg"] = actions.move_to_top, 68 | ["G"] = actions.move_to_bottom, 69 | 70 | [""] = actions.preview_scrolling_up, 71 | [""] = actions.preview_scrolling_down, 72 | 73 | [""] = actions.results_scrolling_up, 74 | [""] = actions.results_scrolling_down, 75 | 76 | ["?"] = actions.which_key, 77 | }, 78 | }, 79 | }, 80 | pickers = { 81 | -- Default configuration for builtin pickers goes here: 82 | -- picker_name = { 83 | -- picker_config_key = value, 84 | -- ... 85 | -- } 86 | -- Now the picker_config_key will be applied every time you call this 87 | -- builtin picker 88 | }, 89 | extensions = { 90 | -- Your extension configuration goes here: 91 | -- extension_name = { 92 | -- extension_config_key = value, 93 | -- } 94 | -- please take a look at the readme of the extension you want to configure 95 | }, 96 | } 97 | -------------------------------------------------------------------------------- /lua/bexx/cmp.lua: -------------------------------------------------------------------------------- 1 | local cmp_status_ok, cmp = pcall(require, "cmp") -- call plugin 2 | if not cmp_status_ok then 3 | return 4 | end 5 | 6 | local snip_status_ok, luasnip = pcall(require, "luasnip") -- call plugin 7 | if not snip_status_ok then 8 | return 9 | end 10 | 11 | require("luasnip/loaders/from_vscode").lazy_load() 12 | 13 | local check_backspace = function() 14 | local col = vim.fn.col "." - 1 15 | return col == 0 or vim.fn.getline("."):sub(col, col):match "%s" 16 | end 17 | 18 | --   פּ ﯟ   some other good icons 19 | local kind_icons = { 20 | Text = "", 21 | Method = "m", 22 | Function = "", 23 | Constructor = "🔨", 24 | Field = "", 25 | Variable = "", 26 | Class = "", 27 | Interface = "", 28 | Module = "", 29 | Property = "⚔️", 30 | Unit = "📐", 31 | Value = "🔢", 32 | Enum = "", 33 | Keyword = "🔑", 34 | Snippet = "✂️", 35 | Color = "🎨", 36 | File = "🗒️", 37 | Reference = "", 38 | Folder = "📁", 39 | EnumMember = "", 40 | Constant = "", 41 | Struct = "", 42 | Event = "📢", 43 | Operator = "🎛️", 44 | TypeParameter = "", 45 | } 46 | -- find more here: https://www.nerdfonts.com/cheat-sheet 47 | 48 | 49 | cmp.setup { 50 | snippet = { 51 | expand = function(args) 52 | luasnip.lsp_expand(args.body) -- For `luasnip` users. 53 | end, 54 | }, 55 | mapping = { 56 | [""] = cmp.mapping.select_prev_item(), 57 | [""] = cmp.mapping.select_next_item(), 58 | [""] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }), 59 | [""] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }), 60 | [""] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }), -- display all available options 61 | [""] = cmp.mapping { 62 | i = cmp.mapping.abort(), 63 | c = cmp.mapping.close(), 64 | }, 65 | -- Accept currently selected item. If none selected, `select` first item. 66 | -- Set `select` to `false` to only confirm explicitly selected items. 67 | [""] = cmp.mapping.confirm { select = true }, 68 | [""] = cmp.mapping(function(fallback) -- setting supertab 69 | if cmp.visible() then 70 | cmp.select_next_item() 71 | elseif luasnip.expandable() then 72 | luasnip.expand() 73 | elseif luasnip.expand_or_jumpable() then 74 | luasnip.expand_or_jump() 75 | elseif check_backspace() then 76 | fallback() 77 | else 78 | fallback() 79 | end 80 | end, { 81 | "i", 82 | "s", 83 | }), 84 | [""] = cmp.mapping(function(fallback) 85 | if cmp.visible() then 86 | cmp.select_prev_item() 87 | elseif luasnip.jumpable(-1) then 88 | luasnip.jump(-1) 89 | else 90 | fallback() 91 | end 92 | end, { 93 | "i", 94 | "s", 95 | }), 96 | }, 97 | formatting = { 98 | fields = { "kind", "abbr", "menu" }, 99 | format = function(entry, vim_item) 100 | -- Kind icons 101 | vim_item.kind = string.format("%s", kind_icons[vim_item.kind]) 102 | vim_item.menu = ({ 103 | nvim_lsp = "[LSP]", 104 | nvim_lua = "[LUA]", 105 | luasnip = "[Snippet]", 106 | buffer = "[Buffer]", 107 | path = "[Path]", 108 | })[entry.source.name] 109 | return vim_item 110 | end, 111 | }, 112 | sources = { 113 | { name = "nvim_lsp" }, 114 | { name = "nvim_lua" }, 115 | { name = "luasnip" }, 116 | { name = "buffer" }, 117 | { name = "path" }, 118 | { name = "creates" }, 119 | }, 120 | confirm_opts = { 121 | behavior = cmp.ConfirmBehavior.Replace, 122 | select = false, 123 | }, 124 | window = { 125 | documentation = { 126 | border = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" }, 127 | }, 128 | }, 129 | experimental = { 130 | ghost_text = false, 131 | native_menu = false, 132 | }, 133 | } 134 | -------------------------------------------------------------------------------- /lua/bexx/plugins.lua: -------------------------------------------------------------------------------- 1 | local fn = vim.fn 2 | 3 | -- Automatically install packer 4 | local install_path = fn.stdpath "data" .. "/site/pack/packer/start/packer.nvim" 5 | if fn.empty(fn.glob(install_path)) > 0 then 6 | PACKER_BOOTSTRAP = fn.system { 7 | "git", 8 | "clone", 9 | "--depth", 10 | "1", 11 | "https://github.com/wbthomason/packer.nvim", 12 | install_path, 13 | } 14 | print "Installing packer close and reopen Neovim..." 15 | vim.cmd [[packadd packer.nvim]] 16 | end 17 | 18 | -- Autocommand that reloads neovim whenever you save the plugins.lua file 19 | vim.cmd [[ 20 | augroup packer_user_config 21 | autocmd! 22 | autocmd BufWritePost plugins.lua source | PackerSync 23 | augroup end 24 | ]] 25 | 26 | -- Use a protected call so we don't error out on first use 27 | local status_ok, packer = pcall(require, "packer") 28 | if not status_ok then 29 | vim.notify("That didn't work!") 30 | return 31 | end 32 | 33 | -- Install your plugins here 34 | return packer.startup(function(use) 35 | -- Plugins here 36 | use "wbthomason/packer.nvim" -- Have packer manage itself 37 | use "windwp/nvim-autopairs" -- Autopairs, integrates with both cmp and treesitter 38 | use "numToStr/Comment.nvim" -- Easily comment stuff 39 | use "kyazdani42/nvim-web-devicons" 40 | use "kyazdani42/nvim-tree.lua" 41 | use "moll/vim-bbye" 42 | use "nvim-lualine/lualine.nvim" 43 | use "akinsho/toggleterm.nvim" 44 | use "ahmedkhalf/project.nvim" 45 | use "lewis6991/impatient.nvim" 46 | use "lukas-reineke/indent-blankline.nvim" 47 | use "goolord/alpha-nvim" 48 | use "antoinemadec/FixCursorHold.nvim" -- This is needed to fix lsp doc highlight 49 | use "folke/which-key.nvim" 50 | use "ryanoasis/vim-devicons" -- Icones for plugins. Works well with Nerd Fonts 51 | use 'dense-analysis/ale'-- async linting 52 | use "sheerun/vim-polyglot" -- A collection of language packs for Vim 53 | use "akinsho/bufferline.nvim" 54 | 55 | -- Treesitter 56 | use { 57 | "nvim-treesitter/nvim-treesitter", 58 | run = ":TSUpdate", 59 | } 60 | use "p00f/nvim-ts-rainbow" 61 | use "JoosepAlviste/nvim-ts-context-commentstring" 62 | 63 | -- Colorschemes 64 | use "lunarvim/colorschemes" -- A bunch of colorschemes you can try out 65 | use "morhetz/gruvbox" 66 | 67 | -- cmp plugins 68 | use "hrsh7th/nvim-cmp" -- The completion plugin 69 | use "hrsh7th/cmp-buffer" -- buffer completions 70 | use "hrsh7th/cmp-path" -- path completions 71 | use "hrsh7th/cmp-cmdline" -- cmdline completions 72 | use "hrsh7th/cmp-nvim-lsp" -- gives lsp completions 73 | use "hrsh7th/cmp-nvim-lua" -- gives lua completions 74 | 75 | -- snippets 76 | use "L3MON4D3/LuaSnip" --snippet engine 77 | use "saadparwaiz1/cmp_luasnip" -- snippet completions 78 | use "rafamadriz/friendly-snippets" -- a bunch of snippets to use 79 | 80 | -- LSP 81 | use "neovim/nvim-lspconfig" -- enable LSP 82 | use "williamboman/nvim-lsp-installer" -- simple to use language server installer 83 | use "tamago324/nlsp-settings.nvim" -- language server settings defined in json for 84 | use "jose-elias-alvarez/null-ls.nvim" -- for formatters and linters 85 | use "rizsotto/Bear" -- Generate compile_commands.json for clangd 86 | 87 | -- Telescope 88 | use "nvim-lua/popup.nvim" -- An implementation of the Popup API from vim in Neovim 89 | use 'nvim-lua/plenary.nvim' 90 | use 'nvim-telescope/telescope.nvim' 91 | 92 | -- NERD Tree 93 | use "scrooloose/nerdtree" 94 | use 'preservim/nerdcommenter' 95 | 96 | -- Airline bar 97 | use "vim-airline/vim-airline" 98 | use "vim-airline/vim-airline-themes" 99 | use "tpope/vim-fugitive" 100 | 101 | -- Rust stuff 102 | use 'saecki/crates.nvim' 103 | 104 | -- Java 105 | use 'mfussenegger/nvim-jdtls' 106 | 107 | -- Git 108 | use "lewis6991/gitsigns.nvim" 109 | 110 | -- Automatically set up your configuration after cloning packer.nvim 111 | -- Put this at the end after all plugins 112 | if PACKER_BOOTSTRAP then 113 | require("packer").sync() 114 | end 115 | end) 116 | -------------------------------------------------------------------------------- /lua/bexx/node_modules/prettier/README.md: -------------------------------------------------------------------------------- 1 | ![Prettier Banner](https://unpkg.com/prettier-logo@1.0.3/images/prettier-banner-light.svg) 2 | 3 |

Opinionated Code Formatter

4 | 5 |

6 | 7 | JavaScript 8 | · TypeScript 9 | · Flow 10 | · JSX 11 | · JSON 12 | 13 |
14 | 15 | CSS 16 | · SCSS 17 | · Less 18 | 19 |
20 | 21 | HTML 22 | · Vue 23 | · Angular 24 | 25 |
26 | 27 | GraphQL 28 | · Markdown 29 | · YAML 30 | 31 |
32 | 33 | 34 | Your favorite language? 35 | 36 | 37 |

38 | 39 |

40 | 41 | Github Actions Build Status 42 | 43 | Github Actions Build Status 44 | 45 | Github Actions Build Status 46 | 47 | Codecov Coverage Status 48 | 49 | Blazing Fast 50 |
51 | 52 | npm version 53 | 54 | weekly downloads from npm 55 | 56 | code style: prettier 57 | 58 | Follow Prettier on Twitter 59 |

60 | 61 | ## Intro 62 | 63 | Prettier is an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary. 64 | 65 | ### Input 66 | 67 | 68 | ```js 69 | foo(reallyLongArg(), omgSoManyParameters(), IShouldRefactorThis(), isThereSeriouslyAnotherOne()); 70 | ``` 71 | 72 | ### Output 73 | 74 | ```js 75 | foo( 76 | reallyLongArg(), 77 | omgSoManyParameters(), 78 | IShouldRefactorThis(), 79 | isThereSeriouslyAnotherOne() 80 | ); 81 | ``` 82 | 83 | Prettier can be run [in your editor](https://prettier.io/docs/en/editors.html) on-save, in a [pre-commit hook](https://prettier.io/docs/en/precommit.html), or in [CI environments](https://prettier.io/docs/en/cli.html#list-different) to ensure your codebase has a consistent style without devs ever having to post a nit-picky comment on a code review ever again! 84 | 85 | --- 86 | 87 | **[Documentation](https://prettier.io/docs/en/)** 88 | 89 | 90 | [Install](https://prettier.io/docs/en/install.html) · 91 | [Options](https://prettier.io/docs/en/options.html) · 92 | [CLI](https://prettier.io/docs/en/cli.html) · 93 | [API](https://prettier.io/docs/en/api.html) 94 | 95 | **[Playground](https://prettier.io/playground/)** 96 | 97 | --- 98 | 99 | ## Badge 100 | 101 | Show the world you're using _Prettier_ → [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier) 102 | 103 | ```md 104 | [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier) 105 | ``` 106 | 107 | ## Contributing 108 | 109 | See [CONTRIBUTING.md](CONTRIBUTING.md). 110 | -------------------------------------------------------------------------------- /lua/bexx/bufferline.lua: -------------------------------------------------------------------------------- 1 | local status_ok, bufferline = pcall(require, "bufferline") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | bufferline.setup { 7 | options = { 8 | numbers = "none", -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string, 9 | close_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions" 10 | right_mouse_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions" 11 | left_mouse_command = "buffer %d", -- can be a string | function, see "Mouse actions" 12 | middle_mouse_command = nil, -- can be a string | function, see "Mouse actions" 13 | -- NOTE: this plugin is designed with this icon in mind, 14 | -- and so changing this is NOT recommended, this is intended 15 | -- as an escape hatch for people who cannot bear it for whatever reason 16 | indicator_style = 'icon', 17 | buffer_close_icon = '', 18 | modified_icon = "●", 19 | close_icon = '', 20 | left_trunc_marker = "", 21 | right_trunc_marker = "", 22 | 23 | max_name_length = 30, 24 | max_prefix_length = 30, -- prefix used when a buffer is de-duplicated 25 | tab_size = 21, 26 | diagnostics = false, -- | "nvim_lsp" | "coc", 27 | diagnostics_update_in_insert = false, 28 | offsets = { 29 | { 30 | filetype = "nerdtree", 31 | text = "File Explorer", 32 | padding = 1, 33 | highlight = "Directory" 34 | } 35 | }, 36 | show_buffer_icons = true, 37 | show_buffer_close_icons = true, 38 | show_close_icon = true, 39 | show_tab_indicators = true, 40 | persist_buffer_sort = true, -- whether or not custom sorted buffers should persist 41 | separator_style = "thin", -- | "thick" | "thin" | { 'any', 'any' }, 42 | enforce_regular_tabs = true, 43 | always_show_bufferline = true, 44 | }, 45 | highlights = { 46 | fill = { 47 | fg = { attribute = "fg", highlight = "#ff0000" }, 48 | bg = { attribute = "bg", highlight = "TabLine" }, 49 | }, 50 | background = { 51 | fg = { attribute = "fg", highlight = "TabLine" }, 52 | bg = { attribute = "bg", highlight = "TabLine" }, 53 | }, 54 | 55 | buffer_visible = { 56 | fg = { attribute = "fg", highlight = "TabLine" }, 57 | bg = { attribute = "bg", highlight = "TabLine" }, 58 | }, 59 | close_button = { 60 | fg = { attribute = "fg", highlight = "TabLine" }, 61 | bg = { attribute = "bg", highlight = "TabLine" }, 62 | }, 63 | close_button_visible = { 64 | fg = { attribute = "fg", highlight = "TabLine" }, 65 | bg = { attribute = "bg", highlight = "TabLine" }, 66 | }, 67 | tab_selected = { 68 | fg = { attribute = "fg", highlight = "Normal" }, 69 | bg = { attribute = "bg", highlight = "Normal" }, 70 | }, 71 | tab = { 72 | fg = { attribute = "fg", highlight = "TabLine" }, 73 | bg = { attribute = "bg", highlight = "TabLine" }, 74 | }, 75 | tab_close = { 76 | fg = { attribute = "fg", highlight = "TabLineSel" }, 77 | bg = { attribute = "bg", highlight = "Normal" }, 78 | }, 79 | 80 | duplicate_selected = { 81 | fg = { attribute = "fg", highlight = "TabLineSel" }, 82 | bg = { attribute = "bg", highlight = "TabLineSel" }, 83 | underline = true, 84 | }, 85 | duplicate_visible = { 86 | fg = { attribute = "fg", highlight = "TabLine" }, 87 | bg = { attribute = "bg", highlight = "TabLine" }, 88 | 89 | }, 90 | duplicate = { 91 | fg = { attribute = "fg", highlight = "TabLine" }, 92 | bg = { attribute = "bg", highlight = "TabLine" }, 93 | underline = true, 94 | }, 95 | modified = { 96 | fg = { attribute = "fg", highlight = "TabLine" }, 97 | bg = { attribute = "bg", highlight = "TabLine" }, 98 | }, 99 | modified_selected = { 100 | fg = { attribute = "fg", highlight = "Normal" }, 101 | bg = { attribute = "bg", highlight = "Normal" }, 102 | }, 103 | modified_visible = { 104 | fg = { attribute = "fg", highlight = "TabLine" }, 105 | bg = { attribute = "bg", highlight = "TabLine" }, 106 | }, 107 | 108 | separator = { 109 | fg = { attribute = "bg", highlight = "TabLine" }, 110 | bg = { attribute = "bg", highlight = "TabLine" }, 111 | }, 112 | separator_selected = { 113 | fg = { attribute = "bg", highlight = "Normal" }, 114 | bg = { attribute = "bg", highlight = "Normal" }, 115 | }, 116 | indicator_selected = { 117 | fg = { attribute = "fg", highlight = "LspDiagnosticsDefaultHint" }, 118 | bg = { attribute = "bg", highlight = "Normal" }, 119 | }, 120 | }, 121 | } 122 | -------------------------------------------------------------------------------- /lua/bexx/lsp/settings/ftplugin/java.lua: -------------------------------------------------------------------------------- 1 | local jdtls = require('jdtls') 2 | local root_markers = {'gradlew', '.git'} 3 | local root_dir = require('jdtls.setup').find_root(root_markers) 4 | local home = os.getenv('HOME') 5 | local workspace_folder = home .. "/.local/share/eclipse/" .. vim.fn.fnamemodify(root_dir, ":p:h:t") 6 | local config = require('me.lsp.conf').mk_config() 7 | config.settings = { 8 | java = { 9 | signatureHelp = { enabled = true }; 10 | contentProvider = { preferred = 'fernflower' }; 11 | completion = { 12 | favoriteStaticMembers = { 13 | "org.hamcrest.MatcherAssert.assertThat", 14 | "org.hamcrest.Matchers.*", 15 | "org.hamcrest.CoreMatchers.*", 16 | "org.junit.jupiter.api.Assertions.*", 17 | "java.util.Objects.requireNonNull", 18 | "java.util.Objects.requireNonNullElse", 19 | "org.mockito.Mockito.*" 20 | }, 21 | filteredTypes = { 22 | "com.sun.*", 23 | "io.micrometer.shaded.*", 24 | "java.awt.*", 25 | "jdk.*", 26 | "sun.*", 27 | }, 28 | }; 29 | sources = { 30 | organizeImports = { 31 | starThreshold = 9999; 32 | staticStarThreshold = 9999; 33 | }; 34 | }; 35 | codeGeneration = { 36 | toString = { 37 | template = "${object.className}{${member.name()}=${member.value}, ${otherMembers}}" 38 | }, 39 | hashCodeEquals = { 40 | useJava7Objects = true, 41 | }, 42 | useBlocks = true, 43 | }; 44 | configuration = { 45 | runtimes = { 46 | { 47 | name = "JavaSE-1.8", 48 | path = "/usr/lib/jvm/java-8-openjdk/", 49 | }, 50 | { 51 | name = "JavaSE-11", 52 | path = "/usr/lib/jvm/java-11-openjdk/", 53 | }, 54 | { 55 | name = "JavaSE-16", 56 | path = home .. "/.local/jdks/jdk-16.0.1+9/", 57 | }, 58 | { 59 | name = "JavaSE-17", 60 | path = home .. "/.local/jdks/jdk-17.0.2+8/", 61 | }, 62 | } 63 | }; 64 | }; 65 | } 66 | config.cmd = { 67 | home .. "/.local/jdks/jdk-17.0.2+8/bin/java", 68 | '-Declipse.application=org.eclipse.jdt.ls.core.id1', 69 | '-Dosgi.bundles.defaultStartLevel=4', 70 | '-Declipse.product=org.eclipse.jdt.ls.core.product', 71 | '-Dlog.protocol=true', 72 | '-Dlog.level=ALL', 73 | '-Xmx4g', 74 | '--add-modules=ALL-SYSTEM', 75 | '--add-opens', 'java.base/java.util=ALL-UNNAMED', 76 | '--add-opens', 'java.base/java.lang=ALL-UNNAMED', 77 | '-jar', vim.fn.glob(home .. '/dev/eclipse/eclipse.jdt.ls/org.eclipse.jdt.ls.product/target/repository/plugins/org.eclipse.equinox.launcher_*.jar'), 78 | '-configuration', home .. '/dev/eclipse/eclipse.jdt.ls/org.eclipse.jdt.ls.product/target/repository/config_linux', 79 | '-data', workspace_folder, 80 | } 81 | config.on_attach = function(client, bufnr) 82 | require('me.lsp.conf').on_attach(client, bufnr, { 83 | server_side_fuzzy_completion = true, 84 | }) 85 | 86 | jdtls.setup_dap({hotcodereplace = 'auto'}) 87 | jdtls.setup.add_commands() 88 | local opts = { silent = true, buffer = bufnr } 89 | vim.keymap.set('n', "", jdtls.organize_imports, opts) 90 | vim.keymap.set('n', "df", jdtls.test_class, opts) 91 | vim.keymap.set('n', "dn", jdtls.test_nearest_method, opts) 92 | vim.keymap.set('n', "crv", jdtls.extract_variable, opts) 93 | vim.keymap.set('v', 'crm', [[lua require('jdtls').extract_method(true)]], opts) 94 | vim.keymap.set('n', "crc", jdtls.extract_constant, opts) 95 | local create_command = vim.api.nvim_buf_create_user_command 96 | create_command(bufnr, 'W', require('me.lsp.ext').remove_unused_imports, { 97 | nargs = 0, 98 | }) 99 | end 100 | 101 | local jar_patterns = { 102 | '/dev/microsoft/java-debug/com.microsoft.java.debug.plugin/target/com.microsoft.java.debug.plugin-*.jar', 103 | '/dev/dgileadi/vscode-java-decompiler/server/*.jar', 104 | '/dev/microsoft/vscode-java-test/java-extension/com.microsoft.java.test.plugin/target/*.jar', 105 | '/dev/microsoft/vscode-java-test/java-extension/com.microsoft.java.test.runner/target/*.jar', 106 | '/dev/microsoft/vscode-java-test/java-extension/com.microsoft.java.test.runner/lib/*.jar', 107 | '/dev/testforstephen/vscode-pde/server/*.jar' 108 | } 109 | -- npm install broke for me: https://github.com/npm/cli/issues/2508 110 | -- So gather the required jars manually; this is based on the gulpfile.js in the vscode-java-test repo 111 | local plugin_path = '/dev/microsoft/vscode-java-test/java-extension/com.microsoft.java.test.plugin.site/target/repository/plugins/' 112 | local bundle_list = vim.tbl_map( 113 | function(x) return require('jdtls.path').join(plugin_path, x) end, 114 | { 115 | 'org.eclipse.jdt.junit4.runtime_*.jar', 116 | 'org.eclipse.jdt.junit5.runtime_*.jar', 117 | 'org.junit.jupiter.api*.jar', 118 | 'org.junit.jupiter.engine*.jar', 119 | 'org.junit.jupiter.migrationsupport*.jar', 120 | 'org.junit.jupiter.params*.jar', 121 | 'org.junit.vintage.engine*.jar', 122 | 'org.opentest4j*.jar', 123 | 'org.junit.platform.commons*.jar', 124 | 'org.junit.platform.engine*.jar', 125 | 'org.junit.platform.launcher*.jar', 126 | 'org.junit.platform.runner*.jar', 127 | 'org.junit.platform.suite.api*.jar', 128 | 'org.apiguardian*.jar' 129 | } 130 | ) 131 | vim.list_extend(jar_patterns, bundle_list) 132 | local bundles = {} 133 | for _, jar_pattern in ipairs(jar_patterns) do 134 | for _, bundle in ipairs(vim.split(vim.fn.glob(home .. jar_pattern), '\n')) do 135 | if not vim.endswith(bundle, 'com.microsoft.java.test.runner-jar-with-dependencies.jar') 136 | and not vim.endswith(bundle, 'com.microsoft.java.test.runner.jar') then 137 | table.insert(bundles, bundle) 138 | end 139 | end 140 | end 141 | local extendedClientCapabilities = jdtls.extendedClientCapabilities; 142 | extendedClientCapabilities.resolveAdditionalTextEditsSupport = true; 143 | config.init_options = { 144 | bundles = bundles; 145 | extendedClientCapabilities = extendedClientCapabilities; 146 | } 147 | -- mute; having progress reports is enough 148 | config.handlers['language/status'] = function() end 149 | jdtls.start_or_attach(config) 150 | -------------------------------------------------------------------------------- /lua/bexx/lsp/settings/jsonls.lua: -------------------------------------------------------------------------------- 1 | local default_schemas = nil 2 | local status_ok, jsonls_settings = pcall(require, "nlspsettings.jsonls") 3 | if status_ok then 4 | default_schemas = jsonls_settings.get_default_schemas() 5 | end 6 | 7 | local schemas = { 8 | { 9 | description = "TypeScript compiler configuration file", 10 | fileMatch = { 11 | "tsconfig.json", 12 | "tsconfig.*.json", 13 | }, 14 | url = "https://json.schemastore.org/tsconfig.json", 15 | }, 16 | { 17 | description = "Lerna config", 18 | fileMatch = { "lerna.json" }, 19 | url = "https://json.schemastore.org/lerna.json", 20 | }, 21 | { 22 | description = "Babel configuration", 23 | fileMatch = { 24 | ".babelrc.json", 25 | ".babelrc", 26 | "babel.config.json", 27 | }, 28 | url = "https://json.schemastore.org/babelrc.json", 29 | }, 30 | { 31 | description = "ESLint config", 32 | fileMatch = { 33 | ".eslintrc.json", 34 | ".eslintrc", 35 | }, 36 | url = "https://json.schemastore.org/eslintrc.json", 37 | }, 38 | { 39 | description = "Bucklescript config", 40 | fileMatch = { "bsconfig.json" }, 41 | url = "https://raw.githubusercontent.com/rescript-lang/rescript-compiler/8.2.0/docs/docson/build-schema.json", 42 | }, 43 | { 44 | description = "Prettier config", 45 | fileMatch = { 46 | ".prettierrc", 47 | ".prettierrc.json", 48 | "prettier.config.json", 49 | }, 50 | url = "https://json.schemastore.org/prettierrc", 51 | }, 52 | { 53 | description = "Vercel Now config", 54 | fileMatch = { "now.json" }, 55 | url = "https://json.schemastore.org/now", 56 | }, 57 | { 58 | description = "Stylelint config", 59 | fileMatch = { 60 | ".stylelintrc", 61 | ".stylelintrc.json", 62 | "stylelint.config.json", 63 | }, 64 | url = "https://json.schemastore.org/stylelintrc", 65 | }, 66 | { 67 | description = "A JSON schema for the ASP.NET LaunchSettings.json files", 68 | fileMatch = { "launchsettings.json" }, 69 | url = "https://json.schemastore.org/launchsettings.json", 70 | }, 71 | { 72 | description = "Schema for CMake Presets", 73 | fileMatch = { 74 | "CMakePresets.json", 75 | "CMakeUserPresets.json", 76 | }, 77 | url = "https://raw.githubusercontent.com/Kitware/CMake/master/Help/manual/presets/schema.json", 78 | }, 79 | { 80 | description = "Configuration file as an alternative for configuring your repository in the settings page.", 81 | fileMatch = { 82 | ".codeclimate.json", 83 | }, 84 | url = "https://json.schemastore.org/codeclimate.json", 85 | }, 86 | { 87 | description = "LLVM compilation database", 88 | fileMatch = { 89 | "compile_commands.json", 90 | }, 91 | url = "https://json.schemastore.org/compile-commands.json", 92 | }, 93 | { 94 | description = "Config file for Command Task Runner", 95 | fileMatch = { 96 | "commands.json", 97 | }, 98 | url = "https://json.schemastore.org/commands.json", 99 | }, 100 | { 101 | description = "AWS CloudFormation provides a common language for you to describe and provision all the infrastructure resources in your cloud environment.", 102 | fileMatch = { 103 | "*.cf.json", 104 | "cloudformation.json", 105 | }, 106 | url = "https://raw.githubusercontent.com/awslabs/goformation/v5.2.9/schema/cloudformation.schema.json", 107 | }, 108 | { 109 | description = "The AWS Serverless Application Model (AWS SAM, previously known as Project Flourish) extends AWS CloudFormation to provide a simplified way of defining the Amazon API Gateway APIs, AWS Lambda functions, and Amazon DynamoDB tables needed by your serverless application.", 110 | fileMatch = { 111 | "serverless.template", 112 | "*.sam.json", 113 | "sam.json", 114 | }, 115 | url = "https://raw.githubusercontent.com/awslabs/goformation/v5.2.9/schema/sam.schema.json", 116 | }, 117 | { 118 | description = "Json schema for properties json file for a GitHub Workflow template", 119 | fileMatch = { 120 | ".github/workflow-templates/**.properties.json", 121 | }, 122 | url = "https://json.schemastore.org/github-workflow-template-properties.json", 123 | }, 124 | { 125 | description = "golangci-lint configuration file", 126 | fileMatch = { 127 | ".golangci.toml", 128 | ".golangci.json", 129 | }, 130 | url = "https://json.schemastore.org/golangci-lint.json", 131 | }, 132 | { 133 | description = "JSON schema for the JSON Feed format", 134 | fileMatch = { 135 | "feed.json", 136 | }, 137 | url = "https://json.schemastore.org/feed.json", 138 | versions = { 139 | ["1"] = "https://json.schemastore.org/feed-1.json", 140 | ["1.1"] = "https://json.schemastore.org/feed.json", 141 | }, 142 | }, 143 | { 144 | description = "Packer template JSON configuration", 145 | fileMatch = { 146 | "packer.json", 147 | }, 148 | url = "https://json.schemastore.org/packer.json", 149 | }, 150 | { 151 | description = "NPM configuration file", 152 | fileMatch = { 153 | "package.json", 154 | }, 155 | url = "https://json.schemastore.org/package.json", 156 | }, 157 | { 158 | description = "JSON schema for Visual Studio component configuration files", 159 | fileMatch = { 160 | "*.vsconfig", 161 | }, 162 | url = "https://json.schemastore.org/vsconfig.json", 163 | }, 164 | { 165 | description = "Resume json", 166 | fileMatch = { "resume.json" }, 167 | url = "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json", 168 | }, 169 | } 170 | 171 | local function extend(tab1, tab2) 172 | for _, value in ipairs(tab2 or {}) do 173 | table.insert(tab1, value) 174 | end 175 | return tab1 176 | end 177 | 178 | local extended_schemas = extend(schemas, default_schemas) 179 | 180 | local opts = { 181 | settings = { 182 | json = { 183 | schemas = extended_schemas, 184 | }, 185 | }, 186 | setup = { 187 | commands = { 188 | Format = { 189 | function() 190 | vim.lsp.buf.range_formatting({}, { 0, 0 }, { vim.fn.line "$", 0 }) 191 | end, 192 | }, 193 | }, 194 | }, 195 | } 196 | 197 | return opts 198 | -------------------------------------------------------------------------------- /lua/bexx/whichkey.lua: -------------------------------------------------------------------------------- 1 | local status_ok, which_key = pcall(require, "which-key") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | local setup = { 7 | plugins = { 8 | marks = true, -- shows a list of your marks on ' and ` 9 | registers = true, -- shows your registers on " in NORMAL or in INSERT mode 10 | spelling = { 11 | enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions 12 | suggestions = 20, -- how many suggestions should be shown in the list? 13 | }, 14 | -- the presets plugin, adds help for a bunch of default keybindings in Neovim 15 | -- No actual key bindings are created 16 | presets = { 17 | operators = false, -- adds help for operators like d, y, ... and registers them for motion / text object completion 18 | motions = true, -- adds help for motions 19 | text_objects = true, -- help for text objects triggered after entering an operator 20 | windows = true, -- default bindings on 21 | nav = true, -- misc bindings to work with windows 22 | z = true, -- bindings for folds, spelling and others prefixed with z 23 | g = true, -- bindings for prefixed with g 24 | }, 25 | }, 26 | -- add operators that will trigger motion and text object completion 27 | -- to enable all native operators, set the preset / operators plugin above 28 | -- operators = { gc = "Comments" }, 29 | key_labels = { 30 | -- override the label used to display some keys. It doesn't effect WK in any other way. 31 | -- For example: 32 | -- [""] = "SPC", 33 | -- [""] = "RET", 34 | -- [""] = "TAB", 35 | }, 36 | icons = { 37 | breadcrumb = "»", -- symbol used in the command line area that shows your active key combo 38 | separator = "➜", -- symbol used between a key and it's label 39 | group = "+", -- symbol prepended to a group 40 | }, 41 | popup_mappings = { 42 | scroll_down = "", -- binding to scroll down inside the popup 43 | scroll_up = "", -- binding to scroll up inside the popup 44 | }, 45 | window = { 46 | border = "rounded", -- none, single, double, shadow 47 | position = "bottom", -- bottom, top 48 | margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left] 49 | padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left] 50 | winblend = 0, 51 | }, 52 | layout = { 53 | height = { min = 4, max = 25 }, -- min and max height of the columns 54 | width = { min = 20, max = 50 }, -- min and max width of the columns 55 | spacing = 3, -- spacing between columns 56 | align = "left", -- align columns left, center or right 57 | }, 58 | ignore_missing = true, -- enable this to hide mappings for which you didn't specify a label 59 | hidden = { "", "", "", "", "call", "lua", "^:", "^ " }, -- hide mapping boilerplate 60 | show_help = true, -- show help message on the command line when the popup is visible 61 | triggers = "auto", -- automatically setup triggers 62 | -- triggers = {""} -- or specify a list manually 63 | triggers_blacklist = { 64 | -- list of mode / prefixes that should never be hooked by WhichKey 65 | -- this is mostly relevant for key maps that start with a native binding 66 | -- most people should not need to change this 67 | i = { "j", "k" }, 68 | v = { "j", "k" }, 69 | }, 70 | } 71 | 72 | local opts = { 73 | mode = "n", -- NORMAL mode 74 | prefix = "", 75 | buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings 76 | silent = true, -- use `silent` when creating keymaps 77 | noremap = true, -- use `noremap` when creating keymaps 78 | nowait = true, -- use `nowait` when creating keymaps 79 | } 80 | 81 | local mappings = { 82 | ["a"] = { "Alpha", "Alpha" }, 83 | ["b"] = { 84 | "lua require('telescope.builtin').buffers(require('telescope.themes').get_dropdown{previewer = false})", 85 | "Buffers", 86 | }, 87 | ["e"] = { "NvimTreeToggle", "Explorer" }, 88 | ["w"] = { "w!", "Save" }, 89 | ["q"] = { "q!", "Quit" }, 90 | ["c"] = { "Bdelete!", "Close Buffer" }, 91 | ["h"] = { "nohlsearch", "No Highlight" }, 92 | -- ["f"] = { 93 | -- "lua require('telescope.builtin').find_files(require('telescope.themes').get_dropdown{previewer = false})", 94 | -- "Find files", 95 | -- }, 96 | ["F"] = { "Telescope live_grep theme=ivy", "Find Text" }, 97 | ["P"] = { "lua require('telescope').extensions.projects.projects()", "Projects" }, 98 | 99 | p = { 100 | name = "Packer", 101 | c = { "PackerCompile", "Compile" }, 102 | i = { "PackerInstall", "Install" }, 103 | s = { "PackerSync", "Sync" }, 104 | S = { "PackerStatus", "Status" }, 105 | u = { "PackerUpdate", "Update" }, 106 | }, 107 | 108 | g = { 109 | name = "Git", 110 | g = { "lua _LAZYGIT_TOGGLE()", "Lazygit" }, 111 | j = { "lua require 'gitsigns'.next_hunk()", "Next Hunk" }, 112 | k = { "lua require 'gitsigns'.prev_hunk()", "Prev Hunk" }, 113 | l = { "lua require 'gitsigns'.blame_line()", "Blame" }, 114 | p = { "lua require 'gitsigns'.preview_hunk()", "Preview Hunk" }, 115 | r = { "lua require 'gitsigns'.reset_hunk()", "Reset Hunk" }, 116 | R = { "lua require 'gitsigns'.reset_buffer()", "Reset Buffer" }, 117 | s = { "lua require 'gitsigns'.stage_hunk()", "Stage Hunk" }, 118 | u = { 119 | "lua require 'gitsigns'.undo_stage_hunk()", 120 | "Undo Stage Hunk", 121 | }, 122 | o = { "Telescope git_status", "Open changed file" }, 123 | b = { "Telescope git_branches", "Checkout branch" }, 124 | c = { "Telescope git_commits", "Checkout commit" }, 125 | d = { 126 | "Gitsigns diffthis HEAD", 127 | "Diff", 128 | }, 129 | }, 130 | 131 | l = { 132 | name = "LSP", 133 | a = { "lua vim.lsp.buf.code_action()", "Code Action" }, 134 | d = { 135 | "Telescope lsp_document_diagnostics", 136 | "Document Diagnostics", 137 | }, 138 | w = { 139 | "Telescope lsp_workspace_diagnostics", 140 | "Workspace Diagnostics", 141 | }, 142 | f = { "lua vim.lsp.buf.formatting()", "Format" }, 143 | i = { "LspInfo", "Info" }, 144 | I = { "LspInstallInfo", "Installer Info" }, 145 | j = { 146 | "lua vim.lsp.diagnostic.goto_next()", 147 | "Next Diagnostic", 148 | }, 149 | k = { 150 | "lua vim.lsp.diagnostic.goto_prev()", 151 | "Prev Diagnostic", 152 | }, 153 | l = { "lua vim.lsp.codelens.run()", "CodeLens Action" }, 154 | q = { "lua vim.lsp.diagnostic.set_loclist()", "Quickfix" }, 155 | r = { "lua vim.lsp.buf.rename()", "Rename" }, 156 | s = { "Telescope lsp_document_symbols", "Document Symbols" }, 157 | S = { 158 | "Telescope lsp_dynamic_workspace_symbols", 159 | "Workspace Symbols", 160 | }, 161 | }, 162 | s = { 163 | name = "Search", 164 | b = { "Telescope git_branches", "Checkout branch" }, 165 | c = { "Telescope colorscheme", "Colorscheme" }, 166 | h = { "Telescope help_tags", "Find Help" }, 167 | M = { "Telescope man_pages", "Man Pages" }, 168 | r = { "Telescope oldfiles", "Open Recent File" }, 169 | R = { "Telescope registers", "Registers" }, 170 | k = { "Telescope keymaps", "Keymaps" }, 171 | C = { "Telescope commands", "Commands" }, 172 | }, 173 | 174 | t = { 175 | name = "Terminal", 176 | n = { "lua _NODE_TOGGLE()", "Node" }, 177 | u = { "lua _NCDU_TOGGLE()", "NCDU" }, 178 | t = { "lua _HTOP_TOGGLE()", "Htop" }, 179 | p = { "lua _PYTHON_TOGGLE()", "Python" }, 180 | f = { "ToggleTerm direction=float", "Float" }, 181 | h = { "ToggleTerm size=10 direction=horizontal", "Horizontal" }, 182 | v = { "ToggleTerm size=80 direction=vertical", "Vertical" }, 183 | }, 184 | } 185 | 186 | which_key.setup(setup) 187 | which_key.register(mappings, opts) 188 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /lua/bexx/node_modules/prettier/esm/parser-graphql.mjs: -------------------------------------------------------------------------------- 1 | "use strict";var X=Object.getOwnPropertyNames,re=(l,T)=>function(){return l&&(T=(0,l[X(l)[0]])(l=0)),T},K=(l,T)=>function(){return T||(0,l[X(l)[0]])((T={exports:{}}).exports,T),T.exports},L=re({""(){}}),ie=K({"src/common/parser-create-error.js"(l,T){"use strict";L();function a(p,r){let _=new SyntaxError(p+" ("+r.start.line+":"+r.start.column+")");return _.loc=r,_}T.exports=a}}),ae=K({"src/utils/try-combinations.js"(l,T){"use strict";L();function a(){let p;for(var r=arguments.length,_=new Array(r),E=0;E120){for(var t=Math.floor(i/80),s=i%80,y=[],f=0;f"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function e(f){return Function.toString.call(f).indexOf("[native code]")!==-1}function n(f,m){return n=Object.setPrototypeOf||function(d,c){return d.__proto__=c,d},n(f,m)}function t(f){return t=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},t(f)}var s=function(f){O(o,f);var m=S(o);function o(d,c,v,A,x,b,P){var U,q,V,G,C;k(this,o),C=m.call(this,d);var R=Array.isArray(c)?c.length!==0?c:void 0:c?[c]:void 0,Y=v;if(!Y&&R){var J;Y=(J=R[0].loc)===null||J===void 0?void 0:J.source}var F=A;!F&&R&&(F=R.reduce(function(w,M){return M.loc&&w.push(M.loc.start),w},[])),F&&F.length===0&&(F=void 0);var B;A&&v?B=A.map(function(w){return(0,r.getLocation)(v,w)}):R&&(B=R.reduce(function(w,M){return M.loc&&w.push((0,r.getLocation)(M.loc.source,M.loc.start)),w},[]));var j=P;if(j==null&&b!=null){var Q=b.extensions;(0,a.default)(Q)&&(j=Q)}return Object.defineProperties(h(C),{name:{value:"GraphQLError"},message:{value:d,enumerable:!0,writable:!0},locations:{value:(U=B)!==null&&U!==void 0?U:void 0,enumerable:B!=null},path:{value:x!=null?x:void 0,enumerable:x!=null},nodes:{value:R!=null?R:void 0},source:{value:(q=Y)!==null&&q!==void 0?q:void 0},positions:{value:(V=F)!==null&&V!==void 0?V:void 0},originalError:{value:b},extensions:{value:(G=j)!==null&&G!==void 0?G:void 0,enumerable:j!=null}}),b!=null&&b.stack?(Object.defineProperty(h(C),"stack",{value:b.stack,writable:!0,configurable:!0}),I(C)):(Error.captureStackTrace?Error.captureStackTrace(h(C),o):Object.defineProperty(h(C),"stack",{value:Error().stack,writable:!0,configurable:!0}),C)}return D(o,[{key:"toString",value:function(){return y(this)}},{key:p.SYMBOL_TO_STRING_TAG,get:function(){return"Object"}}]),o}(N(Error));l.GraphQLError=s;function y(f){var m=f.message;if(f.nodes)for(var o=0,d=f.nodes;o",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"});l.TokenKind=T}}),ne=K({"node_modules/graphql/jsutils/inspect.js"(l){"use strict";L(),Object.defineProperty(l,"__esModule",{value:!0}),l.default=E;var T=a(Z());function a(h){return h&&h.__esModule?h:{default:h}}function p(h){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?p=function(i){return typeof i}:p=function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},p(h)}var r=10,_=2;function E(h){return k(h,[])}function k(h,N){switch(p(h)){case"string":return JSON.stringify(h);case"function":return h.name?"[function ".concat(h.name,"]"):"[function]";case"object":return h===null?"null":g(h,N);default:return String(h)}}function g(h,N){if(N.indexOf(h)!==-1)return"[Circular]";var i=[].concat(N,[h]),u=S(h);if(u!==void 0){var e=u.call(h);if(e!==h)return typeof e=="string"?e:k(e,i)}else if(Array.isArray(h))return O(h,i);return D(h,i)}function D(h,N){var i=Object.keys(h);if(i.length===0)return"{}";if(N.length>_)return"["+I(h)+"]";var u=i.map(function(e){var n=k(h[e],N);return e+": "+n});return"{ "+u.join(", ")+" }"}function O(h,N){if(h.length===0)return"[]";if(N.length>_)return"[Array]";for(var i=Math.min(r,h.length),u=h.length-i,e=[],n=0;n1&&e.push("... ".concat(u," more items")),"["+e.join(", ")+"]"}function S(h){var N=h[String(T.default)];if(typeof N=="function")return N;if(typeof h.inspect=="function")return h.inspect}function I(h){var N=Object.prototype.toString.call(h).replace(/^\[object /,"").replace(/]$/,"");if(N==="Object"&&typeof h.constructor=="function"){var i=h.constructor.name;if(typeof i=="string"&&i!=="")return i}return N}}}),de=K({"node_modules/graphql/jsutils/devAssert.js"(l){"use strict";L(),Object.defineProperty(l,"__esModule",{value:!0}),l.default=T;function T(a,p){var r=Boolean(a);if(!r)throw new Error(p)}}}),he=K({"node_modules/graphql/jsutils/instanceOf.js"(l){"use strict";L(),Object.defineProperty(l,"__esModule",{value:!0}),l.default=void 0;var T=a(ne());function a(r){return r&&r.__esModule?r:{default:r}}var p=function(_,E){return _ instanceof E};l.default=p}}),ve=K({"node_modules/graphql/language/source.js"(l){"use strict";L(),Object.defineProperty(l,"__esModule",{value:!0}),l.isSource=D,l.Source=void 0;var T=H(),a=_(ne()),p=_(de()),r=_(he());function _(O){return O&&O.__esModule?O:{default:O}}function E(O,S){for(var I=0;I1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof S=="string"||(0,p.default)(0,"Body must be a string. Received: ".concat((0,a.default)(S),".")),this.body=S,this.name=I,this.locationOffset=h,this.locationOffset.line>0||(0,p.default)(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,p.default)(0,"column in locationOffset is 1-indexed and must be positive.")}return k(O,[{key:T.SYMBOL_TO_STRING_TAG,get:function(){return"Source"}}]),O}();l.Source=g;function D(O){return(0,r.default)(O,g)}}}),Te=K({"node_modules/graphql/language/directiveLocation.js"(l){"use strict";L(),Object.defineProperty(l,"__esModule",{value:!0}),l.DirectiveLocation=void 0;var T=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});l.DirectiveLocation=T}}),_e=K({"node_modules/graphql/language/blockString.js"(l){"use strict";L(),Object.defineProperty(l,"__esModule",{value:!0}),l.dedentBlockStringValue=T,l.getBlockStringIndentation=p,l.printBlockString=r;function T(_){var E=_.split(/\r\n|[\n\r]/g),k=p(_);if(k!==0)for(var g=1;gD&&a(E[O-1]);)--O;return E.slice(D,O).join(` 10 | `)}function a(_){for(var E=0;E<_.length;++E)if(_[E]!==" "&&_[E]!==" ")return!1;return!0}function p(_){for(var E,k=!0,g=!0,D=0,O=null,S=0;S<_.length;++S)switch(_.charCodeAt(S)){case 13:_.charCodeAt(S+1)===10&&++S;case 10:k=!1,g=!0,D=0;break;case 9:case 32:++D;break;default:g&&!k&&(O===null||D1&&arguments[1]!==void 0?arguments[1]:"",k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,g=_.indexOf(` 11 | `)===-1,D=_[0]===" "||_[0]===" ",O=_[_.length-1]==='"',S=_[_.length-1]==="\\",I=!g||O||S||k,h="";return I&&!(g&&D)&&(h+=` 12 | `+E),h+=E?_.replace(/\n/g,` 13 | `+E):_,I&&(h+=` 14 | `),'"""'+h.replace(/"""/g,'\\"""')+'"""'}}}),Ee=K({"node_modules/graphql/language/lexer.js"(l){"use strict";L(),Object.defineProperty(l,"__esModule",{value:!0}),l.isPunctuatorTokenKind=E,l.Lexer=void 0;var T=W(),a=ee(),p=te(),r=_e(),_=function(){function t(y){var f=new a.Token(p.TokenKind.SOF,0,0,0,0,null);this.source=y,this.lastToken=f,this.token=f,this.line=1,this.lineStart=0}var s=t.prototype;return s.advance=function(){this.lastToken=this.token;var f=this.token=this.lookahead();return f},s.lookahead=function(){var f=this.token;if(f.kind!==p.TokenKind.EOF)do{var m;f=(m=f.next)!==null&&m!==void 0?m:f.next=g(this,f)}while(f.kind===p.TokenKind.COMMENT);return f},t}();l.Lexer=_;function E(t){return t===p.TokenKind.BANG||t===p.TokenKind.DOLLAR||t===p.TokenKind.AMP||t===p.TokenKind.PAREN_L||t===p.TokenKind.PAREN_R||t===p.TokenKind.SPREAD||t===p.TokenKind.COLON||t===p.TokenKind.EQUALS||t===p.TokenKind.AT||t===p.TokenKind.BRACKET_L||t===p.TokenKind.BRACKET_R||t===p.TokenKind.BRACE_L||t===p.TokenKind.PIPE||t===p.TokenKind.BRACE_R}function k(t){return isNaN(t)?p.TokenKind.EOF:t<127?JSON.stringify(String.fromCharCode(t)):'"\\u'.concat(("00"+t.toString(16).toUpperCase()).slice(-4),'"')}function g(t,s){for(var y=t.source,f=y.body,m=f.length,o=s.end;o31||d===9));return new a.Token(p.TokenKind.COMMENT,s,c,y,f,m,o.slice(s+1,c))}function S(t,s,y,f,m,o){var d=t.body,c=y,v=s,A=!1;if(c===45&&(c=d.charCodeAt(++v)),c===48){if(c=d.charCodeAt(++v),c>=48&&c<=57)throw(0,T.syntaxError)(t,v,"Invalid number, unexpected digit after 0: ".concat(k(c),"."))}else v=I(t,v,c),c=d.charCodeAt(v);if(c===46&&(A=!0,c=d.charCodeAt(++v),v=I(t,v,c),c=d.charCodeAt(v)),(c===69||c===101)&&(A=!0,c=d.charCodeAt(++v),(c===43||c===45)&&(c=d.charCodeAt(++v)),v=I(t,v,c),c=d.charCodeAt(v)),c===46||n(c))throw(0,T.syntaxError)(t,v,"Invalid number, expected digit but got: ".concat(k(c),"."));return new a.Token(A?p.TokenKind.FLOAT:p.TokenKind.INT,s,v,f,m,o,d.slice(s,v))}function I(t,s,y){var f=t.body,m=s,o=y;if(o>=48&&o<=57){do o=f.charCodeAt(++m);while(o>=48&&o<=57);return m}throw(0,T.syntaxError)(t,m,"Invalid number, expected digit but got: ".concat(k(o),"."))}function h(t,s,y,f,m){for(var o=t.body,d=s+1,c=d,v=0,A="";d=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function e(t,s,y,f,m){for(var o=t.body,d=o.length,c=s+1,v=0;c!==d&&!isNaN(v=o.charCodeAt(c))&&(v===95||v>=48&&v<=57||v>=65&&v<=90||v>=97&&v<=122);)++c;return new a.Token(p.TokenKind.NAME,s,c,y,f,m,o.slice(s,c))}function n(t){return t===95||t>=65&&t<=90||t>=97&&t<=122}}}),me=K({"node_modules/graphql/language/parser.js"(l){"use strict";L(),Object.defineProperty(l,"__esModule",{value:!0}),l.parse=g,l.parseValue=D,l.parseType=O,l.Parser=void 0;var T=W(),a=le(),p=ee(),r=te(),_=ve(),E=Te(),k=Ee();function g(N,i){var u=new S(N,i);return u.parseDocument()}function D(N,i){var u=new S(N,i);u.expectToken(r.TokenKind.SOF);var e=u.parseValueLiteral(!1);return u.expectToken(r.TokenKind.EOF),e}function O(N,i){var u=new S(N,i);u.expectToken(r.TokenKind.SOF);var e=u.parseTypeReference();return u.expectToken(r.TokenKind.EOF),e}var S=function(){function N(u,e){var n=(0,_.isSource)(u)?u:new _.Source(u);this._lexer=new k.Lexer(n),this._options=e}var i=N.prototype;return i.parseName=function(){var e=this.expectToken(r.TokenKind.NAME);return{kind:a.Kind.NAME,value:e.value,loc:this.loc(e)}},i.parseDocument=function(){var e=this._lexer.token;return{kind:a.Kind.DOCUMENT,definitions:this.many(r.TokenKind.SOF,this.parseDefinition,r.TokenKind.EOF),loc:this.loc(e)}},i.parseDefinition=function(){if(this.peek(r.TokenKind.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(r.TokenKind.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},i.parseOperationDefinition=function(){var e=this._lexer.token;if(this.peek(r.TokenKind.BRACE_L))return{kind:a.Kind.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(e)};var n=this.parseOperationType(),t;return this.peek(r.TokenKind.NAME)&&(t=this.parseName()),{kind:a.Kind.OPERATION_DEFINITION,operation:n,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},i.parseOperationType=function(){var e=this.expectToken(r.TokenKind.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},i.parseVariableDefinitions=function(){return this.optionalMany(r.TokenKind.PAREN_L,this.parseVariableDefinition,r.TokenKind.PAREN_R)},i.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:a.Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(r.TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(r.TokenKind.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},i.parseVariable=function(){var e=this._lexer.token;return this.expectToken(r.TokenKind.DOLLAR),{kind:a.Kind.VARIABLE,name:this.parseName(),loc:this.loc(e)}},i.parseSelectionSet=function(){var e=this._lexer.token;return{kind:a.Kind.SELECTION_SET,selections:this.many(r.TokenKind.BRACE_L,this.parseSelection,r.TokenKind.BRACE_R),loc:this.loc(e)}},i.parseSelection=function(){return this.peek(r.TokenKind.SPREAD)?this.parseFragment():this.parseField()},i.parseField=function(){var e=this._lexer.token,n=this.parseName(),t,s;return this.expectOptionalToken(r.TokenKind.COLON)?(t=n,s=this.parseName()):s=n,{kind:a.Kind.FIELD,alias:t,name:s,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(r.TokenKind.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(e)}},i.parseArguments=function(e){var n=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(r.TokenKind.PAREN_L,n,r.TokenKind.PAREN_R)},i.parseArgument=function(){var e=this._lexer.token,n=this.parseName();return this.expectToken(r.TokenKind.COLON),{kind:a.Kind.ARGUMENT,name:n,value:this.parseValueLiteral(!1),loc:this.loc(e)}},i.parseConstArgument=function(){var e=this._lexer.token;return{kind:a.Kind.ARGUMENT,name:this.parseName(),value:(this.expectToken(r.TokenKind.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},i.parseFragment=function(){var e=this._lexer.token;this.expectToken(r.TokenKind.SPREAD);var n=this.expectOptionalKeyword("on");return!n&&this.peek(r.TokenKind.NAME)?{kind:a.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:a.Kind.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},i.parseFragmentDefinition=function(){var e,n=this._lexer.token;return this.expectKeyword("fragment"),((e=this._options)===null||e===void 0?void 0:e.experimentalFragmentVariables)===!0?{kind:a.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}:{kind:a.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},i.parseFragmentName=function(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()},i.parseValueLiteral=function(e){var n=this._lexer.token;switch(n.kind){case r.TokenKind.BRACKET_L:return this.parseList(e);case r.TokenKind.BRACE_L:return this.parseObject(e);case r.TokenKind.INT:return this._lexer.advance(),{kind:a.Kind.INT,value:n.value,loc:this.loc(n)};case r.TokenKind.FLOAT:return this._lexer.advance(),{kind:a.Kind.FLOAT,value:n.value,loc:this.loc(n)};case r.TokenKind.STRING:case r.TokenKind.BLOCK_STRING:return this.parseStringLiteral();case r.TokenKind.NAME:switch(this._lexer.advance(),n.value){case"true":return{kind:a.Kind.BOOLEAN,value:!0,loc:this.loc(n)};case"false":return{kind:a.Kind.BOOLEAN,value:!1,loc:this.loc(n)};case"null":return{kind:a.Kind.NULL,loc:this.loc(n)};default:return{kind:a.Kind.ENUM,value:n.value,loc:this.loc(n)}}case r.TokenKind.DOLLAR:if(!e)return this.parseVariable();break}throw this.unexpected()},i.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:a.Kind.STRING,value:e.value,block:e.kind===r.TokenKind.BLOCK_STRING,loc:this.loc(e)}},i.parseList=function(e){var n=this,t=this._lexer.token,s=function(){return n.parseValueLiteral(e)};return{kind:a.Kind.LIST,values:this.any(r.TokenKind.BRACKET_L,s,r.TokenKind.BRACKET_R),loc:this.loc(t)}},i.parseObject=function(e){var n=this,t=this._lexer.token,s=function(){return n.parseObjectField(e)};return{kind:a.Kind.OBJECT,fields:this.any(r.TokenKind.BRACE_L,s,r.TokenKind.BRACE_R),loc:this.loc(t)}},i.parseObjectField=function(e){var n=this._lexer.token,t=this.parseName();return this.expectToken(r.TokenKind.COLON),{kind:a.Kind.OBJECT_FIELD,name:t,value:this.parseValueLiteral(e),loc:this.loc(n)}},i.parseDirectives=function(e){for(var n=[];this.peek(r.TokenKind.AT);)n.push(this.parseDirective(e));return n},i.parseDirective=function(e){var n=this._lexer.token;return this.expectToken(r.TokenKind.AT),{kind:a.Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(n)}},i.parseTypeReference=function(){var e=this._lexer.token,n;return this.expectOptionalToken(r.TokenKind.BRACKET_L)?(n=this.parseTypeReference(),this.expectToken(r.TokenKind.BRACKET_R),n={kind:a.Kind.LIST_TYPE,type:n,loc:this.loc(e)}):n=this.parseNamedType(),this.expectOptionalToken(r.TokenKind.BANG)?{kind:a.Kind.NON_NULL_TYPE,type:n,loc:this.loc(e)}:n},i.parseNamedType=function(){var e=this._lexer.token;return{kind:a.Kind.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},i.parseTypeSystemDefinition=function(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===r.TokenKind.NAME)switch(e.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(e)},i.peekDescription=function(){return this.peek(r.TokenKind.STRING)||this.peek(r.TokenKind.BLOCK_STRING)},i.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},i.parseSchemaDefinition=function(){var e=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");var t=this.parseDirectives(!0),s=this.many(r.TokenKind.BRACE_L,this.parseOperationTypeDefinition,r.TokenKind.BRACE_R);return{kind:a.Kind.SCHEMA_DEFINITION,description:n,directives:t,operationTypes:s,loc:this.loc(e)}},i.parseOperationTypeDefinition=function(){var e=this._lexer.token,n=this.parseOperationType();this.expectToken(r.TokenKind.COLON);var t=this.parseNamedType();return{kind:a.Kind.OPERATION_TYPE_DEFINITION,operation:n,type:t,loc:this.loc(e)}},i.parseScalarTypeDefinition=function(){var e=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");var t=this.parseName(),s=this.parseDirectives(!0);return{kind:a.Kind.SCALAR_TYPE_DEFINITION,description:n,name:t,directives:s,loc:this.loc(e)}},i.parseObjectTypeDefinition=function(){var e=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");var t=this.parseName(),s=this.parseImplementsInterfaces(),y=this.parseDirectives(!0),f=this.parseFieldsDefinition();return{kind:a.Kind.OBJECT_TYPE_DEFINITION,description:n,name:t,interfaces:s,directives:y,fields:f,loc:this.loc(e)}},i.parseImplementsInterfaces=function(){var e;if(!this.expectOptionalKeyword("implements"))return[];if(((e=this._options)===null||e===void 0?void 0:e.allowLegacySDLImplementsInterfaces)===!0){var n=[];this.expectOptionalToken(r.TokenKind.AMP);do n.push(this.parseNamedType());while(this.expectOptionalToken(r.TokenKind.AMP)||this.peek(r.TokenKind.NAME));return n}return this.delimitedMany(r.TokenKind.AMP,this.parseNamedType)},i.parseFieldsDefinition=function(){var e;return((e=this._options)===null||e===void 0?void 0:e.allowLegacySDLEmptyFields)===!0&&this.peek(r.TokenKind.BRACE_L)&&this._lexer.lookahead().kind===r.TokenKind.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(r.TokenKind.BRACE_L,this.parseFieldDefinition,r.TokenKind.BRACE_R)},i.parseFieldDefinition=function(){var e=this._lexer.token,n=this.parseDescription(),t=this.parseName(),s=this.parseArgumentDefs();this.expectToken(r.TokenKind.COLON);var y=this.parseTypeReference(),f=this.parseDirectives(!0);return{kind:a.Kind.FIELD_DEFINITION,description:n,name:t,arguments:s,type:y,directives:f,loc:this.loc(e)}},i.parseArgumentDefs=function(){return this.optionalMany(r.TokenKind.PAREN_L,this.parseInputValueDef,r.TokenKind.PAREN_R)},i.parseInputValueDef=function(){var e=this._lexer.token,n=this.parseDescription(),t=this.parseName();this.expectToken(r.TokenKind.COLON);var s=this.parseTypeReference(),y;this.expectOptionalToken(r.TokenKind.EQUALS)&&(y=this.parseValueLiteral(!0));var f=this.parseDirectives(!0);return{kind:a.Kind.INPUT_VALUE_DEFINITION,description:n,name:t,type:s,defaultValue:y,directives:f,loc:this.loc(e)}},i.parseInterfaceTypeDefinition=function(){var e=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");var t=this.parseName(),s=this.parseImplementsInterfaces(),y=this.parseDirectives(!0),f=this.parseFieldsDefinition();return{kind:a.Kind.INTERFACE_TYPE_DEFINITION,description:n,name:t,interfaces:s,directives:y,fields:f,loc:this.loc(e)}},i.parseUnionTypeDefinition=function(){var e=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");var t=this.parseName(),s=this.parseDirectives(!0),y=this.parseUnionMemberTypes();return{kind:a.Kind.UNION_TYPE_DEFINITION,description:n,name:t,directives:s,types:y,loc:this.loc(e)}},i.parseUnionMemberTypes=function(){return this.expectOptionalToken(r.TokenKind.EQUALS)?this.delimitedMany(r.TokenKind.PIPE,this.parseNamedType):[]},i.parseEnumTypeDefinition=function(){var e=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");var t=this.parseName(),s=this.parseDirectives(!0),y=this.parseEnumValuesDefinition();return{kind:a.Kind.ENUM_TYPE_DEFINITION,description:n,name:t,directives:s,values:y,loc:this.loc(e)}},i.parseEnumValuesDefinition=function(){return this.optionalMany(r.TokenKind.BRACE_L,this.parseEnumValueDefinition,r.TokenKind.BRACE_R)},i.parseEnumValueDefinition=function(){var e=this._lexer.token,n=this.parseDescription(),t=this.parseName(),s=this.parseDirectives(!0);return{kind:a.Kind.ENUM_VALUE_DEFINITION,description:n,name:t,directives:s,loc:this.loc(e)}},i.parseInputObjectTypeDefinition=function(){var e=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");var t=this.parseName(),s=this.parseDirectives(!0),y=this.parseInputFieldsDefinition();return{kind:a.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:t,directives:s,fields:y,loc:this.loc(e)}},i.parseInputFieldsDefinition=function(){return this.optionalMany(r.TokenKind.BRACE_L,this.parseInputValueDef,r.TokenKind.BRACE_R)},i.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===r.TokenKind.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)},i.parseSchemaExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var n=this.parseDirectives(!0),t=this.optionalMany(r.TokenKind.BRACE_L,this.parseOperationTypeDefinition,r.TokenKind.BRACE_R);if(n.length===0&&t.length===0)throw this.unexpected();return{kind:a.Kind.SCHEMA_EXTENSION,directives:n,operationTypes:t,loc:this.loc(e)}},i.parseScalarTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var n=this.parseName(),t=this.parseDirectives(!0);if(t.length===0)throw this.unexpected();return{kind:a.Kind.SCALAR_TYPE_EXTENSION,name:n,directives:t,loc:this.loc(e)}},i.parseObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var n=this.parseName(),t=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),y=this.parseFieldsDefinition();if(t.length===0&&s.length===0&&y.length===0)throw this.unexpected();return{kind:a.Kind.OBJECT_TYPE_EXTENSION,name:n,interfaces:t,directives:s,fields:y,loc:this.loc(e)}},i.parseInterfaceTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var n=this.parseName(),t=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),y=this.parseFieldsDefinition();if(t.length===0&&s.length===0&&y.length===0)throw this.unexpected();return{kind:a.Kind.INTERFACE_TYPE_EXTENSION,name:n,interfaces:t,directives:s,fields:y,loc:this.loc(e)}},i.parseUnionTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var n=this.parseName(),t=this.parseDirectives(!0),s=this.parseUnionMemberTypes();if(t.length===0&&s.length===0)throw this.unexpected();return{kind:a.Kind.UNION_TYPE_EXTENSION,name:n,directives:t,types:s,loc:this.loc(e)}},i.parseEnumTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var n=this.parseName(),t=this.parseDirectives(!0),s=this.parseEnumValuesDefinition();if(t.length===0&&s.length===0)throw this.unexpected();return{kind:a.Kind.ENUM_TYPE_EXTENSION,name:n,directives:t,values:s,loc:this.loc(e)}},i.parseInputObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var n=this.parseName(),t=this.parseDirectives(!0),s=this.parseInputFieldsDefinition();if(t.length===0&&s.length===0)throw this.unexpected();return{kind:a.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:t,fields:s,loc:this.loc(e)}},i.parseDirectiveDefinition=function(){var e=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(r.TokenKind.AT);var t=this.parseName(),s=this.parseArgumentDefs(),y=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var f=this.parseDirectiveLocations();return{kind:a.Kind.DIRECTIVE_DEFINITION,description:n,name:t,arguments:s,repeatable:y,locations:f,loc:this.loc(e)}},i.parseDirectiveLocations=function(){return this.delimitedMany(r.TokenKind.PIPE,this.parseDirectiveLocation)},i.parseDirectiveLocation=function(){var e=this._lexer.token,n=this.parseName();if(E.DirectiveLocation[n.value]!==void 0)return n;throw this.unexpected(e)},i.loc=function(e){var n;if(((n=this._options)===null||n===void 0?void 0:n.noLocation)!==!0)return new p.Location(e,this._lexer.lastToken,this._lexer.source)},i.peek=function(e){return this._lexer.token.kind===e},i.expectToken=function(e){var n=this._lexer.token;if(n.kind===e)return this._lexer.advance(),n;throw(0,T.syntaxError)(this._lexer.source,n.start,"Expected ".concat(h(e),", found ").concat(I(n),"."))},i.expectOptionalToken=function(e){var n=this._lexer.token;if(n.kind===e)return this._lexer.advance(),n},i.expectKeyword=function(e){var n=this._lexer.token;if(n.kind===r.TokenKind.NAME&&n.value===e)this._lexer.advance();else throw(0,T.syntaxError)(this._lexer.source,n.start,'Expected "'.concat(e,'", found ').concat(I(n),"."))},i.expectOptionalKeyword=function(e){var n=this._lexer.token;return n.kind===r.TokenKind.NAME&&n.value===e?(this._lexer.advance(),!0):!1},i.unexpected=function(e){var n=e!=null?e:this._lexer.token;return(0,T.syntaxError)(this._lexer.source,n.start,"Unexpected ".concat(I(n),"."))},i.any=function(e,n,t){this.expectToken(e);for(var s=[];!this.expectOptionalToken(t);)s.push(n.call(this));return s},i.optionalMany=function(e,n,t){if(this.expectOptionalToken(e)){var s=[];do s.push(n.call(this));while(!this.expectOptionalToken(t));return s}return[]},i.many=function(e,n,t){this.expectToken(e);var s=[];do s.push(n.call(this));while(!this.expectOptionalToken(t));return s},i.delimitedMany=function(e,n){this.expectOptionalToken(e);var t=[];do t.push(n.call(this));while(this.expectOptionalToken(e));return t},N}();l.Parser=S;function I(N){var i=N.value;return h(N.kind)+(i!=null?' "'.concat(i,'"'):"")}function h(N){return(0,k.isPunctuatorTokenKind)(N)?'"'.concat(N,'"'):N}}}),ye=K({"src/language-graphql/parser-graphql.js"(l,T){L();var a=ie(),p=ae(),{hasPragma:r}=oe(),{locStart:_,locEnd:E}=se();function k(I){let h=[],{startToken:N}=I.loc,{next:i}=N;for(;i.kind!=="";)i.kind==="Comment"&&(Object.assign(i,{column:i.column-1}),h.push(i)),i=i.next;return h}function g(I){if(I&&typeof I=="object"){delete I.startToken,delete I.endToken,delete I.prev,delete I.next;for(let h in I)g(I[h])}return I}var D={allowLegacySDLImplementsInterfaces:!1,experimentalFragmentVariables:!0};function O(I){let{GraphQLError:h}=$();if(I instanceof h){let{message:N,locations:[i]}=I;return a(N,{start:i})}return I}function S(I){let{parse:h}=me(),{result:N,error:i}=p(()=>h(I,Object.assign({},D)),()=>h(I,Object.assign(Object.assign({},D),{},{allowLegacySDLImplementsInterfaces:!0})));if(!N)throw O(i);return N.comments=k(N),g(N),N}T.exports={parsers:{graphql:{parse:S,astFormat:"graphql",hasPragma:r,locStart:_,locEnd:E}}}}}),ke=ye();export{ke as default}; 16 | -------------------------------------------------------------------------------- /lua/bexx/node_modules/prettier/parser-graphql.js: -------------------------------------------------------------------------------- 1 | (function(e){if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var i=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};i.prettierPlugins=i.prettierPlugins||{},i.prettierPlugins.graphql=e()}})(function(){"use strict";var oe=(a,d)=>()=>(d||a((d={exports:{}}).exports,d),d.exports);var be=oe((Ce,ae)=>{var H=Object.getOwnPropertyNames,se=(a,d)=>function(){return a&&(d=(0,a[H(a)[0]])(a=0)),d},L=(a,d)=>function(){return d||(0,a[H(a)[0]])((d={exports:{}}).exports,d),d.exports},K=se({""(){}}),ce=L({"src/common/parser-create-error.js"(a,d){"use strict";K();function i(c,r){let _=new SyntaxError(c+" ("+r.start.line+":"+r.start.column+")");return _.loc=r,_}d.exports=i}}),ue=L({"src/utils/try-combinations.js"(a,d){"use strict";K();function i(){let c;for(var r=arguments.length,_=new Array(r),E=0;E120){for(var t=Math.floor(s/80),u=s%80,y=[],f=0;f"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function e(f){return Function.toString.call(f).indexOf("[native code]")!==-1}function n(f,m){return n=Object.setPrototypeOf||function(h,l){return h.__proto__=l,h},n(f,m)}function t(f){return t=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},t(f)}var u=function(f){N(o,f);var m=g(o);function o(h,l,T,S,x,b,M){var U,V,q,G,C;k(this,o),C=m.call(this,h);var R=Array.isArray(l)?l.length!==0?l:void 0:l?[l]:void 0,Y=T;if(!Y&&R){var J;Y=(J=R[0].loc)===null||J===void 0?void 0:J.source}var F=S;!F&&R&&(F=R.reduce(function(w,P){return P.loc&&w.push(P.loc.start),w},[])),F&&F.length===0&&(F=void 0);var B;S&&T?B=S.map(function(w){return(0,r.getLocation)(T,w)}):R&&(B=R.reduce(function(w,P){return P.loc&&w.push((0,r.getLocation)(P.loc.source,P.loc.start)),w},[]));var j=M;if(j==null&&b!=null){var Q=b.extensions;(0,i.default)(Q)&&(j=Q)}return Object.defineProperties(v(C),{name:{value:"GraphQLError"},message:{value:h,enumerable:!0,writable:!0},locations:{value:(U=B)!==null&&U!==void 0?U:void 0,enumerable:B!=null},path:{value:x!=null?x:void 0,enumerable:x!=null},nodes:{value:R!=null?R:void 0},source:{value:(V=Y)!==null&&V!==void 0?V:void 0},positions:{value:(q=F)!==null&&q!==void 0?q:void 0},originalError:{value:b},extensions:{value:(G=j)!==null&&G!==void 0?G:void 0,enumerable:j!=null}}),b!=null&&b.stack?(Object.defineProperty(v(C),"stack",{value:b.stack,writable:!0,configurable:!0}),D(C)):(Error.captureStackTrace?Error.captureStackTrace(v(C),o):Object.defineProperty(v(C),"stack",{value:Error().stack,writable:!0,configurable:!0}),C)}return A(o,[{key:"toString",value:function(){return y(this)}},{key:c.SYMBOL_TO_STRING_TAG,get:function(){return"Object"}}]),o}(I(Error));a.GraphQLError=u;function y(f){var m=f.message;if(f.nodes)for(var o=0,h=f.nodes;o",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"});a.TokenKind=d}}),re=L({"node_modules/graphql/jsutils/inspect.js"(a){"use strict";K(),Object.defineProperty(a,"__esModule",{value:!0}),a.default=E;var d=i(ee());function i(v){return v&&v.__esModule?v:{default:v}}function c(v){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?c=function(s){return typeof s}:c=function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},c(v)}var r=10,_=2;function E(v){return k(v,[])}function k(v,I){switch(c(v)){case"string":return JSON.stringify(v);case"function":return v.name?"[function ".concat(v.name,"]"):"[function]";case"object":return v===null?"null":O(v,I);default:return String(v)}}function O(v,I){if(I.indexOf(v)!==-1)return"[Circular]";var s=[].concat(I,[v]),p=g(v);if(p!==void 0){var e=p.call(v);if(e!==v)return typeof e=="string"?e:k(e,s)}else if(Array.isArray(v))return N(v,s);return A(v,s)}function A(v,I){var s=Object.keys(v);if(s.length===0)return"{}";if(I.length>_)return"["+D(v)+"]";var p=s.map(function(e){var n=k(v[e],I);return e+": "+n});return"{ "+p.join(", ")+" }"}function N(v,I){if(v.length===0)return"[]";if(I.length>_)return"[Array]";for(var s=Math.min(r,v.length),p=v.length-s,e=[],n=0;n1&&e.push("... ".concat(p," more items")),"["+e.join(", ")+"]"}function g(v){var I=v[String(d.default)];if(typeof I=="function")return I;if(typeof v.inspect=="function")return v.inspect}function D(v){var I=Object.prototype.toString.call(v).replace(/^\[object /,"").replace(/]$/,"");if(I==="Object"&&typeof v.constructor=="function"){var s=v.constructor.name;if(typeof s=="string"&&s!=="")return s}return I}}}),_e=L({"node_modules/graphql/jsutils/devAssert.js"(a){"use strict";K(),Object.defineProperty(a,"__esModule",{value:!0}),a.default=d;function d(i,c){var r=Boolean(i);if(!r)throw new Error(c)}}}),Ee=L({"node_modules/graphql/jsutils/instanceOf.js"(a){"use strict";K(),Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var d=i(re());function i(r){return r&&r.__esModule?r:{default:r}}var c=function(_,E){return _ instanceof E};a.default=c}}),me=L({"node_modules/graphql/language/source.js"(a){"use strict";K(),Object.defineProperty(a,"__esModule",{value:!0}),a.isSource=A,a.Source=void 0;var d=z(),i=_(re()),c=_(_e()),r=_(Ee());function _(N){return N&&N.__esModule?N:{default:N}}function E(N,g){for(var D=0;D1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof g=="string"||(0,c.default)(0,"Body must be a string. Received: ".concat((0,i.default)(g),".")),this.body=g,this.name=D,this.locationOffset=v,this.locationOffset.line>0||(0,c.default)(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,c.default)(0,"column in locationOffset is 1-indexed and must be positive.")}return k(N,[{key:d.SYMBOL_TO_STRING_TAG,get:function(){return"Source"}}]),N}();a.Source=O;function A(N){return(0,r.default)(N,O)}}}),ye=L({"node_modules/graphql/language/directiveLocation.js"(a){"use strict";K(),Object.defineProperty(a,"__esModule",{value:!0}),a.DirectiveLocation=void 0;var d=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});a.DirectiveLocation=d}}),ke=L({"node_modules/graphql/language/blockString.js"(a){"use strict";K(),Object.defineProperty(a,"__esModule",{value:!0}),a.dedentBlockStringValue=d,a.getBlockStringIndentation=c,a.printBlockString=r;function d(_){var E=_.split(/\r\n|[\n\r]/g),k=c(_);if(k!==0)for(var O=1;OA&&i(E[N-1]);)--N;return E.slice(A,N).join(` 10 | `)}function i(_){for(var E=0;E<_.length;++E)if(_[E]!==" "&&_[E]!==" ")return!1;return!0}function c(_){for(var E,k=!0,O=!0,A=0,N=null,g=0;g<_.length;++g)switch(_.charCodeAt(g)){case 13:_.charCodeAt(g+1)===10&&++g;case 10:k=!1,O=!0,A=0;break;case 9:case 32:++A;break;default:O&&!k&&(N===null||A1&&arguments[1]!==void 0?arguments[1]:"",k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,O=_.indexOf(` 11 | `)===-1,A=_[0]===" "||_[0]===" ",N=_[_.length-1]==='"',g=_[_.length-1]==="\\",D=!O||N||g||k,v="";return D&&!(O&&A)&&(v+=` 12 | `+E),v+=E?_.replace(/\n/g,` 13 | `+E):_,D&&(v+=` 14 | `),'"""'+v.replace(/"""/g,'\\"""')+'"""'}}}),Ne=L({"node_modules/graphql/language/lexer.js"(a){"use strict";K(),Object.defineProperty(a,"__esModule",{value:!0}),a.isPunctuatorTokenKind=E,a.Lexer=void 0;var d=Z(),i=te(),c=ne(),r=ke(),_=function(){function t(y){var f=new i.Token(c.TokenKind.SOF,0,0,0,0,null);this.source=y,this.lastToken=f,this.token=f,this.line=1,this.lineStart=0}var u=t.prototype;return u.advance=function(){this.lastToken=this.token;var f=this.token=this.lookahead();return f},u.lookahead=function(){var f=this.token;if(f.kind!==c.TokenKind.EOF)do{var m;f=(m=f.next)!==null&&m!==void 0?m:f.next=O(this,f)}while(f.kind===c.TokenKind.COMMENT);return f},t}();a.Lexer=_;function E(t){return t===c.TokenKind.BANG||t===c.TokenKind.DOLLAR||t===c.TokenKind.AMP||t===c.TokenKind.PAREN_L||t===c.TokenKind.PAREN_R||t===c.TokenKind.SPREAD||t===c.TokenKind.COLON||t===c.TokenKind.EQUALS||t===c.TokenKind.AT||t===c.TokenKind.BRACKET_L||t===c.TokenKind.BRACKET_R||t===c.TokenKind.BRACE_L||t===c.TokenKind.PIPE||t===c.TokenKind.BRACE_R}function k(t){return isNaN(t)?c.TokenKind.EOF:t<127?JSON.stringify(String.fromCharCode(t)):'"\\u'.concat(("00"+t.toString(16).toUpperCase()).slice(-4),'"')}function O(t,u){for(var y=t.source,f=y.body,m=f.length,o=u.end;o31||h===9));return new i.Token(c.TokenKind.COMMENT,u,l,y,f,m,o.slice(u+1,l))}function g(t,u,y,f,m,o){var h=t.body,l=y,T=u,S=!1;if(l===45&&(l=h.charCodeAt(++T)),l===48){if(l=h.charCodeAt(++T),l>=48&&l<=57)throw(0,d.syntaxError)(t,T,"Invalid number, unexpected digit after 0: ".concat(k(l),"."))}else T=D(t,T,l),l=h.charCodeAt(T);if(l===46&&(S=!0,l=h.charCodeAt(++T),T=D(t,T,l),l=h.charCodeAt(T)),(l===69||l===101)&&(S=!0,l=h.charCodeAt(++T),(l===43||l===45)&&(l=h.charCodeAt(++T)),T=D(t,T,l),l=h.charCodeAt(T)),l===46||n(l))throw(0,d.syntaxError)(t,T,"Invalid number, expected digit but got: ".concat(k(l),"."));return new i.Token(S?c.TokenKind.FLOAT:c.TokenKind.INT,u,T,f,m,o,h.slice(u,T))}function D(t,u,y){var f=t.body,m=u,o=y;if(o>=48&&o<=57){do o=f.charCodeAt(++m);while(o>=48&&o<=57);return m}throw(0,d.syntaxError)(t,m,"Invalid number, expected digit but got: ".concat(k(o),"."))}function v(t,u,y,f,m){for(var o=t.body,h=u+1,l=h,T=0,S="";h=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function e(t,u,y,f,m){for(var o=t.body,h=o.length,l=u+1,T=0;l!==h&&!isNaN(T=o.charCodeAt(l))&&(T===95||T>=48&&T<=57||T>=65&&T<=90||T>=97&&T<=122);)++l;return new i.Token(c.TokenKind.NAME,u,l,y,f,m,o.slice(u,l))}function n(t){return t===95||t>=65&&t<=90||t>=97&&t<=122}}}),Oe=L({"node_modules/graphql/language/parser.js"(a){"use strict";K(),Object.defineProperty(a,"__esModule",{value:!0}),a.parse=O,a.parseValue=A,a.parseType=N,a.Parser=void 0;var d=Z(),i=he(),c=te(),r=ne(),_=me(),E=ye(),k=Ne();function O(I,s){var p=new g(I,s);return p.parseDocument()}function A(I,s){var p=new g(I,s);p.expectToken(r.TokenKind.SOF);var e=p.parseValueLiteral(!1);return p.expectToken(r.TokenKind.EOF),e}function N(I,s){var p=new g(I,s);p.expectToken(r.TokenKind.SOF);var e=p.parseTypeReference();return p.expectToken(r.TokenKind.EOF),e}var g=function(){function I(p,e){var n=(0,_.isSource)(p)?p:new _.Source(p);this._lexer=new k.Lexer(n),this._options=e}var s=I.prototype;return s.parseName=function(){var e=this.expectToken(r.TokenKind.NAME);return{kind:i.Kind.NAME,value:e.value,loc:this.loc(e)}},s.parseDocument=function(){var e=this._lexer.token;return{kind:i.Kind.DOCUMENT,definitions:this.many(r.TokenKind.SOF,this.parseDefinition,r.TokenKind.EOF),loc:this.loc(e)}},s.parseDefinition=function(){if(this.peek(r.TokenKind.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(r.TokenKind.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},s.parseOperationDefinition=function(){var e=this._lexer.token;if(this.peek(r.TokenKind.BRACE_L))return{kind:i.Kind.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(e)};var n=this.parseOperationType(),t;return this.peek(r.TokenKind.NAME)&&(t=this.parseName()),{kind:i.Kind.OPERATION_DEFINITION,operation:n,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},s.parseOperationType=function(){var e=this.expectToken(r.TokenKind.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},s.parseVariableDefinitions=function(){return this.optionalMany(r.TokenKind.PAREN_L,this.parseVariableDefinition,r.TokenKind.PAREN_R)},s.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:i.Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(r.TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(r.TokenKind.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},s.parseVariable=function(){var e=this._lexer.token;return this.expectToken(r.TokenKind.DOLLAR),{kind:i.Kind.VARIABLE,name:this.parseName(),loc:this.loc(e)}},s.parseSelectionSet=function(){var e=this._lexer.token;return{kind:i.Kind.SELECTION_SET,selections:this.many(r.TokenKind.BRACE_L,this.parseSelection,r.TokenKind.BRACE_R),loc:this.loc(e)}},s.parseSelection=function(){return this.peek(r.TokenKind.SPREAD)?this.parseFragment():this.parseField()},s.parseField=function(){var e=this._lexer.token,n=this.parseName(),t,u;return this.expectOptionalToken(r.TokenKind.COLON)?(t=n,u=this.parseName()):u=n,{kind:i.Kind.FIELD,alias:t,name:u,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(r.TokenKind.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(e)}},s.parseArguments=function(e){var n=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(r.TokenKind.PAREN_L,n,r.TokenKind.PAREN_R)},s.parseArgument=function(){var e=this._lexer.token,n=this.parseName();return this.expectToken(r.TokenKind.COLON),{kind:i.Kind.ARGUMENT,name:n,value:this.parseValueLiteral(!1),loc:this.loc(e)}},s.parseConstArgument=function(){var e=this._lexer.token;return{kind:i.Kind.ARGUMENT,name:this.parseName(),value:(this.expectToken(r.TokenKind.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},s.parseFragment=function(){var e=this._lexer.token;this.expectToken(r.TokenKind.SPREAD);var n=this.expectOptionalKeyword("on");return!n&&this.peek(r.TokenKind.NAME)?{kind:i.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:i.Kind.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},s.parseFragmentDefinition=function(){var e,n=this._lexer.token;return this.expectKeyword("fragment"),((e=this._options)===null||e===void 0?void 0:e.experimentalFragmentVariables)===!0?{kind:i.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}:{kind:i.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},s.parseFragmentName=function(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()},s.parseValueLiteral=function(e){var n=this._lexer.token;switch(n.kind){case r.TokenKind.BRACKET_L:return this.parseList(e);case r.TokenKind.BRACE_L:return this.parseObject(e);case r.TokenKind.INT:return this._lexer.advance(),{kind:i.Kind.INT,value:n.value,loc:this.loc(n)};case r.TokenKind.FLOAT:return this._lexer.advance(),{kind:i.Kind.FLOAT,value:n.value,loc:this.loc(n)};case r.TokenKind.STRING:case r.TokenKind.BLOCK_STRING:return this.parseStringLiteral();case r.TokenKind.NAME:switch(this._lexer.advance(),n.value){case"true":return{kind:i.Kind.BOOLEAN,value:!0,loc:this.loc(n)};case"false":return{kind:i.Kind.BOOLEAN,value:!1,loc:this.loc(n)};case"null":return{kind:i.Kind.NULL,loc:this.loc(n)};default:return{kind:i.Kind.ENUM,value:n.value,loc:this.loc(n)}}case r.TokenKind.DOLLAR:if(!e)return this.parseVariable();break}throw this.unexpected()},s.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:i.Kind.STRING,value:e.value,block:e.kind===r.TokenKind.BLOCK_STRING,loc:this.loc(e)}},s.parseList=function(e){var n=this,t=this._lexer.token,u=function(){return n.parseValueLiteral(e)};return{kind:i.Kind.LIST,values:this.any(r.TokenKind.BRACKET_L,u,r.TokenKind.BRACKET_R),loc:this.loc(t)}},s.parseObject=function(e){var n=this,t=this._lexer.token,u=function(){return n.parseObjectField(e)};return{kind:i.Kind.OBJECT,fields:this.any(r.TokenKind.BRACE_L,u,r.TokenKind.BRACE_R),loc:this.loc(t)}},s.parseObjectField=function(e){var n=this._lexer.token,t=this.parseName();return this.expectToken(r.TokenKind.COLON),{kind:i.Kind.OBJECT_FIELD,name:t,value:this.parseValueLiteral(e),loc:this.loc(n)}},s.parseDirectives=function(e){for(var n=[];this.peek(r.TokenKind.AT);)n.push(this.parseDirective(e));return n},s.parseDirective=function(e){var n=this._lexer.token;return this.expectToken(r.TokenKind.AT),{kind:i.Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(n)}},s.parseTypeReference=function(){var e=this._lexer.token,n;return this.expectOptionalToken(r.TokenKind.BRACKET_L)?(n=this.parseTypeReference(),this.expectToken(r.TokenKind.BRACKET_R),n={kind:i.Kind.LIST_TYPE,type:n,loc:this.loc(e)}):n=this.parseNamedType(),this.expectOptionalToken(r.TokenKind.BANG)?{kind:i.Kind.NON_NULL_TYPE,type:n,loc:this.loc(e)}:n},s.parseNamedType=function(){var e=this._lexer.token;return{kind:i.Kind.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},s.parseTypeSystemDefinition=function(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===r.TokenKind.NAME)switch(e.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(e)},s.peekDescription=function(){return this.peek(r.TokenKind.STRING)||this.peek(r.TokenKind.BLOCK_STRING)},s.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},s.parseSchemaDefinition=function(){var e=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");var t=this.parseDirectives(!0),u=this.many(r.TokenKind.BRACE_L,this.parseOperationTypeDefinition,r.TokenKind.BRACE_R);return{kind:i.Kind.SCHEMA_DEFINITION,description:n,directives:t,operationTypes:u,loc:this.loc(e)}},s.parseOperationTypeDefinition=function(){var e=this._lexer.token,n=this.parseOperationType();this.expectToken(r.TokenKind.COLON);var t=this.parseNamedType();return{kind:i.Kind.OPERATION_TYPE_DEFINITION,operation:n,type:t,loc:this.loc(e)}},s.parseScalarTypeDefinition=function(){var e=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");var t=this.parseName(),u=this.parseDirectives(!0);return{kind:i.Kind.SCALAR_TYPE_DEFINITION,description:n,name:t,directives:u,loc:this.loc(e)}},s.parseObjectTypeDefinition=function(){var e=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");var t=this.parseName(),u=this.parseImplementsInterfaces(),y=this.parseDirectives(!0),f=this.parseFieldsDefinition();return{kind:i.Kind.OBJECT_TYPE_DEFINITION,description:n,name:t,interfaces:u,directives:y,fields:f,loc:this.loc(e)}},s.parseImplementsInterfaces=function(){var e;if(!this.expectOptionalKeyword("implements"))return[];if(((e=this._options)===null||e===void 0?void 0:e.allowLegacySDLImplementsInterfaces)===!0){var n=[];this.expectOptionalToken(r.TokenKind.AMP);do n.push(this.parseNamedType());while(this.expectOptionalToken(r.TokenKind.AMP)||this.peek(r.TokenKind.NAME));return n}return this.delimitedMany(r.TokenKind.AMP,this.parseNamedType)},s.parseFieldsDefinition=function(){var e;return((e=this._options)===null||e===void 0?void 0:e.allowLegacySDLEmptyFields)===!0&&this.peek(r.TokenKind.BRACE_L)&&this._lexer.lookahead().kind===r.TokenKind.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(r.TokenKind.BRACE_L,this.parseFieldDefinition,r.TokenKind.BRACE_R)},s.parseFieldDefinition=function(){var e=this._lexer.token,n=this.parseDescription(),t=this.parseName(),u=this.parseArgumentDefs();this.expectToken(r.TokenKind.COLON);var y=this.parseTypeReference(),f=this.parseDirectives(!0);return{kind:i.Kind.FIELD_DEFINITION,description:n,name:t,arguments:u,type:y,directives:f,loc:this.loc(e)}},s.parseArgumentDefs=function(){return this.optionalMany(r.TokenKind.PAREN_L,this.parseInputValueDef,r.TokenKind.PAREN_R)},s.parseInputValueDef=function(){var e=this._lexer.token,n=this.parseDescription(),t=this.parseName();this.expectToken(r.TokenKind.COLON);var u=this.parseTypeReference(),y;this.expectOptionalToken(r.TokenKind.EQUALS)&&(y=this.parseValueLiteral(!0));var f=this.parseDirectives(!0);return{kind:i.Kind.INPUT_VALUE_DEFINITION,description:n,name:t,type:u,defaultValue:y,directives:f,loc:this.loc(e)}},s.parseInterfaceTypeDefinition=function(){var e=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");var t=this.parseName(),u=this.parseImplementsInterfaces(),y=this.parseDirectives(!0),f=this.parseFieldsDefinition();return{kind:i.Kind.INTERFACE_TYPE_DEFINITION,description:n,name:t,interfaces:u,directives:y,fields:f,loc:this.loc(e)}},s.parseUnionTypeDefinition=function(){var e=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");var t=this.parseName(),u=this.parseDirectives(!0),y=this.parseUnionMemberTypes();return{kind:i.Kind.UNION_TYPE_DEFINITION,description:n,name:t,directives:u,types:y,loc:this.loc(e)}},s.parseUnionMemberTypes=function(){return this.expectOptionalToken(r.TokenKind.EQUALS)?this.delimitedMany(r.TokenKind.PIPE,this.parseNamedType):[]},s.parseEnumTypeDefinition=function(){var e=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");var t=this.parseName(),u=this.parseDirectives(!0),y=this.parseEnumValuesDefinition();return{kind:i.Kind.ENUM_TYPE_DEFINITION,description:n,name:t,directives:u,values:y,loc:this.loc(e)}},s.parseEnumValuesDefinition=function(){return this.optionalMany(r.TokenKind.BRACE_L,this.parseEnumValueDefinition,r.TokenKind.BRACE_R)},s.parseEnumValueDefinition=function(){var e=this._lexer.token,n=this.parseDescription(),t=this.parseName(),u=this.parseDirectives(!0);return{kind:i.Kind.ENUM_VALUE_DEFINITION,description:n,name:t,directives:u,loc:this.loc(e)}},s.parseInputObjectTypeDefinition=function(){var e=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");var t=this.parseName(),u=this.parseDirectives(!0),y=this.parseInputFieldsDefinition();return{kind:i.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:t,directives:u,fields:y,loc:this.loc(e)}},s.parseInputFieldsDefinition=function(){return this.optionalMany(r.TokenKind.BRACE_L,this.parseInputValueDef,r.TokenKind.BRACE_R)},s.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===r.TokenKind.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)},s.parseSchemaExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var n=this.parseDirectives(!0),t=this.optionalMany(r.TokenKind.BRACE_L,this.parseOperationTypeDefinition,r.TokenKind.BRACE_R);if(n.length===0&&t.length===0)throw this.unexpected();return{kind:i.Kind.SCHEMA_EXTENSION,directives:n,operationTypes:t,loc:this.loc(e)}},s.parseScalarTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var n=this.parseName(),t=this.parseDirectives(!0);if(t.length===0)throw this.unexpected();return{kind:i.Kind.SCALAR_TYPE_EXTENSION,name:n,directives:t,loc:this.loc(e)}},s.parseObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var n=this.parseName(),t=this.parseImplementsInterfaces(),u=this.parseDirectives(!0),y=this.parseFieldsDefinition();if(t.length===0&&u.length===0&&y.length===0)throw this.unexpected();return{kind:i.Kind.OBJECT_TYPE_EXTENSION,name:n,interfaces:t,directives:u,fields:y,loc:this.loc(e)}},s.parseInterfaceTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var n=this.parseName(),t=this.parseImplementsInterfaces(),u=this.parseDirectives(!0),y=this.parseFieldsDefinition();if(t.length===0&&u.length===0&&y.length===0)throw this.unexpected();return{kind:i.Kind.INTERFACE_TYPE_EXTENSION,name:n,interfaces:t,directives:u,fields:y,loc:this.loc(e)}},s.parseUnionTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var n=this.parseName(),t=this.parseDirectives(!0),u=this.parseUnionMemberTypes();if(t.length===0&&u.length===0)throw this.unexpected();return{kind:i.Kind.UNION_TYPE_EXTENSION,name:n,directives:t,types:u,loc:this.loc(e)}},s.parseEnumTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var n=this.parseName(),t=this.parseDirectives(!0),u=this.parseEnumValuesDefinition();if(t.length===0&&u.length===0)throw this.unexpected();return{kind:i.Kind.ENUM_TYPE_EXTENSION,name:n,directives:t,values:u,loc:this.loc(e)}},s.parseInputObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var n=this.parseName(),t=this.parseDirectives(!0),u=this.parseInputFieldsDefinition();if(t.length===0&&u.length===0)throw this.unexpected();return{kind:i.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:t,fields:u,loc:this.loc(e)}},s.parseDirectiveDefinition=function(){var e=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(r.TokenKind.AT);var t=this.parseName(),u=this.parseArgumentDefs(),y=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var f=this.parseDirectiveLocations();return{kind:i.Kind.DIRECTIVE_DEFINITION,description:n,name:t,arguments:u,repeatable:y,locations:f,loc:this.loc(e)}},s.parseDirectiveLocations=function(){return this.delimitedMany(r.TokenKind.PIPE,this.parseDirectiveLocation)},s.parseDirectiveLocation=function(){var e=this._lexer.token,n=this.parseName();if(E.DirectiveLocation[n.value]!==void 0)return n;throw this.unexpected(e)},s.loc=function(e){var n;if(((n=this._options)===null||n===void 0?void 0:n.noLocation)!==!0)return new c.Location(e,this._lexer.lastToken,this._lexer.source)},s.peek=function(e){return this._lexer.token.kind===e},s.expectToken=function(e){var n=this._lexer.token;if(n.kind===e)return this._lexer.advance(),n;throw(0,d.syntaxError)(this._lexer.source,n.start,"Expected ".concat(v(e),", found ").concat(D(n),"."))},s.expectOptionalToken=function(e){var n=this._lexer.token;if(n.kind===e)return this._lexer.advance(),n},s.expectKeyword=function(e){var n=this._lexer.token;if(n.kind===r.TokenKind.NAME&&n.value===e)this._lexer.advance();else throw(0,d.syntaxError)(this._lexer.source,n.start,'Expected "'.concat(e,'", found ').concat(D(n),"."))},s.expectOptionalKeyword=function(e){var n=this._lexer.token;return n.kind===r.TokenKind.NAME&&n.value===e?(this._lexer.advance(),!0):!1},s.unexpected=function(e){var n=e!=null?e:this._lexer.token;return(0,d.syntaxError)(this._lexer.source,n.start,"Unexpected ".concat(D(n),"."))},s.any=function(e,n,t){this.expectToken(e);for(var u=[];!this.expectOptionalToken(t);)u.push(n.call(this));return u},s.optionalMany=function(e,n,t){if(this.expectOptionalToken(e)){var u=[];do u.push(n.call(this));while(!this.expectOptionalToken(t));return u}return[]},s.many=function(e,n,t){this.expectToken(e);var u=[];do u.push(n.call(this));while(!this.expectOptionalToken(t));return u},s.delimitedMany=function(e,n){this.expectOptionalToken(e);var t=[];do t.push(n.call(this));while(this.expectOptionalToken(e));return t},I}();a.Parser=g;function D(I){var s=I.value;return v(I.kind)+(s!=null?' "'.concat(s,'"'):"")}function v(I){return(0,k.isPunctuatorTokenKind)(I)?'"'.concat(I,'"'):I}}});K();var Ie=ce(),ge=ue(),{hasPragma:Se}=le(),{locStart:Ae,locEnd:De}=pe();function Ke(a){let d=[],{startToken:i}=a.loc,{next:c}=i;for(;c.kind!=="";)c.kind==="Comment"&&(Object.assign(c,{column:c.column-1}),d.push(c)),c=c.next;return d}function ie(a){if(a&&typeof a=="object"){delete a.startToken,delete a.endToken,delete a.prev,delete a.next;for(let d in a)ie(a[d])}return a}var X={allowLegacySDLImplementsInterfaces:!1,experimentalFragmentVariables:!0};function Le(a){let{GraphQLError:d}=W();if(a instanceof d){let{message:i,locations:[c]}=a;return Ie(i,{start:c})}return a}function xe(a){let{parse:d}=Oe(),{result:i,error:c}=ge(()=>d(a,Object.assign({},X)),()=>d(a,Object.assign(Object.assign({},X),{},{allowLegacySDLImplementsInterfaces:!0})));if(!i)throw Le(c);return i.comments=Ke(i),ie(i),i}ae.exports={parsers:{graphql:{parse:xe,astFormat:"graphql",hasPragma:Se,locStart:Ae,locEnd:De}}}});return be();}); --------------------------------------------------------------------------------