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

Set context keys for cell language when background is painted #608

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

Conversation

juliasilge
Copy link
Collaborator

This is a revamp of the work in #607.

Unfortunately after I started trying to use this in Positron, it just wasn't early enough or quick enough to set these context keys in languageAtPosition(). I believe that only gets called if we are trying to do one of these:

export type VirtualDocAction =
"completion" |
"hover" |
"signature" |
"definition" |
"format" |
"statementRange" |
"helpTopic";

It's just not enough, especially if you are switching back and forth between different files; it's very easy to get in a state where you end up with R shortcuts in Python chunks and there are lots of kinds of edits I could make that did not trigger one of these.

New idea! This PR tries out setting these context keys when we paint the background. In my experience so far, this feels a lot better, and we already are identifying all the tokens so not much extra work.

@juliasilge
Copy link
Collaborator Author

Related to posit-dev/positron#5451

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.

1 participant