{"id":13600413,"url":"https://github.com/quangnguyen30192/cmp-nvim-tags","last_synced_at":"2025-04-11T00:31:20.592Z","repository":{"id":45718316,"uuid":"399838318","full_name":"quangnguyen30192/cmp-nvim-tags","owner":"quangnguyen30192","description":"tags sources for nvim-cmp","archived":false,"fork":false,"pushed_at":"2024-06-05T06:28:05.000Z","size":22,"stargazers_count":52,"open_issues_count":2,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-07T03:41:40.044Z","etag":null,"topics":["nvim-cmp"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/quangnguyen30192.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-08-25T13:56:46.000Z","updated_at":"2024-09-21T01:31:38.000Z","dependencies_parsed_at":"2024-01-14T15:23:22.208Z","dependency_job_id":"42b73cbc-4bdd-45b4-b3d6-0147825ced7a","html_url":"https://github.com/quangnguyen30192/cmp-nvim-tags","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quangnguyen30192%2Fcmp-nvim-tags","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quangnguyen30192%2Fcmp-nvim-tags/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quangnguyen30192%2Fcmp-nvim-tags/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quangnguyen30192%2Fcmp-nvim-tags/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quangnguyen30192","download_url":"https://codeload.github.com/quangnguyen30192/cmp-nvim-tags/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248322260,"owners_count":21084334,"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":["nvim-cmp"],"created_at":"2024-08-01T18:00:38.617Z","updated_at":"2025-04-11T00:31:20.274Z","avatar_url":"https://github.com/quangnguyen30192.png","language":"Lua","funding_links":[],"categories":["Lua","Other Standard Feature Enhancement"],"sub_categories":["Tags"],"readme":"# cmp-nvim-tags\n\ntags completion source for [nvim-cmp](https://github.com/hrsh7th/nvim-cmp)\n\n```lua\n-- Installation\nuse { \n  'hrsh7th/nvim-cmp',\n  requires = {\n    {\n      'quangnguyen30192/cmp-nvim-tags',\n      -- if you want the sources is available for some file types\n      ft = {\n        'kotlin',\n        'java'\n      }\n    }\n  },\n  config = function ()\n    require'cmp'.setup {\n    sources = {\n      {\n        name = 'tags',\n        option = {\n          -- this is the default options, change them if you want.\n          -- Delayed time after user input, in milliseconds.\n          complete_defer = 100,\n          -- Max items when searching `taglist`.\n          max_items = 10,\n          -- The number of characters that need to be typed to trigger\n          -- auto-completion.\n          keyword_length = 3,\n          -- Use exact word match when searching `taglist`, for better searching\n          -- performance.\n          exact_match = false,\n          -- Prioritize searching result for current buffer.\n          current_buffer_only = false,\n        },\n      },\n      -- more sources\n    }\n  }\n  end\n}\n\n```\n\n# Troubleshooting\n\nIf you are using `cmp-nvim-lsp` with `cmp-nvim-tags`, you may face a weird error\n`method workspace/symbol is not supported by any of the servers registered for the current buffer`.\n\nThis is because neovim will register `tagfunc` as `vim.lsp.tagfunc` when lsp is attached, and there's no attached lsps\nsupports `workspace/symbol` method. To prevent this behavior, add the following code in your config file:\n\nBesides, `vim.lsp.tagfunc` may also have performance issue since it is calling\nthe lsp `workspace/symbol` method firstly and fallback to the default when the\nformer one returns no result.\n\nIf you feel that use `cmp-nvim-tags` is laggy, then you can consider to set `tagfunc` to nil.\n\n```lua\non_attach = function(bufnr, client)\n    vim.bo.tagfunc = nil\nend\n\n-- sqls is an example lsp that does not support workspace/symbol\n-- change sqls to the lsp where the error happens\nrequire('lspconfig').sqls.setup {\n    on_attach = on_attach\n}\n\n\n-- Occasionally, due to potential execution order issues: you might set tagfunc\n-- to nil, but the LSP could re-register it later. So that you may need a\n-- \"brute force way\" to ask neovim will always fallback to the default tag\n-- search method immediately.\nTAGFUNC_ALWAYS_EMPTY = function()\n    return vim.NIL\nend\n\n-- if tagfunc is already registered, nvim lsp will not try to set tagfunc as vim.lsp.tagfunc.\nvim.o.tagfunc = \"v:lua.TAGFUNC_ALWAYS_EMPTY\"\n```\n\n# Credit\n[Compe source for tags](https://github.com/hrsh7th/nvim-compe/blob/master/lua/compe_tags/init.lua)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquangnguyen30192%2Fcmp-nvim-tags","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquangnguyen30192%2Fcmp-nvim-tags","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquangnguyen30192%2Fcmp-nvim-tags/lists"}