{"id":16885629,"url":"https://github.com/filmil/private-code-comments","last_synced_at":"2026-05-24T02:07:34.362Z","repository":{"id":221835123,"uuid":"741883750","full_name":"filmil/private-code-comments","owner":"filmil","description":"Private code comments: add private annotations to your source code.","archived":false,"fork":false,"pushed_at":"2026-05-10T00:56:16.000Z","size":231,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-10T04:36:26.791Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","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/filmil.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-01-11T10:05:37.000Z","updated_at":"2026-03-21T03:08:01.000Z","dependencies_parsed_at":"2024-03-01T11:28:17.266Z","dependency_job_id":"417573cd-0e41-4423-b334-4a7c7a4c6f91","html_url":"https://github.com/filmil/private-code-comments","commit_stats":null,"previous_names":["filmil/private-code-comments"],"tags_count":43,"template":false,"template_full_name":null,"purl":"pkg:github/filmil/private-code-comments","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filmil%2Fprivate-code-comments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filmil%2Fprivate-code-comments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filmil%2Fprivate-code-comments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filmil%2Fprivate-code-comments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/filmil","download_url":"https://codeload.github.com/filmil/private-code-comments/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filmil%2Fprivate-code-comments/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33418555,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T22:14:44.296Z","status":"online","status_checked_at":"2026-05-24T02:00:06.296Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-10-13T16:36:13.763Z","updated_at":"2026-05-24T02:07:34.324Z","avatar_url":"https://github.com/filmil.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Private Code Comments LSP\n\n[![Test status](https://github.com/filmil/private-code-comments/workflows/Test/badge.svg)](https://github.com/filmil/private-code-comments/workflows/Test/badge.svg) [![Tag and Release status](https://github.com/filmil/private-code-comments/workflows/Tag%20and%20Release/badge.svg)](https://github.com/filmil/private-code-comments/workflows/Tag%20and%20Release/badge.svg)\n\n## Introduction\n\n### What is this?\n\n1. A LSP server for keeping private comments and annotations.\n2. A Neovim plugin for the said LSP server.\n\n### What does it do?\n\nIt allows you to leave notes on specific lines in the files you edit. The notes\nare private for you only, and will not appear in the file itself.\n\nThe LSP server is the backend that saves your notes. Neovim is the frontend,\nwhich uses the LSP client side facilities to show and manage your notes.\n\nWhile I used Neovim as a vehicle for the private code comments, it should be\npossible to use a setup for *any* editor you choose. However, for the time being,\nI only have the Neovim plugin.\n\n### What can you use it for?\n\nFor example, you can use it to leave breadcrumbs for yourself when you are\nreading and analyzing a large code base.  If you figure a piece of code out,\nyou can write yourself a short note at the point where you did so. The note\nremains available to you for as long as you want.\n\n## Installation\n\nDownload the [release archive][rel], and unpack it into the directory\n`$HOME/.config`. This should create a directory `$HOME/.config/pcc` on your\ndisk.\n\n[rel]: https://github.com/filmil/private-code-comments/releases\n\nAdd the following configuration in your `init.lua`.\n\n```lua\n-- This setup places the private comments plugin into the directory $HOME/.config/pcc.\nrequire('lspconfig')\nlocal pcc_dir = os.getenv(\"HOME\") .. \"/.config/pcc\"\nvim.opt.rtp:prepend(pcc_dir)\nlocal pcc_plugin = require('pcc')\n\npcc_plugin.setup_server_with_lsp_config({},\n    {\n        pcc_binary = pcc_dir .. \"/bin/pcc\",\n        log_dir = os.getenv(\"HOME\") .. '/.local/state/pcc/logs',\n        db = os.getenv(\"HOME\") .. '/.local/state/pcc/db/db.sqlite',\n        log_verbosity = 3,\n        filetypes = {\n            \"bzl\",\n            \"c\",\n            \"cpp\",\n            \"gn\",\n            \"go\",\n            \"lua\",\n            \"markdown\",\n            \"python\",\n            \"rust\",\n            \"text\",\n        },\n        autostart = true,\n    }\n)\nrequire('lspconfig').pcc.setup {}\n\nvim.api.nvim_create_autocmd(\"LspAttach\", {\n    group = vim.api.nvim_create_augroup(\"PrivateCodeComments\", {}),\n    callback = function(ev)\n        -- Only create the key mappings when a LSP server attaches\n        -- to the buffer, and then only for the \"pcc\" client.\n        local clients = vim.lsp.get_clients({ name = \"pcc\" })\n        if clients and clients[1] then\n            vim.keymap.set(\n                {'n'}, '\u003cleader\u003ecr', pcc_plugin.edit, {\n                    desc = \"[C]omment [R]eview\"\n            })\n            vim.keymap.set(\n                {'n'}, '\u003cleader\u003ecd', pcc_plugin.delete, {\n                    desc = \"[C]omment [D]elete\"\n            })\n        end\n    end,\n})\n```\n\n## Usage\n\n### Adding or editing a comment\n\nPress the key combination for \"Comment Review\". A small annotation window\nappears, where you can write your comment.\n\nOnce you are done writing the comment, pressing `q` in normal mode closes\nthe annotation window, and shows the comment as a hint on the line where the\ncursor was.\n\nIf you do this on a line that already has a comment, the annotation window will\nload the current comment.\n\n### Deleting a comment\n\nPress the key combination for \"Comment Delete\". The comment will be deleted on\nthe line if it exists.  Nothing changes if there is no comment to be deleted.\n\n### Naming a workspace\n\nPutting a file named `pcc.config.json` in the desired workspace root directory\nallows you to give the name to the workspace. This makes all comments for that\nworkspace rooted at the location of the file, and makes all files be saved\nin that workspace:\n\n```\n{\n  \"workspace_name\": \"some_name\"\n}\n```\n\nYou can add the `pcc.config.json` in your global `.gitignore` file so that you can\nplace it in your project directories. This allows sharing comments if you so\nchoose.\n\n## References\n\nThis was not built in a vacuum.  Here are some similar projects that I used\nas inspiration.\n\n* https://github.com/masukomi/private_comments\n* https://github.com/winter-again/annotate.nvim\n\nThere is at least one other project that I remember poring over, but I forgot\nwhat that was.\n\nThe above projects however are not using the LSP infrastructure, so they end up\nneeding to reinvent the presentation of the annotations.\n\nI also owe gratitude to my colleague Chris, for inspiring me to write this\nlittle program.\n\n## Maintenance\n\n### Prerequisites\n\nInstall `bazelisk`, under the name `bazel` and place it in your `$PATH`.\nYes, Bazel gets flak for being complex, but it's really the only good way to\nbuild software. If you disagree, we'll need to continue disagreeing.\n\nCheck out the code:\n\n```sh\ngit clone https://github.com/filmil/private-code-comments\n```\n\n### Building\n\n```bash\nbazel build //...\n```\n\nBazel will download all the needed dependencies, and build the project.\n\n### Testing\n\nRun tests:\n\n```bash\nbazel test //...\n```\n\nView the log results of the tests, after the test run.\n\n```\nbazel run //scripts:view_logs\n```\n\nThe following tests are implemented:\n* unit tests: for most functionality, aiming for full coverage.\n* integration tests: the tests covering the interaction with neovim, using\n  a hermetic instance of neovim that is brought up with the test fixture.\n\n## Troubleshooting\n\nIf all else fails, [file a bug][bug].\n\n[bug]: https://github.com/filmil/private-code-comments/issues\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilmil%2Fprivate-code-comments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffilmil%2Fprivate-code-comments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilmil%2Fprivate-code-comments/lists"}