Linting reports incorrect file locations for lint errors / warnings
See original GitHub issueEnvironment data
VSCode
Version: 1.37.1
Commit: f06011ac164ae4dc8e753a3fe7f9549844d15e35
Date: 2019-08-15T16:16:34.800Z
Electron: 4.2.7
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Darwin x64 18.7.0
- Extension version:
2019.8.30787
- Python version:
2.7
- Type of virtual environment used:
virtualenv
- Relevant/affected Python packages and their versions:
flake8 v3.7.7
- Jedi or Language Server: Microsoft Language Server
- Using a multi-root workspace (I have had a ton of problems with multiroot workspaces so it may be relevant)
Expected behaviour
I expect the Problems
tab to point to correct locations. I expect red underlines to appear where the linting errors are reported.
Actual behaviour
Red underlines appear in any open file when any lint errors are reported. Correct locations of linting failures are not shown. The below screenshot shows the line import random
underlined as red for the incorrect error. Every lint error is highlighted in every open file making it impossible to determine the actual location of the errors.
Logs
(truncated to remove proprietary code)
##########Linting Output - flake8##########
7,1,F,F401:'hamcrest.is_in' imported but unused
1,1,F,F401:'datetime.datetime' imported but unused
4,1,F,F401:'arrow' imported but unused
1162,1,E,E305:expected 2 blank lines after class or function definition, found 1
1165,37,F,F821:undefined name 'AuthenticatedTestCase'
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
)
Duplicate logs removed, paths changed
console.ts:137 [Extension Host] Info Python Extension: 2019-08-19 08:18:29: Cached data exists getEnvironmentVariables, /Users/rvinzent/repo
console.ts:137 [Extension Host] Info Python Extension: 2019-08-19 08:18:33: Cached data exists getEnvironmentVariables, /Users/rvinzent/repo
console.ts:137 [Extension Host] Info Python Extension: 2019-08-19 08:19:10: Cached data exists getEnvironmentVariables, /Users/rvinzent/repo
console.ts:137 [Extension Host] 2019-08-19T15:19:15.464Z - debug: [ImportOrganizer] OrganizeOnSave is deactivated through config
exists getEnvironmentVariables, /Users/rvinzent/repo
ms-python.gallerycdn…dio.Code.Manifest:1 Failed to load resource: the server responded with a status of 404 ()
console.ts:137 [Extension Host] Info Python Extension: 2019-08-19 08:25:59: Cached data exists getEnvironmentVariables, extension-output-#9
ms-python.gallery.vs…dio.Code.Manifest:1 Failed to load resource: the server responded with a status of 503 ()
log.ts:173 ERR Unexpected end of JSON input: SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at Object.<anonymous> (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:1626:627)
at Generator.next (<anonymous>)
at r (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:35:293)
console.ts:137 [Extension Host] 2019-08-19T15:30:18.990Z - debug: [ImportOrganizer] OrganizeOnSave is deactivated through config
console.ts:137 [Extension Host] Info Python Extension: 2019-08-19 08:30:19: Cached data exists getEnvironmentVariables, /Users/rvinzent/repo/workspace/path/to/file.py
console.ts:137 [Extension Host] Info Python Extension: 2019-08-19 08:41:37: Cached data exists getEnvironmentVariables, /Users/rvinzent/repo/.vscode/repo.code-workspace
console.ts:137 [Extension Host] Info Python Extension: 2019-08-19 08:41:42: Cached data exists getEnvironmentVariables, /Users/rvinzent/repo
console.ts:137 [Extension Host] Info Python Extension: 2019-08-19 08:41:53: Cached data exists getEnvironmentVariables, /Users/rvinzent/repo
console.ts:137 [Extension Host] Info Python Extension: 2019-08-19 08:43:01: Cached data exists getEnvironmentVariables, /Users/rvinzent/repo
console.ts:137 [Extension Host] Info Python Extension: 2019-08-19 08:50:03: Cached data exists getEnvironmentVariables, extension-output-#2
Issue Analytics
- State:
- Created 4 years ago
- Comments:8
Top GitHub Comments
@karrtikr the jedi server doesn’t work well for me. I would rather use the Microsoft Language Server with the linting disabled. Is this possible? I’ll also try to find the time to produce a minimal repo highlighting the issue with flake8.
You can always disable linting (from command palette) and use Microsoft language server.