question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

VSCode Extension fails to re-analyze when changing branches

See original GitHub issue

When 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

  1. Create a new git repository
  2. Add foo.dart
class Foo {}
  1. Add bar.dart
import 'foo.dart';
class Bar {
  Foo foo;
}
  1. Commit changes to master
  2. Create develop branch off of master
  3. Move ./foo.dart to ./foo/foo.dart and update import path in bar.dart
  4. Commit changes to develop
  5. 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:closed
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
DanTupcommented, Apr 16, 2020

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

0reactions
DanTupcommented, Apr 27, 2020

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found