Add SCIP support#343
Closed
jelmer wants to merge 5 commits into
Closed
Conversation
New flag --scip {none,tags-and-branches,ALL} (and KLAUS_SCIP_POLICY env
var) controls when klaus should generate a SCIP index on demand for an
un-indexed revision. When enabled, the first request kicks off a
background job that:
1. Adds a git worktree at a tempdir checked out to the requested commit.
2. Runs the first matching indexer (scip-python is the built-in).
3. Moves index.scip to <repo>/.scip/<sha>.scip.
4. Removes the worktree.
Subsequent requests for the same revision pick up the dump. Concurrent
requests for the same (repo, sha) share a single in-process thread via
a lock. Indexers are pluggable via klaus.scip_generate.INDEXERS.
- SCIP definitions get a stable id (sym-<hash>) so deep links jump to the actual occurrence rather than the line number. - Non-definition occurrences now render as <a class=scip-reference> pointing at the definition's anchor, with data-sym, data-display, data-defhref / data-defloc, and data-refs attributes carrying the symbol's references inline. - scip.js shows a hover popover with the display name, definition link, and reference list (up to 10, with overflow indicator). - scip.css styles the popover and gives definitions a subtle underline + target highlight. - Index now also exposes get_references and get_display_name, built from each Document's symbols list.
for more information, see https://pre-commit.ci
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I suppose this is more of a proof of concept. This replaces ctags usage with the SCIP file format, which is used by e.g. sourcegraph. It works fairly well for me with python code, and there's room for further feature enhancements.