Repository navigation
Entry tooltips - #307
Merged
eristhea merged 110 commits intoNov 9, 2025
Merged
Entry tooltips#307
Conversation
supersaiyansubtlety
force-pushed
the
entry-tooltips
branch
from
October 12, 2025 18:46
81b370f to
d3bec0e
Compare
Member
Author
Merged
supersaiyansubtlety
force-pushed
the
entry-tooltips
branch
from
October 13, 2025 02:28
aa80cb4 to
d861d51
Compare
supersaiyansubtlety
force-pushed
the
entry-tooltips
branch
from
October 19, 2025 15:27
b4a17b3 to
5f2b17d
Compare
Comment on lines
+219
to
+222
| // Put all main content in one big scroll pane. | ||
| // Ideally there'd be separate javadoc and snippet scroll panes, but multiple scroll pane children | ||
| // of a grid bag parent don't play nice when space is limited. | ||
| // The snippet has its own scroll pane, but wrapping it in this one effectively disables its resizing. |
Member
Author
There was a problem hiding this comment.
If anyone has ideas on how to improve this, please discuss on discord and make a followup PR.
… and timers, respectively
…t's the same class (editor bounds were 0x0 when setting source) navigate to tooltip target entry declaration when showing tooltip
stop excluding curly braces from method and class sources
…declaration' message show <init> for constructor simple names
add/remove EntryTooltip's global listeners on open/close reset TooltipManager on key presses
supersaiyansubtlety
force-pushed
the
entry-tooltips
branch
from
October 30, 2025 18:23
bcbc5aa to
be44d7d
Compare
move FeaturesSection.autoSaveMappings to EditorConfig eliminate FeaturesSection
Merged
4 of 7 tasks
eristhea
self-requested a review
November 9, 2025 17:47
eristhea
approved these changes
Nov 9, 2025
eristhea
left a comment
Member
There was a problem hiding this comment.
this is amazing! just a couple last nitpicks before we merge
eristhea
pushed a commit
that referenced
this pull request
Nov 16, 2025
* add POC tooltip to EditorPanel editor that shows full name of entry under cursor * update tooltip content when mouse moves, but can't get JToolTip to resize+move * replace EditorPanel's use of JToolTip and TooltipManager with JWindow and timers, respectively * check if same token instead of same entry when updating tooltip * replace complex Optional composition with consumer methods * extract BaseEditorPanel without tooltip, navigator, or listeners * display entries' entire outer source class in their tooltips * always set tooltipEditor classhandle instead of setting source when it's the same class (editor bounds were 0x0 when setting source) navigate to tooltip target entry declaration when showing tooltip * add javaparser dep matching #308 * implement source trimming for classes using javaparser * minor improvements * minor cleanup * make trimFactor a param instead of a field * implement source trimming for methods * match declarations only by range and extract findDeclaration * inline variable * implement field source trimming stop excluding curly braces from method and class sources * fix tooltip source trimming for static record fields add "No source available" label when there's no classhandle * update TODOs centralize target name reporting * extract TooltipEditorPanel * trim param tooltip target source to parent method refine error messages * fail early when target declaration token is missing add local source trimming * fix tooltip source trimming for constructors * minor refactor * show record component parent instead of just component; matches param showing parent method * when excluding implements from record component parent, find token instead of assuming offset * close and destroy tooltip when source changes * silently ignore missing declaration tokens (until #252 is fixed) * restore quickFindToolbar to ui stop closing tooltip's class handles as tabs may still need them; remove ClassHandleListener instead rename TooltipEditorPanel -> DeclarationSnippetPanel extract EditorTooltip add test input for easier manual tooltip testing * restore EditorPanel popupMenu functionality * improve caret pos logic in BaseEditorPanel::setSource * replace source with message if the declaration token could be found * implement source snippet unindenting * replace entry simple name label with formatted parent name label * add 'From: ' prefix to parent label left-align tooltip rows * add javadocs to tooltip * allow disabling tooltip * make tooltip optionally interactable implement dragging to move tooltip * prevent hiding tooltip when cursor is over a token or the tooltip * fix parent label for top-level classes and add missing dot separator for package format labels use GridBagLayout for param javadocs (currently takes up extra space) * allow clicking entries withing tooltip to populate tooltip with that entry's information * fix calculation for offsetting multiline snippet pos to un-trimmed pos allow clicking parent entries in tooltips to populate tooltip when ctrl+clicking entries in tooltips, open entry tab * minor improvements, add TODOs * resolve references when finding tooltip targets * customize tooltip target highlighting * update TODOs regarding records * polish tooltip positioning fix exception when consumeMousePosition... methods where passed a component that wasn't showing fix several cases where the tooltip would hide when it shouldn't or hiden't when it should * increase padding at outer edges of tooltip rows add tooltip border * use a JPanel with a GridBagLayout instead of a Box as the content pane for EditorTooltip; allows elements to expand to fill their space double-pack in EditorTooltip's declarationSnippet source set listener to eliminate extra space, because swing </3 * reject some TODOs * ctrl+click on parent package label to naviage to package * fix tooltip separators improve "No source available" message formatting * respect tooltip ineractable config for parent package clicking add z_ prefix to tooltip test input to avoid changing SearchMappingsTest * use global focus listener to ensure tooltip is closed when neither it nor its editor has focus * move consumeMousePosition... methods to GuiUtil * rename EditorTooltip -> EntryTooltip use GridBagConstraintsBuilder in EntryTooltip respect scale config in EntryTooltip * use GridBagConstraintsBuilder in initEditorPane * make tooltip focusable; enables copying tooltip content * fix hiding tooltip immediately after re-populating it simplify tooltip focus and hiding logic * remove tooltip to editor click forward as it didn't work consistently remove unecessary insteractable tooltip click listener * add EntryTooltip.repopulated field for workaround * deobfuscate parent package * focus class selector when navigating to parent package from tooltip * scroll to class selector path when navigating from entry tooltip parent * move Config.persistentEditorQuickFind to EditorConfig.persistentQuickFind * rename config getter methods to match their ids and update Config javadoc * fix another tooltip focus issue * fix bug preventing RecordGetterFindingVisitor from finding inner records' getters make RecordGetterFindingVisitor's getter map accessible fix DeclarationSnippetPanel for record component getters * rename RecordGetterFindingVisitor -> RecordIndexingVisitor expand RecordGetterFindingVisitor to provide maps of record classes to their fields and methods make EntryTooltip show record field javadocs for record classes make EntryTooltip show record field javadocs for record getters if they don't have their own javadocs * clear things in visitEnd instead of visit clear fields and methods * fix for java 17 * tighten RecordIndexingVisitor encapsulation * make navigating to a record component getter with no explicit declaration navigate to its field instead * add nullable annotation * only set BaseEditorPanel.editor text once * fix typo * tweak moveMaintainingAnchor * close entry tooltip on key press * close tooltip on KEY_TYPED instead of KEY_PRESSED so ctrl+c can copy * add javaparser to lib list in README * cleanup createSnippet * fix swapped un/bounded names * make LineIndexer::getIndex return -1 for out-of-bounds positions, add LineIndexerTest * rename EditorTooltipSection -> EntryTooltipSection * limit EntryTooltip size * put main tooltip content in a scroll pane * focus snippet editor ui on source set remove main content scroll pane border * checkstyle * replace AtomicInteger gridY's with primitive ints * hard cap tooltip width at 600px (scaled) * expand parent package path when navigating from tooltip * explicitly check if source is bounded when setting 'Unable to locate declaration' message show <init> for constructor simple names * improve constructor name check * use 'inherited from' label for tooltip labels for entries that resolved to a parent * dispatch key events that close the entry tooltip to the previously focused component * close entry tooltip with global mouse listener * add gui for entry tooltip config * deduplicate check box sync logic * javadoc createSyncedCheckBox * javadoc syncStateWithConfig override * move tooltip management to EnitorPanel.TooltipManager add/remove EntryTooltip's global listeners on open/close reset TooltipManager on key presses * minor refactor * make 'tooltips' consistently plural in user-facing strings * dispatch KEY_PRESSED events that close entry tooltips (with exception for ctrl+c) * rework moveMaintainingAnchor when tooltip shrunk * move FeaturesSection.enableClassTreeStatIcons to StatsSection move FeaturesSection.autoSaveMappings to EditorConfig eliminate FeaturesSection * ensure RecordIndexingVisitor is cleared in visitEnd * make several tooltip string translatable * make a snippet string translatable
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.
Adds #140
based on #304rebasedNotes:
JTextAreas. I've tried usingJEditorPanels instead, and I've tried disabling the drag-to-move feature; neither helped.JToolTiporToolTipManagerbecause I couldn't get a customJToolTipto properly move+resize when the mouse moved to a new token. Instead it uses a customJWindowfor the tooltip and severalTimers to manage it.BaseEditorPanel), but I couldn't get two scroll panes to resize smartly in limited space (at least in aGridBagLayout, used to expand to fill width).Improvements to
RecordGetterFindingVisitor:RecordIndexingVisitorgetName()instead ofgetFullName()Also:
FeaturesSectionby movingenableClassTreeStatIconstoStatsSectionandautoSaveMappingstoEditorConfigThe tooltip:
The tooltip shows the parent, javadocs, and declaration snippet of the entry under the cursor.
Clicking the parent label or tokens within the declaration snippet updates the tooltip with that entry's info; control-clicking navigates to the entry. Control-clicking a top-level class' package navigates to that package. The tooltip may be moved by dragging from anywhere that doesn't have other click functionality.
Config
Tooltips and their interact-ability can each be disabled; configs are in a new
editor.tomlfile. This moves #304's persistent config toeditor.toml.editor.toml:Tasks:
EditorPanel)LineIndexer)add "bread crumbs" back button to go back to previous tooltip contentsnot tooltip-y