You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Dart extension activates for large workspaces that do not contain Dart projects #3304
Any time I try to rename a file from vs code file explorer, I get the message dialog shown above. The thing is, I'm working on a python project without any dart file and I wonder why dart should subscribe when I try to to rename files (not just .py files) in a python project. Regardless of the option I pick from the dialog though, the rename operation ends up successful, reloading does not help I eventually had to disable dart extension. it's even worse for a Java project I attempted with, get's stock at 'running file move participant.....'
Is this a bug ? See dart log below
!! PLEASE REVIEW THIS LOG FOR SENSITIVE INFORMATION BEFORE SHARING !!
Dart Code extension: 3.21.1
Flutter extension: 3.21.0 (not activated)
App: Visual Studio Code
Version: 1.55.2
Platform: win
Workspace type: Unknown (Flutter SDK)
Analyzer type: DAS
Multi-root?: false
Dart SDK:
Loc: C:\path\to\dart-sdk
Ver: 2.12.2
Flutter SDK:
Loc: C:\path\to\flutter
Ver: 2.0.4
HTTP_PROXY: undefined
NO_PROXY: undefined
Logging Categories:
General, Analyzer, CommandProcesses, VmService, DevTools, FlutterDaemon, FlutterRun, FlutterTest, PubTest, WebDaemon
Mon Apr 26 2021 [23:42:28 GMT+0100 (West Africa Standard Time)] Log file started
[11:42:47 PM] [Analyzer] [Info] ==> {"id":"8","method":"edit.getRefactoring","params":{"file":"C:\\path\to\\symmetricds_manager\\sdmanager\\core\\utils.py","kind":"MOVE_FILE","length":0,"offset":0,"options":{"newFile":"C:\\path\to\\symmetricds_manager\\sdmanager\\core\\sjdk.py"},"validateOnly":false},"clientRequestTime":1619476967005}
[11:42:47 PM] [Analyzer] [Info] <== {"id":"8","result":{"initialProblems":[{"severity":"FATAL","message":"Unable to create a refactoring"}],"optionsProblems":[],"finalProblems":[]}}
Mon Apr 26 2021 [23:42:52 GMT+0100 (West Africa Standard Time)] Log file ended
The Dart extension is active for your Python project and should not be
When the fix for (1) ships this issue will go away, however I'm curious about (2). The Dart extension should only activate when you have Dart files or pubspec.yaml in your workspace. Have you opened a folder that contains them?
There are a few situations where VS Code may activate the Dart extension incorrectly (for example if you open a very large workspace and it times out trying to check for Dart files), but there's unfortunately nothing we can do about that. If it's not that, it would be good to track down though - as activating the Dart extension will result in running the Dart language server unneecessarily.
The Dart extension is active for your Python project and should not be
The 2nd problem is definitely an issue in my case. The Dart extension starts up in most of the workspaces (in my case) no matter whether it has any dart files or not and becomes really annoying when I have to disable the extension on a per workspace basis.
There are a few situations where VS Code may activate the Dart extension incorrectly (for example if you open a very large workspace and it times out trying to check for Dart files)
I do work for the most part with workspaces having JavaScript/TypeScript. In this case, it would probably time out while checking for the files (especially in node_modules) but if it's possible somehow, maybe the extension can skip checking the node_modules directory if that's what is causing the issue. I am not sure about Python workspaces though.
if it's possible somehow, maybe the extension can skip checking the node_modules directory if that's what is causing the issue.
Unfortunately it's not, as the search is done by VS Code itself. If it takes longer than 7 seconds it gives up, and just activates everything. While it's possible Dart-Code could re-scan the workspace, that would result in it taking longer than if VS Code had finished it, so seems like a bad idea.
I opened an issue with VS Code asking for improvements in this area, you can 👍 it here:
Doing this we could limit the search to fewer levels which would reduce the chance of it happening - I think I might do that.
As for the Python workspaces, you could check what the activationEvent is in the "Log (Extension Host)" output window. Search for the Dart-Code extension and see the reason. If it's something like "workspaceContainsTimeout" then it's likely the same. Otherwise, let me know what it shows.
changed the title [-]Visual Studio Code - Extension 'Dart' wants to make refactoring changes with this file move.[/-][+]Dart extension activates for large workspaces that do not contain Dart projects[/+]on May 7, 2021
@DanTup Thank you for looking into this. I hope this feature request gets addressed soon from VSCode's team thereby allowing some ways to tackle this issue. Also, if the workaround works out as expected that would be great 😃. I'll look forward to this...
Activity
DanTup commentedon Apr 28, 2021
There are two problems triggering this:
When the fix for (1) ships this issue will go away, however I'm curious about (2). The Dart extension should only activate when you have Dart files or pubspec.yaml in your workspace. Have you opened a folder that contains them?
There are a few situations where VS Code may activate the Dart extension incorrectly (for example if you open a very large workspace and it times out trying to check for Dart files), but there's unfortunately nothing we can do about that. If it's not that, it would be good to track down though - as activating the Dart extension will result in running the Dart language server unneecessarily.
Melvin-Abraham commentedon May 7, 2021
The 2nd problem is definitely an issue in my case. The Dart extension starts up in most of the workspaces (in my case) no matter whether it has any dart files or not and becomes really annoying when I have to disable the extension on a per workspace basis.
I do work for the most part with workspaces having JavaScript/TypeScript. In this case, it would probably time out while checking for the files (especially in
node_modules) but if it's possible somehow, maybe the extension can skip checking thenode_modulesdirectory if that's what is causing the issue. I am not sure about Python workspaces though.DanTup commentedon May 7, 2021
Unfortunately it's not, as the search is done by VS Code itself. If it takes longer than 7 seconds it gives up, and just activates everything. While it's possible Dart-Code could re-scan the workspace, that would result in it taking longer than if VS Code had finished it, so seems like a bad idea.
I opened an issue with VS Code asking for improvements in this area, you can 👍 it here:
microsoft/vscode#73656
Although I just noticed this interesting workaround in the Rust issue tracker:
rust-lang/rust-analyzer#7268 (comment)
Doing this we could limit the search to fewer levels which would reduce the chance of it happening - I think I might do that.
As for the Python workspaces, you could check what the activationEvent is in the "Log (Extension Host)" output window. Search for the Dart-Code extension and see the reason. If it's something like "workspaceContainsTimeout" then it's likely the same. Otherwise, let me know what it shows.
[-]Visual Studio Code - Extension 'Dart' wants to make refactoring changes with this file move.[/-][+]Dart extension activates for large workspaces that do not contain Dart projects[/+]DanTup commentedon May 7, 2021
(I'll re-purpose this issue for the timeout case and implementing the workaround above)
Melvin-Abraham commentedon May 7, 2021
@DanTup Thank you for looking into this. I hope this feature request gets addressed soon from VSCode's team thereby allowing some ways to tackle this issue. Also, if the workaround works out as expected that would be great 😃. I'll look forward to this...