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

Provide the ability to turn off live error reporting in the new language server #2270

Closed
jiagengliu opened this issue Jul 28, 2018 · 10 comments · Fixed by #2357
Closed

Provide the ability to turn off live error reporting in the new language server #2270

jiagengliu opened this issue Jul 28, 2018 · 10 comments · Fixed by #2357
Assignees
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. feature-request Request for new features or functionality

Comments

@jiagengliu
Copy link

Environment data

  • VS Code version: 1.25.1
  • Extension version (available under the Extensions sidebar): 2018.7.1
  • OS and version: Windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): Anaconda 5.1.0
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Relevant/affected Python packages and their versions: Python

Actual behavior

After updating to 1.25.1, there are frequent messages (per second) of [Python (parser)] errors as I type a line. Is there a way to tell the Python parser to only parse upon save? I can't find the settings for parser in Settings.

Expected behavior

Only parse on save.

Steps to reproduce:

  1. Open up test.py
  2. Type a =

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

[Python (parser)] unexpected token '<newline>' (1, 5)"
@brettcannon brettcannon added feature-request Request for new features or functionality area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. needs decision labels Jul 30, 2018
@brettcannon
Copy link
Member

@jiagengliu no setting, but we will think about adding this as a feature enhancement.

@brettcannon
Copy link
Member

And another option is to put a timer on the trigger so that it only happens if you haven't typed in e.g. 5 seconds.

@brettcannon brettcannon changed the title Let Python parser parse only on save Provide the ability to turn off live error reporting in the new language server Aug 1, 2018
@MikhailArkhipov
Copy link

MikhailArkhipov commented Aug 6, 2018

Generally this is normal behavior, happens in VS and other products as well as I type. We can throttle diagnostic output a bit and maybe add a setting for the delay.

The parser and code analysis is live and runs as you type. There is no option to get run just sometimes.

@MikhailArkhipov MikhailArkhipov self-assigned this Aug 6, 2018
@DonJayamanne
Copy link

DonJayamanne commented Aug 7, 2018

We can throttle diagnostic output a bit and maybe

I'd say that's what we should do, would also save CPU cycles.

I also feel 5secs is too long for reporting of syntax errors. Feels like forever, especially for novice developers using vscode to learn python.
Can I suggest 1-1.5s?
I feel 1s is also good even though the user has complained about the noise. It depends on how quickly users type as well. Would check other editors to come up with an optimal number.

@jiagengliu
Copy link
Author

Is there an option to turn it off completely?

@MikhailArkhipov
Copy link

MikhailArkhipov commented Aug 7, 2018

@jiagengliu - no.
@DonJayamanne - yes, it is going to be 1000 default. PR is up in PTVS. microsoft/PTVS#4612

Will add settings to VS Code then

@MikhailArkhipov
Copy link

Probably won't have much CPU since throttling is just delaying of the notification from LS to VSC. so if pending errors get cleared, they will never get reported. Some traffic save I guess.

@zooba
Copy link
Member

zooba commented Aug 8, 2018

Typically in VS we don't start processing text until you've stopped typing for 0.5-1s or you press Enter (and errors show up shortly afterwards). Not sure if we can do the same thing in Code...

@MikhailArkhipov
Copy link

Setting added via microsoft/PTVS#4612

@jiagengliu
Copy link
Author

Thank you so much! @MikhailArkhipov

@lock lock bot locked as resolved and limited conversation to collaborators Sep 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. feature-request Request for new features or functionality
Projects
None yet
5 participants