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

No error reported when pyrightconfig.json can't be parsed #120

Closed
russelldavis opened this issue Jul 15, 2020 · 4 comments
Closed

No error reported when pyrightconfig.json can't be parsed #120

russelldavis opened this issue Jul 15, 2020 · 4 comments
Labels
enhancement New feature or request fixed in next version (main) A fix has been implemented and will appear in an upcoming version

Comments

@russelldavis
Copy link

To reproduce, just add a trailing comma to the last item in the file (an easy mistake many will make).

Expected behaviour

An error should show up in the vscode Problems panel. Also, the error should show up in the logs at logLevel "error".

Actual behaviour

No errors are reported. An error only shows up in the logs if you change the value of python.analysis.logLevel to "Info" or greater severity.

Environment data

  • Language Server version: Pylance 2020.7.1
  • OS and version: macOS 10.15.5
  • Python version: 3.8
@erictraut
Copy link
Contributor

Thanks for the suggestion.

I agree that this should be logged as an error, not at the "info" level.

It will already appear in the Problems panel if you open the file. The JSON language server will report it as a problem. I don't think that Pylance should report a diagnostic separately. That would be inconsistent with every other language server that I'm aware of. For example, the TypeScript LS doesn't report a diagnostic if the tsconfig.json file has parse issues.

@russelldavis
Copy link
Author

Ah, that's reasonable. I didn't catch it because I edited the json file in a different editor. I wish there was a way to tell vscode to run diagnostics on all files in the project, including json, even if they aren't open. But that's an issue for vscode, not pylance.

@erictraut
Copy link
Contributor

I've reviewed all logging done by the Pyright server and updated the log levels for numerous log messages, including the "can't parse config file" message. This will be included in the next version of Pylance/Pyright.

@erictraut erictraut added enhancement New feature or request fixed in next version (main) A fix has been implemented and will appear in an upcoming version labels Jul 16, 2020
@jakebailey
Copy link
Member

This issue has been fixed in version 2020.7.3, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/master/CHANGELOG.md#202073-21-july-2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fixed in next version (main) A fix has been implemented and will appear in an upcoming version
Projects
None yet
Development

No branches or pull requests

3 participants