Repository navigation
Modifying a pubspec in a template project triggers pub get #5192
Copy link
Copy link
Closed
Labels
in commandsRelates to commands (usually invoked from the command Palette)Relates to commands (usually invoked from the command Palette)in editorRelates to code editing or language featuresRelates to code editing or language featuresis bug
Milestone
Description
Describe the bug
#4581 seems to have regressed.
To Reproduce
Steps to reproduce the behavior:
- Clone https://github.com/lishaduck/bricks
- Open it in VS Code
- Watch the Flutter extension complain about invalid packages*
- Alternatively, open a file and notice that it's all red
Admittingly, I can't reproduce this this morning, but I could yesterday evening.
Expected behavior
It should ignore everything below __brick__.
Ideally for all diagnostics, but at least for pub get
Screenshots
Please complete the following information:
Workspace Environment
Dart Code extension: 3.92.0
Flutter extension: 3.92.0 (activated)
App: Visual Studio Code
App Host: desktop
Version: mac 1.91.1
Workspace type: Dart, Flutter (LSP)
Dart (3.4.1): /opt/homebrew/Caskroom/flutter/3.19.5/flutter/bin/cache/dart-sdk
Flutter (3.22.1): /opt/homebrew/Caskroom/flutter/3.19.5/flutter (No device)
Output from 'dart info'
/opt/homebrew/Caskroom/flutter/3.19.5/flutter/bin/cache/dart-sdk/bin/dart info
If providing this information as part of reporting a bug, please review the information
below to ensure it only contains things you're comfortable posting publicly.
General info
- Dart 3.4.1 (stable) (Tue May 21 15:46:25 2024 +0000) on "macos_arm64"
- on macos / Version 14.5 (Build 23F79)
- locale is en-US
Process info
| Memory | CPU | Elapsed time | Command line |
|---|---|---|---|
| 5 MB | 0.0% | 10:13 | dart devtools --machine --allow-embedding --dtd-uri ws:/RE2IxKG1emQrYGRC |
| 1 MB | 0.0% | 13:39:16 | dart devtools --machine --allow-embedding --dtd-uri ws:/iUbYR1oXEr31RwiS |
| 6 MB | 0.0% | 03:08 | dart devtools --machine --allow-embedding --dtd-uri ws:/qaAfcfjoxp85fOMt |
| 1 MB | 0.0% | 13:28:14 | dart devtools --machine --allow-embedding --dtd-uri ws:/vDf2hcUpeJ8ILqrD |
| 10 MB | 0.0% | 10:48 | dart language-server --protocol=lsp --client-id=VS-Code --client-version=3.92.0 |
| 9 MB | 0.0% | 10:23 | dart language-server --protocol=lsp --client-id=VS-Code --client-version=3.92.0 |
| 14 MB | 0.0% | 03:09 | dart language-server --protocol=lsp --client-id=VS-Code --client-version=3.92.0 |
| 7 MB | 0.0% | 09:25 | dart lib/custom_lint_client.dart ::1 51943 |
| 1 MB | 0.0% | 14:01:21 | dart tooling-daemon --machine |
| 1 MB | 0.0% | 13:39:17 | dart tooling-daemon --machine |
| 1 MB | 0.0% | 13:28:21 | dart tooling-daemon --machine |
| 5 MB | 0.0% | 10:48 | dart tooling-daemon --machine |
| 5 MB | 0.0% | 10:23 | dart tooling-daemon --machine |
| 6 MB | 0.0% | 03:09 | dart tooling-daemon --machine |
| 18 MB | 0.0% | 13:39:17 | flutter_tools.snapshot daemon |
| 0 MB | 87.6% | 13:28:21 | flutter_tools.snapshot daemon |
| 0 MB | 0.0% | 13:05:00 | flutter_tools.snapshot daemon |
| 24 MB | 0.0% | 10:23 | flutter_tools.snapshot daemon |
| 22 MB | 0.0% | 03:09 | flutter_tools.snapshot daemon |
Output from 'flutter doctor'
/opt/homebrew/Caskroom/flutter/3.19.5/flutter/bin/flutter doctor -v
[✓] Flutter (Channel stable, 3.22.1, on macOS 14.5 23F79 darwin-arm64, locale en-US)
• Flutter version 3.22.1 on channel stable at /opt/homebrew/Caskroom/flutter/3.19.5/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision a14f74ff3a (8 weeks ago), 2024-05-22 11:08:21 -0500
• Engine revision 55eae6864b
• Dart version 3.4.1
• DevTools version 2.34.3
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/dukese01/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• ANDROID_HOME = /Users/dukese01/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15E204a
• CocoaPods version 1.15.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2022.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
[✓] IntelliJ IDEA Ultimate Edition (version 2024.1.4)
• IntelliJ at /Users/dukese01/Applications/IntelliJ IDEA Ultimate.app
• Flutter plugin version 80.0.2
• Dart plugin version 241.17890.8
[✓] VS Code (version 1.90.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.92.0
[✓] VS Code (version 1.91.1)
• VS Code at /Users/dukese01/Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.92.0
[✓] Connected device (3 available)
• macOS (desktop) • macos • darwin-arm64 • macOS 14.5 23F79 darwin-arm64
• Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 14.5 23F79 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 126.0.6478.183
[✓] Network resources
• All expected network resources are available.
• No issues found!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
in commandsRelates to commands (usually invoked from the command Palette)Relates to commands (usually invoked from the command Palette)in editorRelates to code editing or language featuresRelates to code editing or language featuresis bug
Activity
lishaduck commentedon Jul 22, 2024
lishaduck commentedon Jul 22, 2024
I was able to reproduce it. It seems to be after rebases, it still tries to
pub get.Presumably it doesn't know about the rebase, so, without knowing anything about the internals, I'd assume it's only filtering changes from the vscode file watcher, but changes made in the terminal aren't filtered for some reason.
Pictures:


DanTup commentedon Jul 22, 2024
Thanks for the info! I think the problem is that there's a code path here that can trigger a pub get even if the folder had been filtered out from the list.
Dart-Code/src/extension/commands/packages.ts
Lines 253 to 254 in 64ea3d3
This needs a little refactoring so that the filter always applies, regardless of the pub status. There's some other refactoring going on here (to support pub workspaces) so I'll look at sorting this after that's done.
[-]Runs 'pub get' in Mason Projects[/-][+]Modifying a pubspec in a template project triggers `pub get`[/+]lishaduck commentedon Jul 22, 2024
Thanks!
lishaduck commentedon Jul 23, 2024
Thanks at ton!
DanTup commentedon Jul 23, 2024
np! Please let me know if you see this again. The fix is already in the pre-release version if you want to switch to that and verify it's completely solved.
Apply "pub get" exclusions for templates to all "pub gets" not only t…
DanTup commentedon Sep 12, 2024
From a quick glance at the code, the filtering is done just before we invoke the command, so we should either filter it out or we wouldn't call the command. I wonder if there's another code path somewhere that's triggering it.
Do you have steps that reliably reproduce it that I can debug with?
lishaduck commentedon Sep 12, 2024
Oh, I'm sorry 🤣
I hit the wrong button in my terminal, and it resent that message. I blame fuzzy searching.
It said it failed, so I ignored it, but I guess it didn't? 🤷♂️
DanTup commentedon Sep 12, 2024
oh lol, I didn't notice it was a duplicate of the previous message. Thanks for clarifying 😄
lishaduck commentedon Sep 24, 2024
lishaduck commentedon Sep 24, 2024
lol, did it again. I need to figure out how to delete this 🤣
DanTup commentedon Sep 25, 2024
lol. I can try locking this issue which probably would cause any attempts to post comments to it to fail. If the issue comes back, you can just open a new issue instead.