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

diagnostics should show less aggressively when typing code in an editor #979

Open
jjallaire opened this issue Aug 8, 2023 · 11 comments
Open
Labels
area: core Issues related to Core category. sharp-edge

Comments

@jjallaire
Copy link
Contributor

jjallaire commented Aug 8, 2023

At least in Python, we currently have a very happy trigger finger with showing diagnostics (both in the console and in the source editor, though we're dealing with the console in a separate issue #1114). For example, if you simply enter this:

>>> x = 

You will get a red underline indicating an "error" in your code:

Screen Shot 2023-08-08 at 1 49 04 PM

Especially for less experienced developers I think this will be at best annoying and at worst provoke users to actually figure out "what's wrong" with the code they just entered.

I think we need a fancier set of heuristics for when to show diagnostics around active edits. One thing I've seen work well is to never show diagnostics on the line where the cursor currently is. We could also never show diagnostics if the current line is empty. Another thing we could do is have diagnostics run debounced over a longer period (e.g. 3 seconds). The goal is to never mis-detect and incomplete edit as an error or warning.

We'll need to play around with different strategies in order to get this just right.

@jjallaire jjallaire added this to the Internal Preview milestone Aug 8, 2023
@seeM

This comment was marked as off-topic.

@jmcphers

This comment was marked as off-topic.

@juliasilge

This comment was marked as off-topic.

@kevinushey

This comment was marked as off-topic.

@petetronic

This comment was marked as off-topic.

@jmcphers

This comment was marked as off-topic.

@petetronic
Copy link
Collaborator

petetronic commented Aug 18, 2023

We're going to deal with the Console in a different issue #1114, this one will remain focused on the speed of which diagnostics show up while you're typing in the editor.

@softwarenerd softwarenerd changed the title diagnostics should show less aggressively when typing code diagnostics should show less aggressively when typing code in an editor Aug 21, 2023
@petetronic
Copy link
Collaborator

petetronic commented Sep 6, 2023

Moving this to after Alpha but keeping the priority high as the experience doesn't meet our expectations for release.

@petetronic
Copy link
Collaborator

Would a simple first approach be to just not show diagnostics on the current line? Would this be too much to suppress?

@juliasilge
Copy link
Contributor

This came up during our alpha user feedback session. The specific situation cited was opening a quote for a string, which causes the rest of your file to suddenly get highlighted as a string (huge color change which feels like flashing).

@kevinushey
Copy link
Contributor

The specific situation cited was opening a quote for a string, which causes the rest of your file to suddenly get highlighted as a string

Shouldn't this normally be handled by auto-pairing of quote characters?

I think RStudio also dodges a bit of this pain by delaying the highlight / tokenization of lines later in the document; waiting for the user to be idle for ~700ms or so.

@wesm wesm added area: core Issues related to Core category. sharp-edge labels Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: core Issues related to Core category. sharp-edge
Projects
None yet
Development

No branches or pull requests

8 participants