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

Observe lineNumber if there is no active selection or if the active selection does not contain the specified line number #176432

Merged
merged 3 commits into from Mar 7, 2023

Conversation

joyceerhl
Copy link
Contributor

No description provided.

… selection does not contain the specified line number
@joyceerhl joyceerhl enabled auto-merge (squash) March 7, 2023 19:52
@joyceerhl joyceerhl self-assigned this Mar 7, 2023
@VSCodeTriageBot VSCodeTriageBot added this to the March 2023 milestone Mar 7, 2023
extensions/github/src/links.ts Outdated Show resolved Hide resolved
extensions/github/src/links.ts Outdated Show resolved Hide resolved
@joyceerhl joyceerhl requested a review from Tyriar March 7, 2023 20:58
@@ -91,6 +86,12 @@ function getFileAndPosition(context: LinkContext): IFilePosition | INotebookPosi
return undefined;
}

function getRangeOrSelection(lineNumber: number | undefined) {
return lineNumber !== undefined && (!vscode.window.activeTextEditor || vscode.window.activeTextEditor.selection.isEmpty || !vscode.window.activeTextEditor.selection.contains(new vscode.Position(lineNumber - 1, 0)))
Copy link
Member

Choose a reason for hiding this comment

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

is this that same long conditional as the other PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, the link code is duplicated between desktop and vscode.dev :/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there's been discussion of centralizing it but it would be a lot more work than we're willing to invest (at least as of the last time it was discussed)

@joyceerhl joyceerhl merged commit 9c7113f into main Mar 7, 2023
6 checks passed
@joyceerhl joyceerhl deleted the dev/joyceerhl/polite-silkworm branch March 7, 2023 22:23
@github-actions github-actions bot locked and limited conversation to collaborators Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants