Skip to content

Add editorLineNumber context key - #176659

Merged
Joyce Er (joyceerhl) merged 1 commit into
mainfrom
dev/joyceerhl/alert-centipede
Mar 9, 2023
Merged

Joyce Er (joyceerhl) merged 1 commit into
mainfrom
dev/joyceerhl/alert-centipede

Conversation

@joyceerhl

Copy link
Copy Markdown
Contributor

Re: #175945

const anchor = { x: e.event.posx, y: e.event.posy };
const lineNumber = e.target.position.lineNumber;

const contextKeyService = this.contextKeyService.createOverlay([['editorLineNumber', lineNumber]]);

@connor4312 Connor Peet (connor4312) Mar 9, 2023 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think you need to dispose this after you close the menu.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I was wondering about that, but every other consumer of createOverlay doesn't dispose it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Maybe worth an issue for the other cases then--and I'll update this PR to dispose it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It looks like dispose no-ops on it, so probably okay.

@connor4312 Connor Peet (connor4312) Mar 9, 2023 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think the better thing would splitting out the IContextKeyService interface so that .dispose() doesn't have to be defined on something that doesn't need to be disposed.

@joyceerhl
Joyce Er (joyceerhl) merged commit b86be33 into main Mar 9, 2023
@joyceerhl
Joyce Er (joyceerhl) deleted the dev/joyceerhl/alert-centipede branch March 9, 2023 17:41
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 23, 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.

3 participants