Skip to content

Jump To Definition #348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 51 commits into
base: main
Choose a base branch
from

Conversation

thecoolwinter
Copy link
Collaborator

@thecoolwinter thecoolwinter commented Jul 30, 2025

Description

Adds jump to definition, including a new key command (control-command-J) to initiate a jump, and an interaction (command + mouse click). The destination(s) for a jump is provided via a new object protocol, provided via the SwiftUI API. The popover presented when multiple links are present reuses the completion window, with a slight modification so that it appears as a popover with an arrow rather than a floating window.

Detailed changes:

  • Numerous fixes and improvements to the SuggestionController and SuggestionViewController, making them work when presented as a popover, as well as some resizing bugs.
  • New CodeSuggestionPreviewView. Displays preview information for a code suggestion, including a syntax-highlighted source preview, documentation, and a path component.
    • This only appears when one of the three potential information is available, otherwise it is hidden.
    • This view is a visual effect view, so it will inherit the style of the suggestion controller from the user's theme with a slight tint.
  • New JumpToDefinitionModel manages the mouse interaction, as well as providing the layer between the jump delegate and the code suggestion window.
  • New JumpToDefinitionDelegate protocol defines how the editor can use the delegate object to query links and open them once selected.

Related Issues

Checklist

  • I read and understood the contributing guide as well as the code of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • My changes are all related to the related issue above
  • I documented my code

Screenshots

Screen.Recording.2025-07-29.at.4.06.50.PM.mov

FastestMolasses and others added 30 commits October 19, 2024 22:31
- Creates a `SuggestionViewController` for managing the view contents of the window.
- Renames `SuggestionControllerDelegate` to `CodeSuggestionDelegate`
- Moves `CodeSuggestionEntry` to its own file.
- Removes a few magic numbers
- Removes the `horizontalOffset` parameter when moving the window. We'll rely on the suggestion delegate to tell us where to place the window's top-left corner.
@@ -1,4 +1,4 @@
//
z//
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intentional?

Suggested change
z//
//

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants