mirror of https://github.com/astral-sh/ruff
Update PLAN.md - mark steps 4 & 5 complete
All core hover assertion functionality is now implemented and compiling! 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
11e5ecb91e
commit
6e73b859ef
32
PLAN.md
32
PLAN.md
|
|
@ -53,24 +53,22 @@ Add support for hover assertions in the mdtest framework. These assertions will
|
||||||
- [x] Update lib.rs to convert diagnostics to `CheckOutput` before matching
|
- [x] Update lib.rs to convert diagnostics to `CheckOutput` before matching
|
||||||
|
|
||||||
### 4. Add hover checking logic (lib.rs)
|
### 4. Add hover checking logic (lib.rs)
|
||||||
**Status:** Not started
|
**Status:** ✅ Completed
|
||||||
|
|
||||||
- [ ] After type checking, for each hover assertion:
|
- [x] Add find_covering_node() to locate AST nodes at positions
|
||||||
- [ ] Find the target line (first non-assertion line after hover comment)
|
- [x] Add infer_type_at_position() using ty_python_semantic (NOT ty_ide)
|
||||||
- [ ] Calculate position from down arrow column
|
- [x] Add generate_hover_outputs() to scan for hover assertions
|
||||||
- [ ] Call `hover(db, file, position)` from ty_ide
|
- [x] Calculate position from down arrow column in comment
|
||||||
- [ ] Create a "hover diagnostic" with the result
|
- [x] Create CheckOutput::Hover with inferred type
|
||||||
- [ ] Add to diagnostics list for matching
|
- [x] Integrate into check flow before match_file()
|
||||||
|
|
||||||
### 5. Update matcher (matcher.rs)
|
### 5. Update matcher (matcher.rs)
|
||||||
**Status:** In progress
|
**Status:** ✅ Completed
|
||||||
|
|
||||||
- [x] Add placeholder matching logic for `ParsedAssertion::Hover`
|
- [x] Add placeholder matching logic for `ParsedAssertion::Hover`
|
||||||
- [ ] Compute column position from comment range when matching
|
- [x] Implement actual hover matching logic
|
||||||
- [ ] Match against hover diagnostics by:
|
- [x] Match hover outputs by comparing inferred type with expected type
|
||||||
- [ ] Position (must match exactly)
|
- [x] Handle `@Todo` metadata stripping in hover assertions
|
||||||
- [ ] Type string (must match the assertion body)
|
|
||||||
- [ ] Handle `@Todo` metadata stripping (line 201-212)
|
|
||||||
|
|
||||||
### 6. Add tests
|
### 6. Add tests
|
||||||
**Status:** Not started
|
**Status:** Not started
|
||||||
|
|
@ -128,3 +126,11 @@ def foo() -> int: ...
|
||||||
- Updated entire matcher module to work with `CheckOutput` instead of `Diagnostic`
|
- Updated entire matcher module to work with `CheckOutput` instead of `Diagnostic`
|
||||||
- Updated lib.rs to convert diagnostics to `CheckOutput` before matching
|
- Updated lib.rs to convert diagnostics to `CheckOutput` before matching
|
||||||
- All changes compile successfully
|
- All changes compile successfully
|
||||||
|
- **2025-10-08**: Completed steps 4 & 5 - Implemented hover type inference and matching
|
||||||
|
- Avoided adding ty_ide dependency; used ty_python_semantic directly
|
||||||
|
- Implemented find_covering_node() using AST visitor pattern
|
||||||
|
- Implemented infer_type_at_position() using HasType trait on AST nodes
|
||||||
|
- Implemented generate_hover_outputs() to scan comments and generate hover results
|
||||||
|
- Integrated hover outputs into check flow
|
||||||
|
- Implemented hover matching logic comparing inferred vs expected types
|
||||||
|
- **All core functionality now complete and compiling!**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue