mirror of
https://github.com/flutter/flutter
synced 2024-10-13 19:52:53 +00:00
Print a message when modifying settings that you may need to reload IDE/editor (#44574)
* Print a message when modifying settings that you may need to reload IDEs/editors * Add a test for `flutter config` output * Remove blank line
This commit is contained in:
parent
5506cc5b15
commit
5376e90fda
|
@ -154,6 +154,8 @@ class ConfigCommand extends FlutterCommand {
|
|||
|
||||
if (argResults.arguments.isEmpty) {
|
||||
printStatus(usage);
|
||||
} else {
|
||||
printStatus('\nYou may need to restart any open editors for them to read new settings.');
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
@ -155,6 +155,21 @@ void main() {
|
|||
Usage: () => mockUsage,
|
||||
});
|
||||
|
||||
testUsingContext('warns the user to reload IDE', () async {
|
||||
final BufferLogger logger = context.get<Logger>();
|
||||
final ConfigCommand configCommand = ConfigCommand();
|
||||
final CommandRunner<void> commandRunner = createTestCommandRunner(configCommand);
|
||||
|
||||
await commandRunner.run(<String>[
|
||||
'config',
|
||||
'--enable-web'
|
||||
]);
|
||||
|
||||
expect(logger.statusText, contains('You may need to restart any open editors'));
|
||||
}, overrides: <Type, Generator>{
|
||||
Usage: () => mockUsage,
|
||||
});
|
||||
|
||||
testUsingContext('displays which config settings are available on stable', () async {
|
||||
final BufferLogger logger = context.get<Logger>();
|
||||
when(mockFlutterVersion.channel).thenReturn('stable');
|
||||
|
|
Loading…
Reference in a new issue