feat(markdown): add CommentType.markdown backed by tree-sitter-markdown - #95
Open
HartmannNico wants to merge 2 commits into
Open
feat(markdown): add CommentType.markdown backed by tree-sitter-markdown#95HartmannNico wants to merge 2 commits into
HartmannNico wants to merge 2 commits into
Conversation
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.
Closes #94
Summary
Adds
comment_type: markdownbacked bytree-sitter-markdown, enabling<!-- @needs … -->HTML-comment markers in Markdown files to be ingested as traceability nodes by sphinx-codelinks.Primary use case: AI agent and skill definition files (
.claude/agents/*.md,.github/prompts/*.md) that are the actual implementation artefacts of agentic systems and need to participate in a requirements → architecture → design → implementation traceability chain.Changes (3 files, ~24 lines)
source_discover/config.py"markdown": ["md", "markdown"]toCOMMENT_FILETYPEmarkdown = "markdown"toCommentTypeenumanalyse/utils.pyMARKDOWN_QUERY = """(html_block) @comment"""— tree-sitter-markdown maps standalone<!-- … -->blocks tohtml_blocknodeselif comment_type == CommentType.markdown:branch ininit_tree_sitter()importingtree_sitter_markdownSCOPE_NODE_TYPESentry: Markdown has no function/class scopes; oneline-only mode never invokes scope associationpyproject.tomltree-sitter-markdown>=0.5.1Caller note
Because
html_blocknode text includes the full<!-- … -->delimiters, callers must configureend_sequence: " -->"(not the default"\n") in theironeline_comment_style. This is the only behavioural difference from all othercomment_typeentries.Example conf:
Relation to other PRs
Analogous to PR #92 (bash). PR #82 (TypeScript) was the structural template.
This PR is independent of PR #92 — it is based directly on
mainand does not require bash support to be merged first.