Skip to content

pylint errors stay around after deleting code file #1235

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

Closed
bersbersbers opened this issue Mar 29, 2018 · 14 comments
Closed

pylint errors stay around after deleting code file #1235

bersbersbers opened this issue Mar 29, 2018 · 14 comments
Labels
area-linting bug Issue identified by VS Code Team member as probable bug

Comments

@bersbersbers
Copy link

bersbersbers commented Mar 29, 2018

Environment data

  • VS Code version: 1.21.1
  • Extension version: 2018.2.1
  • OS and version: Microsoft Windows [Version 10.0.16299.309]
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.6.4
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): dont know
  • Relevant/affected Python packages and their versions: pylint--version
    pylint 1.8.3,
    astroid 1.6.2
    Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)]

Actual behavior

After deleting bug.py, pylint errors for bug.py stay around.

Expected behavior

After deleting bug.py, pylint errors for bug.py are discarded. (This works for .cpp files, for example.)

Steps to reproduce:

  1. Create bug.py
  2. Write anything that raises a pylint error ("bug.py" is good, yields "E0602: Undefined variable 'bug'")
  3. Delete bug.py

Logs

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

nothing

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

Upon deleting bug.py:


mainThreadExtensionService.ts:44 TypeError: Cannot read property 'document' of undefined
	at disposables.push.documentManager.onDidChangeActiveTextEditor (C:\Users\Username\.vscode\extensions\ms-python.python-2018.2.1\out\client\interpreter\interpreterService.js:54:91)
	at e.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:88:992)
	at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:665:650
	at e.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:88:992)
	at e.$acceptDocumentsAndEditorsDelta (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:663:757)
	at e._doInvokeHandler (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:587:832)
	at e._invokeHandler (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:587:550)
	at e._receiveRequest (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:586:658)
	at e._receiveOneMessage (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:586:427)
	at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:585:494
e.$onExtensionRuntimeError @ mainThreadExtensionService.ts:44
e._doInvokeHandler @ rpcProtocol.ts:174
e._invokeHandler @ rpcProtocol.ts:159
e._receiveRequest @ rpcProtocol.ts:108
e._receiveOneMessage @ rpcProtocol.ts:90
(anonymous) @ rpcProtocol.ts:33
(anonymous) @ rpcProtocol.ts:213
e.fire @ event.ts:142
(anonymous) @ ipc.net.ts:81
emitOne @ events.js:96
emit @ events.js:191
readableAddChunk @ _stream_readable.js:178
Readable.push @ _stream_readable.js:136
onread @ net.js:560
@brettcannon brettcannon added feature-request Request for new features or functionality area-linting needs decision labels Mar 29, 2018
@brettcannon
Copy link
Member

Can I ask why you would want linting results for a file that you deleted? I'm not seeing the use-case.

@bersbersbers
Copy link
Author

Oh my, I have mixed up actual and expected behavior. Sorry for that! The bug is that the messages do stay around, and I would expect them to disappear.

@brettcannon brettcannon added bug Issue identified by VS Code Team member as probable bug needs verification and removed needs decision feature-request Request for new features or functionality labels May 2, 2018
@brettcannon
Copy link
Member

I can't reproduce, so this seems to have been fixed.

@bersbersbers
Copy link
Author

bersbersbers commented May 4, 2018

@brettcannon if you say you cannot reproduce: are you using some internal build that I might not have? Because I can still repro this in 1.22.2 (and 1.23.0). I should add that I usually use folder mode, so maybe this is one requirement to reproduce this.

@DonJayamanne
Copy link

@bersbersbers Please confirm you have the latest version of the extension 2018.4.0.
Please test and let us know whether you are still getting this error and feel free to re-open the issue. If yes, please do provide the logs, thanks.

@bersbersbers
Copy link
Author

bersbersbers commented May 4, 2018

Yes, I am using ms-python.python 2018.4.0. I am still getting this error, but I agree it's harder to repro than I thought.

For example, this is how it does NOT reproduce:

  • Open new instance of VS Code
  • File, Open Folder, select an empty folder
  • File, New File, write garbage
  • File, Save As, Bug.py
  • Note pylint error
  • Explorer pane, right-click Bug.py, Delete
  • (Pylint error disappears.)

During testing, I have noticed that the same happens with a .tex file, so I assume this is a general VS Code bug. I will report it in their repo.

@brettcannon
Copy link
Member

@bersbersbers so are you saying that you don't save the file prior to deletion?

@bersbersbers
Copy link
Author

@brettcannon good point: yes, I do save the file in both cases, the one that does reproduce the issue and the one that does not.

@brettcannon
Copy link
Member

Hmm, I can't reproduce the issue, unfortunately. We can try one more time to trigger, but if we can't reproduce we won't be able to fix it (if it's our fault).

@bersbersbers
Copy link
Author

I am finally able to reproduce this in a new workspace. It seems the Subversion extension is involved.

According to microsoft/vscode#49187 (comment), this is not an issue of VS Code, but extensions. Are you able to reproduce and figure out whether this issue is one of vscode-python or svn-scm?

Steps:
In Windows Explorer:

  1. Create folder "Repo" somewhere
  2. Using TortoiseSVN, "create repository here"
  3. Create folder "Work" somewhere
  4. Checkout from "Repo"

In VS Code:

  1. Using Ctrl-K-O, open "Work"
  2. Ctrl-N, type "öäü", Ctrl-S, save as "bug.py"
  3. Click the "(x) 1 /!\ 0" in the status bar (bottom left) to open "Problems". Note the problem (undefined variable öäü).
  4. Right-click "bug.py" in "Work", Delete
  5. Note the problem sticks around.

This is my current system info:

Version 1.23.1
Commit d0182c3417d225529c6d5ad24b7572815d0de9ac
Date 2018-05-10T17:11:17.614Z
Shell 1.7.12
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64

latex-workshop Jam 5.4.0
svn-scm joh 1.29.0
python ms- 2018.4.0
multi-command ryu 1.2.0
code-spell-checker str 1.6.10

CPUs Intel(R) Xeon(R) CPU E5-2667 v4 @ 3.20GHz (32 x 3193)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: disabled_software
video_decode: enabled
video_encode: enabled
vpx_decode: enabled
webgl: enabled
webgl2: enabled
Memory (System) 255.87GB (247.81GB free)
Process Argv C:\Program Files\Microsoft VS Code\Code.exe
Screen Reader no
VM 0%

@brettcannon brettcannon reopened this May 23, 2018
@d3r3kk
Copy link

d3r3kk commented May 29, 2018

Cannot reproduce on vscode insiders 1.24.0-insider with the latest vscode-python extension installed. You may want to uninstall each extra extension you have installed one at a time to discover the culprit here.

@d3r3kk d3r3kk closed this as completed May 29, 2018
@bersbersbers
Copy link
Author

@d3r3kk just for my information, did you try with the Subversion extension installed? Because I do know that this extension is required to reproduce the issue. My current question is "whether this issue is one of vscode-python or svn-scm".

@bersbersbers
Copy link
Author

For the record, this problem was fixed in JohnstonCode/svn-scm@fd090c4

@d3r3kk
Copy link

d3r3kk commented Jun 29, 2018

@bersbersbers Thanks for letting us know, that's good news!

@lock lock bot locked as resolved and limited conversation to collaborators Jul 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-linting bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

4 participants