{"id":13761271,"url":"https://github.com/nvim-treesitter/completion-treesitter","last_synced_at":"2025-05-10T12:31:25.614Z","repository":{"id":103302876,"uuid":"252186206","full_name":"nvim-treesitter/completion-treesitter","owner":"nvim-treesitter","description":"Treesitter source for completion-nvim and more","archived":true,"fork":false,"pushed_at":"2020-09-16T01:35:18.000Z","size":117,"stargazers_count":161,"open_issues_count":3,"forks_count":5,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-10-29T16:12:53.315Z","etag":null,"topics":["completion-nvim","neovim","nvim-treesitter"],"latest_commit_sha":null,"homepage":"","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/nvim-treesitter.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}},"created_at":"2020-04-01T13:41:11.000Z","updated_at":"2024-07-01T07:33:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"80be0f01-706b-47c7-a125-b4c424d24e03","html_url":"https://github.com/nvim-treesitter/completion-treesitter","commit_stats":{"total_commits":62,"total_committers":4,"mean_commits":15.5,"dds":"0.14516129032258063","last_synced_commit":"45c9b2faff4785539a0d0c655440c2465fed985a"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-treesitter%2Fcompletion-treesitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-treesitter%2Fcompletion-treesitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-treesitter%2Fcompletion-treesitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-treesitter%2Fcompletion-treesitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nvim-treesitter","download_url":"https://codeload.github.com/nvim-treesitter/completion-treesitter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224011572,"owners_count":17240962,"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":["completion-nvim","neovim","nvim-treesitter"],"created_at":"2024-08-03T13:01:46.627Z","updated_at":"2024-11-16T18:32:28.531Z","avatar_url":"https://github.com/nvim-treesitter.png","language":"Lua","funding_links":[],"categories":["Lua"],"sub_categories":[],"readme":"[![asciicast](https://asciinema.org/a/318046.svg)](https://asciinema.org/a/318046)\n\n[![Gitter](https://badges.gitter.im/completion-nvim/community.svg)](https://gitter.im/completion-nvim/community?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n# completion-treesitter\nTreesitter source and more for [completion-nvim](https://github.com/haorenW1025/completion-nvim).\n\nThis is a basic completion source based on the treesitter api of neovim.\n\n**Since v0.1 this only contains a completion source. All other features are being migrated to nvim-treesitter**\n\n# Quickstart\n\nThis plugin requires the following plugins:\n\n- [completion-nvim](https://github.com/haorenW1025/completion-nvim)\n- [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter)\n\nInstall them like this (vim-plugged or your favorite package manager):\n```vim\nPlug 'haorenW1025/completion-nvim'\nPlug 'nvim-treesitter/nvim-treesitter'\nPlug 'nvim-treesitter/completion-treesitter'\n```\n\n## Completion\nConfigure `completion-nvim` as you desire, you can use the `ts` source for `lua`, `python` and `c` filetypes, for example :\n```vim\n\" Configure the completion chains\nlet g:completion_chain_complete_list = {\n\t\t\t\\'default' : {\n\t\t\t\\\t'default' : [\n\t\t\t\\\t\t{'complete_items' : ['lsp', 'snippet']},\n\t\t\t\\\t\t{'mode' : 'file'}\n\t\t\t\\\t],\n\t\t\t\\\t'comment' : [],\n\t\t\t\\\t'string' : []\n\t\t\t\\\t},\n\t\t\t\\'vim' : [\n\t\t\t\\\t{'complete_items': ['snippet']},\n\t\t\t\\\t{'mode' : 'cmd'}\n\t\t\t\\\t],\n\t\t\t\\'c' : [\n\t\t\t\\\t{'complete_items': ['ts']}\n\t\t\t\\\t],\n\t\t\t\\'python' : [\n\t\t\t\\\t{'complete_items': ['ts']}\n\t\t\t\\\t],\n\t\t\t\\'lua' : [\n\t\t\t\\\t{'complete_items': ['ts']}\n\t\t\t\\\t],\n\t\t\t\\}\n\n\" Use completion-nvim in every buffer\nautocmd BufEnter * lua require'completion'.on_attach()\n```\n\nOpen a buffer of a supported filetype and enjoy !\n\n# Using parsers\n\n## From nvim-treesitter\n\nTo install a parser run the following command in nvim for the supported language of your choice :\n```vim\n:TSInstall lua\n```\n\n## From source\n\nTo use a parser for one of the supported languages clone the parser sources (the python parser for example) :\n```sh\ngit clone https://github.com/tree-sitter/tree-sitter-python.git\n```\n\nThen compile it :\n```sh\ngcc -o parser.so -shared src/parser.c src/scanner.cc -I./src -lstdc++\n```\n\nAn move it to neovim config files :\n\n```sh\nmv parser.so ~/.config/nvim/parser/{lang}.so\n```\n\nWhere `{lang}` is the filetype corresponding to the parser's language (`python` in above example).\n\n# Examples usages\n\nSome examples usages of the plugin, not only for completion.\nAll of these functionnalities are available for all supported filetypes.\n\n# Goals\nThe aim of the plugin is mainly to fiddle a bit with treesitter, and a nice way is completion, but there is many things we can do with it.\n\nThere is still some goals for the plugin:\n  - As hackable as possible\n  - As fast as possible\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvim-treesitter%2Fcompletion-treesitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnvim-treesitter%2Fcompletion-treesitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvim-treesitter%2Fcompletion-treesitter/lists"}