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

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

Closed
keck-in-space opened this Issue Jun 22, 2018 · 9 comments

Comments

Projects
None yet
5 participants
@keck-in-space

keck-in-space commented Jun 22, 2018

  • 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.

@keck-in-space

This comment has been minimized.

keck-in-space commented Jun 22, 2018

#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?

@eamodio eamodio reopened this Jun 22, 2018

@eamodio

This comment has been minimized.

Owner

eamodio commented Jun 25, 2018

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

@eamodio eamodio added the bug label Jun 25, 2018

@eamodio eamodio added this to the Backlog milestone Jun 25, 2018

@eamodio eamodio changed the title from Control-click parses temporary files for function definitions. to File revisions can end up being parsed by language servers (causing errors and warnings, etc) Jul 20, 2018

@eamodio eamodio modified the milestones: Backlog, Soonish™ Jul 22, 2018

@jhaenchen

This comment has been minimized.

jhaenchen commented Aug 24, 2018

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).

@eamodio

This comment has been minimized.

Owner

eamodio commented Aug 24, 2018

@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.

@egamma

This comment has been minimized.

egamma commented Aug 27, 2018

@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.

@eamodio

This comment has been minimized.

Owner

eamodio commented Aug 29, 2018

@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.

@egamma

This comment has been minimized.

egamma commented Aug 30, 2018

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

CCing @rebornix

@tiagomsmagalhaes

This comment has been minimized.

tiagomsmagalhaes commented Nov 21, 2018

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

@eamodio

This comment has been minimized.

Owner

eamodio commented Nov 21, 2018

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

@eamodio eamodio closed this in 0f2f79f Dec 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment