Skip to content
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

Support link matcher start position #2468

Closed
jmbockhorst opened this issue Oct 12, 2019 · 1 comment · Fixed by #2470
Closed

Support link matcher start position #2468

jmbockhorst opened this issue Oct 12, 2019 · 1 comment · Fixed by #2470
Labels
area/api help wanted type/enhancement Features or improvements to existing features

Comments

@jmbockhorst
Copy link
Contributor

The registerLinkMatcher() should support returning the row and column position of the link so it can be used for position the hover message. Related to microsoft/vscode#77964.

For VSCode, I believe this is needed in order to match the terminal link experience (the popup starts where the link starts) to the rest of the editor. Currently, there is no way to get the position of the link, and the hover position is just the mouse position, which is inconsistent.

@Tyriar Tyriar added area/api help wanted type/enhancement Features or improvements to existing features labels Oct 14, 2019
@Tyriar
Copy link
Member

Tyriar commented Oct 14, 2019

Right now you only get the MouseEvent and uri from the tooltipCallback:

export interface ILinkMatcherOptions {
  tooltipCallback?: (event: MouseEvent, uri: string) => boolean | void;
}

How about this?

// This is just `ISelectionPosition` but we're interested in the viewport only, not whole buffer
export interface ILinkLocation {
    startColumn: number;
    startRow: number;
    endColumn: number;
    endRow: number;
}

export interface ILinkMatcherOptions {
  tooltipCallback?: (event: MouseEvent, uri: string, ILinkLocation) => boolean | void;
}

Coupled with the ability to get the dimensions of the cells from #702, this would let us expose this information without getting into pixel coordinates (which get complicated as they could be relative to different things).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api help wanted type/enhancement Features or improvements to existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants