VSCode Extension fails to re-analyze when changing branches
See original GitHub issueWhen switching between branches where files are moved between directories, VSCode Dart extension fails to recognize the change and shows errors, necessitating reloading VSCode.
Steps to reproduce
- Create a new git repository
- Add
foo.dart
class Foo {}
- Add
bar.dart
import 'foo.dart';
class Bar {
Foo foo;
}
- Commit changes to
master
- Create
develop
branch off ofmaster
- Move
./foo.dart
to./foo/foo.dart
and update import path inbar.dart
- Commit changes to
develop
- Checkout master branch
System Information MacOS Catalina 10.15.3 VSCode 1.43.2 Dart 2.8.0-dev.18.0 Dart Code Extension 3.8.1
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Files not properly updated with switching branches in Git ...
Sometimes when switching branches in Git using VS, Git will not update the local file with the correct code. This is somewhat rare, ......
Read more >After branch switching the project system doesn't update ...
scenario happens: i create branch A from the development branch. We are unable to investigate this issue further without the additional information requested. ......
Read more >Managing Extensions in Visual Studio Code
VS Code makes it easy to manage your extensions. You can install, disable, update, and uninstall extensions through the Extensions view, the Command...
Read more >Source Control with Git in Visual Studio Code
Many other source control providers are available through extensions on the ... Tip: If you commit your change to the wrong branch, undo...
Read more >Changing branch does not change the code
The name of the branch is updated in the status bar - but VS does not reload the code files of the other...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
A fix has been made in https://github.com/dart-lang/watcher/issues/83 that fixes some file watcher events being lost when a modified folder is a prefix of a file. I’ll ping you once the fix is available in an SDK so you can test if it solves this for you (I’m not having much look reproducing it now, even without the fix).
If I’m reading the hashes correctly, I think this change is in the Flutter
master
channel now, so if you’re using that (and have pulled latest) I think you’ll have the fix.If you’re still able to produce these sorts of errors with that code, do post back (or file a new issue with repro). Thanks!