{"id":21206660,"url":"https://github.com/oncomouse/lspize.nvim","last_synced_at":"2025-07-04T02:32:20.757Z","repository":{"id":181281438,"uuid":"666063895","full_name":"oncomouse/lspize.nvim","owner":"oncomouse","description":"Convert small functions into tiny LSPs","archived":false,"fork":false,"pushed_at":"2023-07-20T15:17:41.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-14T23:21:53.955Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oncomouse.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-13T16:13:39.000Z","updated_at":"2024-09-26T20:28:43.000Z","dependencies_parsed_at":"2025-01-21T15:53:51.355Z","dependency_job_id":null,"html_url":"https://github.com/oncomouse/lspize.nvim","commit_stats":null,"previous_names":["oncomouse/lspize.nvim"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/oncomouse/lspize.nvim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oncomouse%2Flspize.nvim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oncomouse%2Flspize.nvim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oncomouse%2Flspize.nvim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oncomouse%2Flspize.nvim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oncomouse","download_url":"https://codeload.github.com/oncomouse/lspize.nvim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oncomouse%2Flspize.nvim/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263434009,"owners_count":23465881,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-20T20:56:27.151Z","updated_at":"2025-07-04T02:32:20.715Z","avatar_url":"https://github.com/oncomouse.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `lspize.nvim` -- Convert small functions into tiny LSPs in Neovim\n\nThis is a plugin designed to create simple LSPs running inside [Neovim](https://neovim.io). I wrote it to fill the gap in my configuration created by the archiving of [null-ls](https://github.com/jose-elias-alvarez/null-ls.nvim) (RIP). While [formatter.nvim](https://github.com/mhartington/formatter.nvim) is available for formatting tasks, [nvim-lint](https://github.com/mfussenegger/nvim-lint) is available for diagnostics, and [efm-langserver](https://github.com/mattn/efm-langserver) can supply diagnostics and formatting in an external server, there wasn't a solution for the hover and completion sources I had been using in null-ls.\n\n`lspize.nvim` is a simple wrapper for uncomplicated functions that can provide a variety of LSP functionality to things that don't require full LSPs. See the examples below to see how it works!\n\n## Example 1 -- Completion\n\nHere is a server that returns completion items of available [LuaSnip](https://github.com/L3MON4D3/LuaSnip) snippets:\n\n~~~lua\nlocal Lsp = require(\"lspize\")\n\nlocal function get_documentation(snip, data)\n\tlocal header = (snip.name or \"\") .. \" _ `[\" .. data.filetype .. \"]`\\n\"\n\tlocal docstring = { \"\", \"```\" .. vim.bo.filetype, snip:get_docstring(), \"```\" }\n\tlocal documentation = { header .. \"---\", (snip.dscr or \"\"), docstring }\n\tdocumentation = require(\"vim.lsp.util\").convert_input_to_markdown_lines(documentation)\n\treturn table.concat(documentation, \"\\n\")\nend\n\nlocal handlers = {\n\t[Lsp.methods.COMPLETION] = function(params, done)\n\t\tlocal curline = vim.fn.line(\".\")\n\t\tlocal line, col = unpack(vim.fn.searchpos([[\\k*]], \"bcn\"))\n\t\tif line ~= curline then\n\t\t\tdone()\n\t\t\treturn\n\t\tend\n\t\tlocal word_to_complete = vim.api.nvim_get_current_line():sub(col - 1, params.position.character)\n\t\tlocal filetypes = require(\"luasnip.util.util\").get_snippet_filetypes()\n\t\tlocal items = {}\n\n\t\tfor i = 1, #filetypes do\n\t\t\tlocal ft = filetypes[i]\n\t\t\tlocal ft_table = require(\"luasnip\").get_snippets(ft)\n\t\t\tif ft_table then\n\t\t\t\tfor j, snip in pairs(ft_table) do\n\t\t\t\t\tlocal data = {\n\t\t\t\t\t\ttype = \"luasnip\",\n\t\t\t\t\t\tfiletype = ft,\n\t\t\t\t\t\tft_indx = j,\n\t\t\t\t\t\tsnip_id = snip.id,\n\t\t\t\t\t\tshow_condition = snip.show_condition,\n\t\t\t\t\t}\n\t\t\t\t\tif not snip.hidden then\n\t\t\t\t\t\titems[#items + 1] = {\n\t\t\t\t\t\t\tword = snip.trigger,\n\t\t\t\t\t\t\tlabel = snip.trigger,\n\t\t\t\t\t\t\tdetail = snip.description,\n\t\t\t\t\t\t\tkind = vim.lsp.protocol.CompletionItemKind.Snippet,\n\t\t\t\t\t\t\tdata = data,\n\t\t\t\t\t\t\tdocumentation = {\n\t\t\t\t\t\t\t\tvalue = get_documentation(snip, data),\n\t\t\t\t\t\t\t\tkind = vim.lsp.protocol.MarkupKind.Markdown,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\tlocal line_to_cursor = require(\"luasnip.util.util\").get_current_line_to_cursor()\n\t\titems = vim.tbl_filter(function(item)\n\t\t\treturn vim.startswith(item.word, word_to_complete) and item.data.show_condition(line_to_cursor)\n\t\tend, items)\n\t\tdone(nil, { isIncomplete = false, items = items })\n\tend,\n}\n\nLsp.create(handlers, {\n\tname = \"luasnip\",\n\ton_attach = function()\n\t\tvim.bo.omnifunc = \"v:lua.vim.lsp.omnifunc\"\n\tend\n})\n~~~\n\nOnce you `require()` this file in your Neovim configuration, files will have an LSP that returns LuaSnip suggestions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foncomouse%2Flspize.nvim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foncomouse%2Flspize.nvim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foncomouse%2Flspize.nvim/lists"}