eclipse-theia / theia

Eclipse Theia is a cloud & desktop IDE framework implemented in TypeScript.
http://theia-ide.org
Eclipse Public License 2.0
20.08k stars 2.5k forks source link

Pyflakes and pycodestyle always on #6415

Open dannaf opened 5 years ago

dannaf commented 5 years ago

Description

With the vscode python extension and the @theia/python python language server, I am trying to use pylint as the only linter. However, pyflakes and pycodestyle keep sending messages too, and I do not see a setting to turn those off.

I would like to avoid duplicate warnings by having multiple linters complaining on the same things. And I would like to control if pyflakes and pycodestyle are on. (Seems those are coming from the python language server, so maybe this whole thing has nothing to do with the vscode python extension, but this is my usecase currently is with running both).

Reproduction Steps

Build from source the Theia browser example, v0.11.0, with the @theia/python module, and then load the vscode python extension via the Load plugin by id command using vscode:extension/ms-python.python Select pylint as the linter Make sure linting is on Open python code or write sample, e.g. import requests Wait for linting to process Mouseover the warnings and observe carefully that sometimes the messages come from any of pylint, pyflakes, or pycodestyle

OS and Theia version: Windows 10, Chrome 77, Theia 1a8188

Diagnostics:

akosyakov commented 5 years ago

With the vscode python extension and the @theia/python python language server

@theia/python is not a language server, but a Theia extension around the same python language server which is used by the VS Code extension. One should use either Theia or VS Code extension. Using both will produce double functionality.

dannaf commented 5 years ago

Thanks! However, I think there are the following issues:

With the vscode extension in theia, linting seems buggy. Pylint often does not activate on documents (although sometimes it does..). Also, there is no icon in the status bar at the bottom for the linting activity, like there is in vscode, so it is hard to tell if theia is working on linting in the background and just not ready yet or if it has failed to lint.

Secondly, the theia-python extension does not seem to expose the settings of the python language server, which would be great. For instance, there are discussions (here, here) that the palantir python language server can handle its own configuration settings to disable its linting plugins, along the style of: "pyls.plugins.pydocstyle.enabled": true. It would be great to be able to set this setting of the underlying pyls through the Theia preferences interface.

There is of course the option to turn off linters via linter specific config files (e.g. here/here), but I think such changing of the file tree shouldn't be necessary for turning off linters entirely, which could be a tool configuration instead. Also, in my attempt so far this has failed as the theia-python extension did not seem to be reacting to a .pylintrc file in the workspace root directory...

Let me know your thoughts and if you want some of these as separate issues..

akosyakov commented 5 years ago

@dannaf thanks for the detailed report cc @AlexTugarev

AlexTugarev commented 4 years ago

Hi @dannaf! Thanks for detailing this out. I just compared Python checks of the vscode extension running in VS Code and Theia, but couldn't see any difference.

You're mentioning the status bar progress for the linter, I couldn't see that in vscode, do you have an example how to reproduce it?

Also, I think the new language services are preferable to the old pyls/jedi, which can be activated by setting the python.jediEnabled preference to false. Diagnostics provided then usually appear quicker and look nicer.

On @theia/python: I'm not aware on any plans to improve the integration of pyls in any way. I'm personally considering this as deprecated, and we should consider moving it to a separate repo. That being said, contributors are welcome to improve it if there is interested in there!