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

Language server doesnt lint errors #9577

Closed
davfsa opened this issue Jan 14, 2020 · 11 comments
Closed

Language server doesnt lint errors #9577

davfsa opened this issue Jan 14, 2020 · 11 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@davfsa
Copy link

davfsa commented Jan 14, 2020

Environment data

  • VS Code version: 1.41
  • Extension version (available under the Extensions sidebar): 2020.1.58038
  • OS and version: Ubuntu 19.10
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.8.0
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
  • Relevant/affected Python packages and their versions: All in general
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info How to update the language server to the latest stable version #3977): Jedi=false Python Language Server=0.5.10.0

Expected behaviour

Error highlighting works

Actual behaviour

Error highlighting works

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. Open a python file and type something that is not right, eg test
  2. Observe the laguage server not working

Logs

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

User belongs to experiment group 'ShowPlayIcon - start'
User belongs to experiment group 'ShowExtensionSurveyPrompt - control'
User belongs to experiment group 'DebugAdapterFactory - experiment'
> conda --version
> pyenv root
> python3.7 -c "import sys;print(sys.executable)"
> python3.6 -c "import sys;print(sys.executable)"
> python3 -c "import sys;print(sys.executable)"
> python2 -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> ~/coding/python/hikari/.venv/bin/python -c "import sys;print(sys.executable)"
> conda info --json
Starting Microsoft Python language server.
> conda --version

Language Server Output:

[Info  - 6:36:28 PM] Analysis cache path: /home/davfsa/snap/code/common/.cache/Microsoft/Python Language Server
[Info  - 6:36:28 PM] Microsoft Python Language Server version 0.5.10.0
[Info  - 6:36:28 PM] Workspace root: /home/davfsa/coding/python/hikari
[Info  - 6:36:28 PM] GetCurrentSearchPaths /home/davfsa/coding/python/hikari/.venv/bin/python 
[Info  - 6:36:28 PM] Interpreter search paths:
[Info  - 6:36:28 PM]     /home/davfsa/coding/python/hikari/.venv/lib/python3.8
[Info  - 6:36:28 PM]     /home/davfsa/coding/python/hikari/.venv/lib/python3.8/lib-dynload
[Info  - 6:36:28 PM]     /usr/lib/python3.8
[Info  - 6:36:28 PM]     /home/davfsa/coding/python/hikari/.venv/lib/python3.8/site-packages
[Info  - 6:36:28 PM] User search paths:
[Info  - 6:36:29 PM] Initializing for /home/davfsa/coding/python/hikari/.venv/bin/python
[Info  - 6:36:29 PM] Analysis caching mode: None.

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)

Noticed this 2 errors:

Notification handler 'textDocument/publishDiagnostics' failed with message: Cannot read property 'connected' of undefined

(node:6100) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

If any further info is needed, please dont hesitate to ask

@davfsa davfsa added triage-needed Needs assignment to the proper sub-team bug Issue identified by VS Code Team member as probable bug labels Jan 14, 2020
@karthiknadig karthiknadig self-assigned this Jan 14, 2020
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Jan 14, 2020
@karthiknadig
Copy link
Member

@davfsa Are you using pylint? Also, in the Output logs do you see anything error or info specfic to the linter you are using?

@davfsa
Copy link
Author

davfsa commented Jan 14, 2020

@karthiknadig I have pylint installed, but i have it disabled on VSCode.

I recently moved from Windows to Ubuntu. In windows, all the linting was being done by the Language Server, which meant that it linted as I typed. After 2 days of using VSCode on ubuntu, python linting stopped working

And yea, i found another error in Output:

Error Python Extension: 2020-01-14 22:53:06: Failed to serialize gatherRules for DATASCIENCE.SETTINGS [TypeError: Cannot convert object to primitive value	at Array.join (<anonymous>)	at Array.toString (<anonymous>)	at /home/davfsa/.vscode/extensions/ms-python.python-2020.1.58038/out/client/extension.js:1:12901	at Array.forEach (<anonymous>)	at Object.l [as sendTelemetryEvent] (/home/davfsa/.vscode/extensions/ms-python.python-2020.1.58038/out/client/extension.js:1:12818)	at C.sendSettingsTelemetry (/home/davfsa/.vscode/extensions/ms-python.python-2020.1.58038/out/client/extension.js:75:707093)	at C.r.value (/home/davfsa/.vscode/extensions/ms-python.python-2020.1.58038/out/client/extension.js:1:87512)	at Timeout._onTimeout (/home/davfsa/.vscode/extensions/ms-python.python-2020.1.58038/out/client/extension.js:1:86031)	at listOnTimeout (internal/timers.js:531:17)	at processTimers (internal/timers.js:475:7)]
t.log @ console.ts:137
console.ts:137 

Althought I dont think it has anything to do with my problem

I have tried updating the Language Server, but it still wont work

@ghost
Copy link

ghost commented Jan 16, 2020

Try flake8. pylint is not working with latest version of this extension.

@davfsa
Copy link
Author

davfsa commented Jan 16, 2020

@sys-temd im not looking to use a linter like pylint or flake8 (since i dont want to save all the time to check the linting). I want the language server to automatically do the linting like it did in Windows

@ericloewe
Copy link

@davfsa Reverting to 2019.11.50794 works around this.

@ghost
Copy link

ghost commented Jan 16, 2020

@davfsa I also checked whether linting by Python Language Server is working or not. It seems both pylint and linting by language server is not working with latest version. But flake8 is working.

@davfsa
Copy link
Author

davfsa commented Jan 16, 2020

@ericloewe omg, thank you. I tried rolling back when this happened, but only to the fist 2020. Again, thx a lot

@karthiknadig I think @sys-temd 's comment might help you narrow down the bug.

Hope you can solve the bug, ik how annoying things like this can get

@ghost
Copy link

ghost commented Jan 17, 2020

Found the bug. Extension is not picking up modified settings from your Workspace GUI settings menu. Unless you explicitly mention:

"python.jediEnabled": false,

in your workspace folder .vscode>settings.json, Microsoft Python Language server is not treated as enabled regardless of what your in-Workspace GUI settings say. This bug is also affecting pylint but not flake8 . Unless you mention:

"python.linting.pylintEnabled": true,
"python.linting.enabled": true

pylint refuses to work.

@nicolaerario
Copy link

nicolaerario commented Jan 17, 2020

Seems only reverting to 2019.11.50794 as @ericloewe sayd fix the problem: language server can lint.
otherwise must explicit declare on workspace settings to enable linting also specifying the linter

@luabud
Copy link
Member

luabud commented Jan 17, 2020

@sys-temd thanks for providing those details 😊

There's this known bug about pylint not working when the Language Server is on: #7314.

About the bug you mentioned when modifying settings, I think this may be the same issue you're having: #7314 (comment)

@karthiknadig
Copy link
Member

This is related as well #9649

@ghost ghost removed the triage label May 13, 2020
@lock lock bot locked as resolved and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

5 participants