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

Problems in .py file do not disappear when closing a file which is checked into source control #2085

Closed
dbaeumer opened this issue Jul 3, 2018 · 10 comments
Assignees
Labels
area-linting bug Issue identified by VS Code Team member as probable bug

Comments

@dbaeumer
Copy link
Member

dbaeumer commented Jul 3, 2018

From @jan11011977 on June 29, 2018 8:52

Issue Type: Bug

If you open a file, and then close it again, the problems for that file stay in the Problems window. Over time the number of problems in the list grows, eventually causing me to have to restart Visual Studio Code just to clear the list.

I am using the Python extension, but this is also happening for the Go extension, for Javascript, etc. So it's not specific to a particular plugin. It's a problem with VSCode itself.

The behaviour I expect would be that problems generated by a Task hang around permanently, but that problems generated when opening a file will disappear again when that file is closed.

This issue has been reported numerous times before:
microsoft/vscode#29169
microsoft/vscode#15524
microsoft/vscode-go#1036
trixnz/vscode-lua#32
microsoft/vscode#52348
microsoft/vscode#23010
microsoft/vscode#50448
angular/vscode-ng-language-service#185

Pretty much all of these have been closed for one reason or another, without a fix,. This is still clearly a serious usability problem for a lot of people, so I am opening another bug for it. I am hoping this will draw attention to underlying problem.

Thanks!

VS Code version: Code 1.23.1 (d0182c3417d225529c6d5ad24b7572815d0de9ac, 2018-05-10T17:11:17.614Z)
OS version: Windows_NT x64 10.0.17134

System Info
Item Value
CPUs Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz (8 x 2712)
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: unavailable_software
video_decode: enabled
video_encode: enabled
vpx_decode: enabled
webgl: enabled
webgl2: enabled
Memory (System) 15.90GB (9.07GB free)
Process Argv C:\Program Files\Microsoft VS Code\Code.exe
Screen Reader no
VM 0%
Extensions (3)
Extension Author (truncated) Version
python ms- 2018.6.0
jinjahtml sam 0.3.0
perforce sle 3.1.0

Copied from original issue: microsoft/vscode#53310

@dbaeumer
Copy link
Member Author

dbaeumer commented Jul 3, 2018

From @vscodebot[bot] on June 29, 2018 8:53

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@dbaeumer
Copy link
Member Author

dbaeumer commented Jul 3, 2018

@jan11011977 problems are owned by the extension that generate them and hence an extension is responsible for cleaning them up. In addition as outlined in #52348 it depends on the language whether problems should be cleared on file closed or not. In general the VS Code recommendation for languages extensions ares:

  • if it is a single file language (like html) then problems should be clear if a file is closed
  • if it is a project language (there is a project file and usually there are inter file dependencies) problems shouldn't be cleared when a file closes.

It sounds like you are seeing this independent of the language used (e.g. even for HTML). Could you provide me with a reproducible test case best a GitHub repository to clone. This would ease to understand why the problem always stay for you.

@dbaeumer
Copy link
Member Author

dbaeumer commented Jul 3, 2018

From @jan11011977 on July 2, 2018 10:50

Thanks for the reply. I am using Python and Perforce for version control. It looks like for a python file (unlike, say Javascript), the problems do get cleared from the list when the file is closed. However there seems to be a bug where if a .py file is checked into Perforce, the problems for it stay around after closing it. If the file isn't checked into Perforce, then the problems do disappear.

repro.zip

I have attached a .zip file to help reproduce the problem:

  1. unzip the contents of this zip file to c:\temp\
  2. Run c:\temp\p4_server\p4d.exe - this will start the Perforce server
  3. Start VSCode and open the 'vscode_repro' folder in it.
  4. Install the recommended plugins. The Perforce plugin should connect to the local Perforce server (see P4 indicator in the bottom left)
  5. Open test.py
  6. Close test.py
  7. Note how the problems for test.py are still displayed even though test.py was closed.

(note: you will need install Python + Pylint manually, they were too big to fit in the .zip file)

@d3r3kk
Copy link

d3r3kk commented Jul 3, 2018

Hi @dbaeumer, thanks for the report!
One thing stands out to me:

...if a .py file is checked into Perforce, the problems for it stay around...

and:

perforce | sle | 3.1.0

Could you please try uninstalling/disabling the Perforce extension and reproduce the issue?

@dbaeumer
Copy link
Member Author

dbaeumer commented Jul 4, 2018

@d3r3kk the report came originally from @jan11011977 I moved it here. As @jan11011977 pointed out the problems do not stay if the file is not checked into Perforce. So disabling it will very likely not reproduce it anymore. @d3r3kk were you able to reproduce it?

@d3r3kk
Copy link

d3r3kk commented Jul 4, 2018

I've not installed the Perforce dependencies to reproduce it here yet, no. It's quite likely that the Perforce extension is interacting with our extension in some negative way. I'll see if I can get up and running on a Windows VM to try it out later.

@dbaeumer
Copy link
Member Author

dbaeumer commented Jul 5, 2018

@d3r3kk the zip even containes the perforce server. No need to install anything :-) besides some Python tools

@brettcannon brettcannon added bug Issue identified by VS Code Team member as probable bug area-linting needs verification labels Jul 5, 2018
@d3r3kk d3r3kk self-assigned this Jul 31, 2018
@d3r3kk
Copy link

d3r3kk commented Aug 3, 2018

Ok, this turns out to have nothing at all to do with the perforce extension. I can reproduce it simply by enabling the Python Language Server.

Reproduction steps:

  1. Open VSCode in a new workspace.
  2. Enable jedi in the user settings (Ctrl+, to open settings, search for jedi, check the box to enable it). Reload as necessary.
  3. Create a single file called test.py.
  4. Add the text this is a test to the file and save it.
  5. Open the interactive terminal and switch to the Problems pane, notice that the line:
    "E0001:invalid syntax (<string>, line 1)"
    appears in the list.
  6. Close the test.py file. Notice that the Problems pane clears of any problem reports.
  7. Switch to the Python Language Server by disabling jedi (Ctrl+, to open settings, search for jedi, uncheck the box to disable it). Reload as necessary.
  8. Open the test.py file, note that in the problems pane the following two lines appear:
    [pylint] E0001:invalid syntax (<string>, line 1)
    [Python (parser)] unexpected token 'test'
  9. Close the test.py file.

Expected result

No problems will be reported in the problems pane.

Observed result

The problem:
[Python (parser)] unexpected token 'test'
remains reported in the problems pane even if the file is closed.

@d3r3kk
Copy link

d3r3kk commented Aug 3, 2018

cc: @DonJayamanne, @brettcannon, @ericsnowcurrently: I'm set up for anything to do with Perforce now, should there be a need for it.

@DonJayamanne
Copy link

Closing in favor of #2290
@d3r3kk thanks for clarifying the issue

@lock lock bot locked as resolved and limited conversation to collaborators Sep 2, 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