Open Ark-kun opened 4 years ago
The exception should not affect LS since it should be handled.
The issue with squiggles is not the parser, it is when somehow text buffer goes out of sync between LS and VS Code. We haven't been able to repro reliable. Fixed some suspicious places, but occasionally it still shows up. https://github.com/microsoft/python-language-server/issues/1637
Does it happen right from the start when you open project and LS starts or shows up some time later?
Does it happen right from the start when you open project and LS starts or shows up some time later?
It usually happens after a long time. Days or weeks of editing.
Happened again on
Python: v2020.8.108011 Vscode: Version: 1.48.2 (user setup) Commit: a0479759d6e9ea56afa657e454193f72aef85bd0 Date: 2020-08-25T10:13:11.295Z (1 mo ago) Electron: 7.3.2 Chrome: 78.0.3904.130 Node.js: 12.8.1 V8: 7.8.279.23-electron.0 OS: Windows_NT x64 10.0.18362
![image](https://user-images.githubusercontent.com/1829149/94356036-a15b0000-003e-11eb-93ec-5e0d69675d5b.png)
Please try Pylance language service. Thanks.
Environment data
"python.jediEnabled"
set to; more info microsoft/vscode-python#3977): Jedipython.languageServer
setting: MicrosoftExpected behaviour
I expect python parser, linter and intellisense to remain sane.
Actual behaviour
First comes linter amnesia. Linter stops recognizing some (say, every 5th) pythons standard library imports, function parameters, functions etc ("undefined variable"). Then the parser starts going mad. It starts blabbling nonsense and putting red squiggles under, say part of the called function name (not the whole name) or starts complaining about completely empty lines. Then the parser goes completely mad. See the screenshot: See, for example, how it gets mad about the following line:
Reopening the file does not solve the problem.
Steps to reproduce:
Use VSCode to edit python files for awhile.
Logs
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)``` ~\AppData\Local\Programs\Python\Python37\python.exe c:\Users\Ark\.vscode\extensions\ms-python.python-2020.4.74986\pythonFiles\pyvsc-run-isolated.py pylint --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text a:\_All\My.Work\2018.Google\pipelines_worktree3\sdk\python\kfp\components\_components.py cwd: a:\_All\My.Work\2018.Google\pipelines_worktree3 > ~\AppData\Local\Programs\Python\Python37\python.exe c:\Users\Ark\.vscode\extensions\ms-python.python-2020.4.74986\pythonFiles\pyvsc-run-isolated.py pylint --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text a:\_All\My.Work\2018.Google\pipelines_worktree3\sdk\python\kfp\components\_components.py cwd: a:\_All\My.Work\2018.Google\pipelines_worktree3 ##########Linting Output - pylint########## ************* Module kfp.components._components ... 28,0,warning,unused-wildcard-import:Unused import ModelBase from wildcard import 28,0,warning,unused-wildcard-import:Unused import v1 from wildcard import -------------------------------------------------------------------- Your code has been rated at -6.46/10 (previous run: -7.47/10, +1.01) ```
Output from
Console
under theDeveloper Tools
panel (toggle Developer Tools on underHelp
; turn on source maps to make any tracebacks be useful by runningEnable source map support for extension debugging
)``` [Extension Host] Info Python Extension: 2020-05-08 00:33:38: Get Interpreters, Class name = m, completed in 3ms, has a truthy return value, Arg 1:, Return Value: [{"architecture":3,"path":"C:\\Users\\Ark\\AppData\\Local\\Programs\\Python\\Python36\\python.exe","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.6.8-final","major":3,"minor":6,"patch":8,"prerelease":["final"],"build":[],"version":"3.6.8-final"},"sysPrefix":"C:\\Users\\Ark\\AppData\\Local\\Programs\\Python\\Python36","fileHash":"d8960e12ef07ddaee6375e767551fbfd0694ab5d58f1d8622d33f38c6fe51446664190bf3ac8243070f7c81292f440552fcc9dbe98bd725da821975be7805025","companyDisplayName":"Python Software Foundation","type":"Unknown"},{"architecture":3,"path":"C:\\Users\\Ark\\AppData\\Local\\Programs\\Python\\Python37\\python.exe","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.4-final","major":3,"minor":7,"patch":4,"prerelease":["final"],"build":[],"version":"3.7.4-final"},"sysPrefix":"C:\\Users\\Ark\\AppData\\Local\\Programs\\Python\\Python37","fileHash":"d591d478a633ceff71969a58af7ba651bb29d7736de0b464e7c67e8f7b5d156de6b92ce7af76e761879b679422a72aec2efbf3569b890f0b764651097b5f7b6e","companyDisplayName":"Python Software Foundation","type":"Unknown"},{"architecture":3,"path":"C:\\Users\\Ark\\AppData\\Local\\Programs\\Python\\Python38\\python.exe","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.8.0-final","major":3,"minor":8,"patch":0,"prerelease":["final"],"build":[],"version":"3.8.0-final"},"sysPrefix":"C:\\Users\\Ark\\AppData\\Local\\Programs\\Python\\Python38","fileHash":"ed512353e78684e176ddff3b84fe349ab306ec6012a7b002a86592a2eb55cba0908251c2a10e82d4834e45d329f860b4eda06f1b6ff428a4c58613d3c0de1933","companyDisplayName":"Python Software Foundation","type":"Unknown"},{"architecture":3,"path":"C:\\Users\\Ark\\.conda\\envs\\cntk-py36\\python.exe","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.6.3-final","major":3,"minor":6,"patch":3,"prerelease":["final"],"build":[],"version":"3.6.3-final"},"sysPrefix":"C:\\Users\\Ark\\.conda\\envs\\cntk-py36","fileHash":"a0bd41de85351be4071992206e7ffed3fb9e599cd024a75736f319df12ba9410bff6663c6366192c5d63e3f19d48f8f823083ff77ea7cf831a19ea8260d7b0bb","companyDisplayName":"Custom environment","type":"Conda","envName":"cntk-py36","envPath":"C:\\Users\\Ark\\.conda\\envs\\cntk-py36"},{"architecture":3,"path":"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python37_64\\python.exe","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.3-final","major":3,"minor":7,"patch":3,"prerelease":["final"],"build":[],"version":"3.7.3-final"},"sysPrefix":"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python37_64","fileHash":"8b14b406fe0312567826cda18b2ef868b1e9b5efae0f9a42957223ce946b08797d08ea2ca2ff928f5bd93803962851270e572cfa8e3eac63e248ef703cbc1ae5","companyDisplayName":"Python Software Foundation","type":"Unknown"},{"architecture":3,"path":"C:\\Users\\Ark\\.conda\\envs\\tensorflow35\\python.exe","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.5.3-final","major":3,"minor":5,"patch":3,"prerelease":["final"],"build":[],"version":"3.5.3-final"},"sysPrefix":"C:\\Users\\Ark\\.conda\\envs\\tensorflow35","fileHash":"a3a5a8b24569b4c7f3168897abccc23a3d6d37348b387b92dc3876432086347fd57d7837cd172f8d69b046f877269365f014b6d2c0b7d8553ed8706f3cc81305","companyDisplayName":"Anaconda, Inc.","type":"Conda","envPath":"C:\\Users\\Ark\\.conda\\envs\\tensorflow35","envName":"tensorflow35"}]
```
Python language server logs only have intellisense exceptions: