Title: Unexpected syntax errors about random tokens · Issue #1449 · microsoft/python-language-server · GitHub
Open Graph Title: Unexpected syntax errors about random tokens · Issue #1449 · microsoft/python-language-server
X Title: Unexpected syntax errors about random tokens · Issue #1449 · microsoft/python-language-server
Description: Environment data VS Code version: Code 1.37.1 (f06011ac164ae4dc8e753a3fe7f9549844d15e35, 2019-08-15T16:17:55.855Z) Extension version (available under the Extensions sidebar): 2019.8.30787 OS and version: Windows_NT x64 10.0.18362 Python ...
Open Graph Description: Environment data VS Code version: Code 1.37.1 (f06011ac164ae4dc8e753a3fe7f9549844d15e35, 2019-08-15T16:17:55.855Z) Extension version (available under the Extensions sidebar): 2019.8.30787 OS and ve...
X Description: Environment data VS Code version: Code 1.37.1 (f06011ac164ae4dc8e753a3fe7f9549844d15e35, 2019-08-15T16:17:55.855Z) Extension version (available under the Extensions sidebar): 2019.8.30787 OS and ve...
Opengraph URL: https://github.com/microsoft/python-language-server/issues/1449
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unexpected syntax errors about random tokens ","articleBody":"\u003c!-- Please search existing issues to avoid creating duplicates. -->\r\n\r\n## Environment data\r\n\r\n- VS Code version: Code 1.37.1 (f06011ac164ae4dc8e753a3fe7f9549844d15e35, 2019-08-15T16:17:55.855Z)\r\n- Extension version (available under the Extensions sidebar): 2019.8.30787\r\n- OS and version: Windows_NT x64 10.0.18362\r\n- Python version (& distribution if applicable, e.g. Anaconda): Python 3.6.4 64-bit\r\n- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A\r\n- Relevant/affected Python packages and their versions: XXX\r\n- Jedi or Language Server? (i.e. what is `\"python.jediEnabled\"` set to; more info microsoft/vscode-python#3977): Language Server\r\n\r\n## Expected behaviour\r\n\r\nI have been using the language server and pylint and everything was fine until recently. However, now from time to time I experience random parsing errors on tokens that are not even in the file.\r\n\r\n## Actual behaviour\r\nAs shown in the figure below, the parser shouts these errors regarding \"eman\", \"tnuococa\", which are not in the file. There are other errors also. The actual file can be executed normally by an interpreter.\r\n\r\nAfter inspecting the logs below, my guess is that it has something to do with this `sol.py.4f805ae93a314088ee8dc430f8bf5945.py` file. The actual file name is `sol.py` so the other file is probably some temp file generated during the execution of the extension.\r\n\r\n\r\n\r\n\r\n```python\r\nfrom typing import List\r\n\r\n\r\nclass Solution:\r\n def accountsMerge(self, accounts: List[List[str]]) -> List[List[str]]:\r\n # * set and map\r\n\r\n account_map = {}\r\n\r\n for account in accounts:\r\n name = account[0]\r\n```\r\n\r\n## Steps to reproduce:\r\n1. I can't really find an exact way to reproduce this. Usually when I first open a file the parser works fine. Some time later during editing it breaks. Reloading the window solves the problem temporarily.\r\n\r\n\u003c!--\r\nNote: If you think a GIF of what is happening would be helpful, consider tools like https://www.cockos.com/licecap/, https://github.com/phw/peek or https://www.screentogif.com/ .\r\n-->\r\n\r\n## Logs\r\nThe real project path has been replaced by `\u003cproject_path>` for privacy concerns. It only contains English letters (`a-zA-Z`) and backslashes.\r\n\r\nOutput for `Python` in the `Output` panel (`View`→`Output`, change the drop-down the upper-right of the `Output` panel to `Python`)\r\n\r\n```\r\nUser belongs to experiment group 'ShowPlayIcon - runFile'\r\n> conda --version\r\n> pyenv root\r\n> python3.7 -c \"import sys;print(sys.executable)\"\r\n> python3.6 -c \"import sys;print(sys.executable)\"\r\n> python3 -c \"import sys;print(sys.executable)\"\r\n> python2 -c \"import sys;print(sys.executable)\"\r\n> python -c \"import sys;print(sys.executable)\"\r\n> py -3.7 -c \"import sys;print(sys.executable)\"\r\n> py -3.6 -c \"import sys;print(sys.executable)\"\r\n> py -3 -c \"import sys;print(sys.executable)\"\r\n> py -2 -c \"import sys;print(sys.executable)\"\r\n> C:\\Programs\\Python3.6\\python.exe -c \"import sys;print(sys.executable)\"\r\n> conda info --json\r\nStarting Microsoft Python language server.\r\n[Info - 9:04:53 PM] Analysis cache path: C:\\Users\\luhao\\AppData\\Local\\Microsoft\\Python Language Server\r\n[Info - 9:04:53 PM] GetCurrentSearchPaths C:\\Programs\\Python3.6\\python.exe \r\n[Info - 9:04:53 PM] Interpreter search paths:\r\n[Info - 9:04:53 PM] c:\\programs\\python3.6\\dlls\r\n[Info - 9:04:53 PM] c:\\programs\\python3.6\\lib\r\n[Info - 9:04:53 PM] c:\\programs\\python3.6\r\n[Info - 9:04:53 PM] c:\\programs\\python3.6\\lib\\site-packages\r\n[Info - 9:04:53 PM] User search paths:\r\n[Info - 9:04:56 PM] Microsoft Python Language Server version 0.3.47.0\r\n[Info - 9:04:56 PM] Initializing for C:\\Programs\\Python3.6\\python.exe\r\n> conda info --json\r\n> conda --version\r\n> C:\\Programs\\Python3.6\\python.exe -m black -S --diff --quiet \u003cproject_path>\\701-800\\721\\sol.py.4f805ae93a314088ee8dc430f8bf5945.py\r\ncwd: \u003cproject_path>\r\n> C:\\Programs\\Python3.6\\python.exe -m black -S --diff --quiet \u003cproject_path>\\701-800\\721\\sol.py.4f805ae93a314088ee8dc430f8bf5945.py\r\ncwd: \u003cproject_path>\r\n\r\n```\r\n\r\nOutput 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`)\r\n\r\n```\r\n(...)\r\nconsole.ts:137 [Extension Host] No editors associated with document: \u003cproject_path>\\701-800\\721\\sol.py\r\nt.log @ console.ts:137\r\nconsole.ts:137 [Extension Host] Info Python Extension: 2019-08-15 21:05:01: Cached data exists getEnvironmentVariables, \u003cproject_path>\r\nnotificationsAlerts.ts:40 Black does not support the \"Format Selection\" command\r\nonDidNotificationChange @ notificationsAlerts.ts:40\r\nconsole.ts:137 [Extension Host] swdc-vscode: storing kpm metrics\r\nconsole.ts:137 [Extension Host] Info Python Extension: 2019-08-15 21:06:07: Cached data exists getEnvironmentVariables, \u003cproject_path>\\701-800\\721\\sol.py\r\nconsole.ts:137 [Extension Host] Info Python Extension: 2019-08-15 21:06:07: > C:\\Programs\\Python3.6\\python.exe -m black -S --diff --quiet \u003cproject_path>\\701-800\\721\\sol.py.4f805ae93a314088ee8dc430f8bf5945.py\r\nconsole.ts:137 [Extension Host] Info Python Extension: 2019-08-15 21:06:07: cwd: \u003cproject_path>\r\nconsole.ts:137 [Extension Host] Info Python Extension: 2019-08-15 21:06:07: > C:\\Programs\\Python3.6\\python.exe -m black -S --diff --quiet \u003cproject_path>\\701-800\\721\\sol.py.4f805ae93a314088ee8dc430f8bf5945.py\r\nconsole.ts:137 [Extension Host] Info Python Extension: 2019-08-15 21:06:07: cwd: \u003cproject_path>\r\nconsole.ts:137 [Extension Host] swdc-vscode: error posting data for /commits, message: Request failed with status code 500\r\nconsole.ts:137 [Extension Host] swdc-vscode: storing kpm metrics\r\n```\r\n","author":{"url":"https://github.com/haollhao","@type":"Person","name":"haollhao"},"datePublished":"2019-08-16T01:36:20Z","url":"https://github.com/microsoft/python-language-server/issues/1449"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ece93a22-73c7-ae79-177c-86753f57859c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8936:34D994:6F58AC:973037:6AFE6772 |
| html-safe-nonce | 4ce4f8be40c7ba20473437d2a25cd724e6a1f559ddae7720023b20b3b6a49479 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OTM2OjM0RDk5NDo2RjU4QUM6OTczMDM3OjZBRkU2NzcyIiwidmlzaXRvcl9pZCI6Ijg0MDkxODcwNDEyNDEwOTgwOTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 98d9fb3e0e66dd43d350b6047e9a27e93ec802e5ecf4e046f89d2b7472b9083e |
| hovercard-subject-tag | issue:481721042 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/python-language-server/1449/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a5f787f4e49fde2ae1ccf62d7647f70419338dc7db4fa0748fd4c0826a96ba55/microsoft/python-language-server/issues/1449 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a5f787f4e49fde2ae1ccf62d7647f70419338dc7db4fa0748fd4c0826a96ba55/microsoft/python-language-server/issues/1449 |
| og:image:alt | Environment data VS Code version: Code 1.37.1 (f06011ac164ae4dc8e753a3fe7f9549844d15e35, 2019-08-15T16:17:55.855Z) Extension version (available under the Extensions sidebar): 2019.8.30787 OS and ve... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | haollhao |
| hostname | github.com |
| expected-hostname | github.com |
| None | b3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/python-language-server git https://github.com/microsoft/python-language-server.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 145901977 |
| octolytics-dimension-repository_nwo | microsoft/python-language-server |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 145901977 |
| octolytics-dimension-repository_network_root_nwo | microsoft/python-language-server |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4a10310af51a1bfffbedc4fd81cb582acf0cb0ff |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width