gitkraken/vscode-gitlens

File revisions can end up being parsed by language servers (causing errors and warnings, etc)

keck-in-space opened this issue Β· 10 comments

  • GitLens Version: [8.4.1] - 2018-06-19
  • VSCode Version: 1.24.1
  • OS Version: Windows 10 Enterprise

Steps to Reproduce:

  1. View a C source file.
  2. Find a changed line.
  3. View changes.
  4. Close changes.
  5. Ctrl-click a function that was in both the working copy and previous revision.
  6. Two definitions are now shown.

Expected behavior:

Complete steps 1-5.
Step 6. One, the most recent definition is shown.

#301

Looks like a known issue, potentially with VSCode, though I think some more digging is required to find out exactly what's going on.

Does VSCode automatically include temp files in workspace after they've been opened by GitLens? Could GitLens take more care to delete temp files?

While I feel like this is an issue in the language servers, I will look into any way GitLens can avoid this.

I believe I'm seeing a similar issue. Whenever I open a revision comparison, I get [ts] warnings about modules not being found (because the temp file is in /var).

@jhaenchen yup -- drives me NUTS. I'm trying to get it resolved but there are challenges in changing some of the core of GitLens. And I'm working with the vscode team to hopefully provide some core (overlapping) functionality that could also resolve this too.

@eamodio (I donΒ΄t have the full background)

Are these temporary files that are generated by gitlens? Creating temporary files should be avoided by using TextDocumentContentProviders. A TextDocumentContentProvider can then be registered for a new schema, that does not overlap with the file schema, that is typically targeted by language servers.

@egamma Yeah, they are temp files for a particular file revision. I honestly can't remember the history of why I use temporary files for diff comparisons and use a TextDocumentContentProvider for showing file revisions (when not comparing) -- and my guess is outside of image comparisons those reasons are no longer valid. So I've been working on moving everything (other than binary/image files) to the TextDocumentContentProvider, but I was originally hoping to deprecate my own version and instead us the one provided by the vscode git extension (using the git:/ scheme).

This was the first issue I ran into: microsoft/vscode#55110. And then there is the handling of binary/image files. So given those issues, I've been working on switching over to my provider for now, which while simple on the surface -- its a tiny change -- has a large ripple possibility, so I'm still working through all the scenarios.

EDIT: Just remembered that one issue might have been trying to deal with file encoding when doing diffs -- I'll need to look into that more.

The vscode-pullrequest-github extension is using TextDocumentContentProviders and is also diffing contents. Would be interesting what issues you are aware of.

CCing @rebornix

Hi.. I installed your plugin today and found the issue and that it's already mentioned here. Don't know if it helps but when reloading the window the problems are gone until I check changes or previous revision

@tiagomsmagalhaes Thanks -- this issue has been fixed in the GitLens 9 release which will be coming very soon.

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.