Repository navigation
feat: classify dependent-name semantic token modifier - #387
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughChanged Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/feature/semantic_tokens.cpp (1)
69-90: Trim large commented-out placeholder blocks.These stub/comment sections add noise and make the handler harder to scan. Prefer converting to concise TODOs with issue references (or remove until implemented).
Also applies to: 98-104, 121-124
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/feature/semantic_tokens.cpp` around lines 69 - 90, Remove the large commented-out placeholder blocks in semantic_tokens.cpp (the commented scopeModifier/Tok.addModifier block and the computeSymbolTags/TagModifierMap sections) and replace each with a single-line TODO including a short description and an issue or task ID (e.g., "// TODO(issue-1234): implement clangd-style modifiers using scopeModifier/computeSymbolTags"). Apply the same replacement for the other commented blocks mentioned (around the areas currently at 98-104 and 121-124), keeping only concise TODOs that reference the related symbols (scopeModifier, computeSymbolTags, TagModifierMap, Tok.addModifier) so the handler remains easy to scan.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/feature/semantic_tokens.cpp`:
- Around line 42-44: The is_dependent(const clang::Decl* D) function currently
only tests isa<clang::UnresolvedUsingValueDecl>(D); update it to also detect
clang::UnresolvedUsingTypenameDecl so unresolved using typename declarations are
treated as dependent; modify the check in is_dependent (or replace it with a
combined isa check such as testing both clang::UnresolvedUsingValueDecl and
clang::UnresolvedUsingTypenameDecl) to return true for either AST node type.
In `@tests/integration/test_server.py`:
- Around line 54-56: The test dereferences
client.init_result.capabilities.semantic_tokens_provider.legend without ensuring
the semantic_tokens_provider exists; add an explicit assertion that
client.init_result.capabilities.semantic_tokens_provider is not None before
accessing .legend (so replace or precede the legend assignment with an assert
that the provider is present to produce a clear failure instead of an
AttributeError).
---
Nitpick comments:
In `@src/feature/semantic_tokens.cpp`:
- Around line 69-90: Remove the large commented-out placeholder blocks in
semantic_tokens.cpp (the commented scopeModifier/Tok.addModifier block and the
computeSymbolTags/TagModifierMap sections) and replace each with a single-line
TODO including a short description and an issue or task ID (e.g., "//
TODO(issue-1234): implement clangd-style modifiers using
scopeModifier/computeSymbolTags"). Apply the same replacement for the other
commented blocks mentioned (around the areas currently at 98-104 and 121-124),
keeping only concise TODOs that reference the related symbols (scopeModifier,
computeSymbolTags, TagModifierMap, Tok.addModifier) so the handler remains easy
to scan.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a125c8d3-5125-493e-a925-7bc4f82b0230
📒 Files selected for processing (3)
src/feature/semantic_tokens.cppsrc/semantic/symbol_kind.htests/integration/test_server.py
There was a problem hiding this comment.
♻️ Duplicate comments (1)
src/feature/semantic_tokens.cpp (1)
42-44:⚠️ Potential issue | 🟠 Major
is_dependent()still misses unresolved using typename declarations.Line 43 only checks
clang::UnresolvedUsingValueDecl, so dependent-name tagging is still incomplete forclang::UnresolvedUsingTypenameDecl(downstream impact at Line 95-96).🔧 Proposed fix
bool is_dependent(const clang::Decl* D) { - return isa<clang::UnresolvedUsingValueDecl>(D); + return llvm::isa<clang::UnresolvedUsingValueDecl>(D) || + llvm::isa<clang::UnresolvedUsingTypenameDecl>(D); }#!/bin/bash # Verify dependent-name coverage for unresolved using decl kinds. rg -n -C3 'is_dependent\(|UnresolvedUsing(Value|Typename)Decl' \ src/feature/semantic_tokens.cpp src/index/usr_generation.cpp🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/feature/semantic_tokens.cpp` around lines 42 - 44, The is_dependent function currently only checks for clang::UnresolvedUsingValueDecl which misses unresolved using typename declarations; update is_dependent to also return true for clang::UnresolvedUsingTypenameDecl so dependent-name tagging covers both cases (this affects downstream logic in the semantic tokens flow around where is_dependent is used, e.g., the checks at the locations corresponding to lines ~95-96). Locate the is_dependent(const clang::Decl* D) function and add an additional isa<> check for clang::UnresolvedUsingTypenameDecl (or combine with a logical OR) so both UnresolvedUsingValueDecl and UnresolvedUsingTypenameDecl are treated as dependent.
🧹 Nitpick comments (1)
src/feature/semantic_tokens.cpp (1)
69-90: Trim large commented-out scaffolding before merge.These TODO/commented blocks add noise without behavior. Prefer removing them or converting to a tracked issue reference.
Also applies to: 98-104, 121-124
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/feature/semantic_tokens.cpp` around lines 69 - 90, Remove the large commented-out scaffolding in src/feature/semantic_tokens.cpp (the blocks referencing scopeModifier, Tok.addModifier, computeSymbolTags, TagModifierMap, SymbolTag and HighlightingModifier) and replace them with a single short comment linking to a tracked issue/PR number or remove entirely; also clean up the similar commented blocks at the other noted ranges (lines referenced around the second block and the third block) so the file contains only active code and a concise note pointing to the issue where the clangd-style modifiers will be implemented.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@src/feature/semantic_tokens.cpp`:
- Around line 42-44: The is_dependent function currently only checks for
clang::UnresolvedUsingValueDecl which misses unresolved using typename
declarations; update is_dependent to also return true for
clang::UnresolvedUsingTypenameDecl so dependent-name tagging covers both cases
(this affects downstream logic in the semantic tokens flow around where
is_dependent is used, e.g., the checks at the locations corresponding to lines
~95-96). Locate the is_dependent(const clang::Decl* D) function and add an
additional isa<> check for clang::UnresolvedUsingTypenameDecl (or combine with a
logical OR) so both UnresolvedUsingValueDecl and UnresolvedUsingTypenameDecl are
treated as dependent.
---
Nitpick comments:
In `@src/feature/semantic_tokens.cpp`:
- Around line 69-90: Remove the large commented-out scaffolding in
src/feature/semantic_tokens.cpp (the blocks referencing scopeModifier,
Tok.addModifier, computeSymbolTags, TagModifierMap, SymbolTag and
HighlightingModifier) and replace them with a single short comment linking to a
tracked issue/PR number or remove entirely; also clean up the similar commented
blocks at the other noted ranges (lines referenced around the second block and
the third block) so the file contains only active code and a concise note
pointing to the issue where the clangd-style modifiers will be implemented.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f0f36dfd-669d-4e8a-bc8f-cdba72825f70
📒 Files selected for processing (1)
src/feature/semantic_tokens.cpp
Summary
dependentNamesemantic token modifierTesting
Summary by CodeRabbit
New Features
Tests