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

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 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@keck-in-space
Copy link

  • 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
Copy link
Author

#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
Copy link
Member

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 Something isn't working label Jun 25, 2018
@eamodio eamodio added this to the Backlog milestone Jun 25, 2018
@eamodio eamodio changed the title Control-click parses temporary files for function definitions. 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
Copy link

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
Copy link
Member

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
Copy link

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
Copy link
Member

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
Copy link

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
Copy link

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
Copy link
Member

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 as completed in 0f2f79f Dec 2, 2018
@eamodio eamodio removed this from the Soon™ milestone Jul 19, 2019
@github-actions
Copy link

github-actions bot commented Dec 2, 2020

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants