Repository navigation
Add optional gutter markers for Python overrides and implementations - #2
Conversation
…tions Introduce a dedicated gutter decoration layer that reuses the existing override/implementation analysis without changing the detector logic. Changes included: - add OverrideGutterManager to render gutter icons for: - methods overriding a parent method - methods implemented in subclasses - wire gutter updates into the extension lifecycle alongside the existing CodeLens flow - keep CodeLens as the primary navigation mechanism - add a HoverProvider so users get a single, non-duplicated explanation on the method line - add light/dark SVG assets for override and implementation markers - add the pythonOverrideMark.gutterIcons.enabled setting - update README with the new optional gutter marker behavior Notes: - gutter markers are visual indicators only and do not pretend to be clickable - the existing CodeLens-based navigation remains unchanged - the same analysis result is reused for both CodeLens and gutter rendering
Introduce a dedicated HoverProvider for Python override and implementation markers so hover text is shown once on the method line instead of being duplicated by both decoration hover messages and editor hover rendering. Changes included: - add OverrideHoverProvider to build hover text from existing OverrideItem results - register the hover provider in the extension lifecycle - keep hover state in sync with the active editor and analysis updates - clear hover state when the editor changes or when results are reset - remove hoverMessage from gutter decorations to avoid duplicate tooltip content - respect pythonOverrideMark.gutterIcons.enabled when providing hover content Notes: - gutter icons remain visual markers only - hover is now provided through the editor hover system on the method line - existing CodeLens navigation behavior remains unchanged
|
Hi @showpiecep, Thank you for submitting a contribution. Having come from PyCharm, my first target was adding the markers in the gutters as you have implemented. Visually this looks good, but functionally I think the same limitations I had are still present.
Do you have any thoughts or improvements in relation to the gutter icon functionalities. Thanks, |
|
Hi @maxo99, Thanks for the thoughtful review. I agree that preserving native gutter behavior is important, especially around breakpoints. In my testing, breakpoints could still be added above or below the marker, and also via right click as you mentioned, so it seemed to me that breakpoint functionality is still partially preserved, even though the gutter becomes more constrained than the default behavior. The goal of this PR was not to replace CodeLens or move navigation into the gutter, but to add an optional visual cue that makes override/implementation relationships easier to spot when scanning codebases with a lot of inheritance and method overriding. The existing CodeLens-based navigation is still preserved; what this PR does not add is direct click navigation from the gutter marker itself. From what I could find, I was not able to identify a clean VS Code API-supported way to make the gutter marker behave more like a PyCharm marker without interfering with native gutter behavior. Given that, I would frame this feature as an optional visual enhancement rather than a gutter-based navigation feature. Thanks again for taking the time to review this. |
Update the gutter icon configuration so the feature is hidden by default and must be explicitly enabled by the user. Changes included: - change pythonOverrideMark.gutterIcons.enabled default to false - align runtime fallback values with the contributed configuration default - update README to document the new default behavior Notes: - CodeLens remains available by default - gutter markers can still be enabled explicitly through settings - this change avoids changing breakpoint-related gutter behavior unless the user opts in
|
Hi @maxo99, I pushed the requested update: gutter icons are now disabled by default and must be explicitly enabled by the user. I also aligned the runtime fallback values and README with that behavior. I manually verified the default-off and enable/disable flow in the extension host. |
Addresses #1 by adding optional gutter markers for override and implementation cases while keeping the existing CodeLens workflow intact.
What changed
This PR adds optional gutter markers for Python override and implementation cases while keeping the existing CodeLens workflow intact.
Included:
OverrideGutterManagerto render gutter icons for:OverrideHoverProviderso override/implementation details are shown once through the editor hover systempythonOverrideMark.gutterIcons.enabledsettingWhy
The extension already provides useful CodeLens-based navigation, but override and implementation relationships are still easy to miss in OOP-heavy Python code.
Optional gutter markers improve visual discoverability and make the extension feel closer to the IDE experience users often expect, without replacing CodeLens or changing the core analysis pipeline.
What did not change
Limitations
Validation
Validated with:
npm run compileExtension Development HostManual scenarios checked with files in
py-sample/:pythonOverrideMark.gutterIcons.enabledNotes
Screenshots
Screenshots can be added before merge if needed: