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:
Danny Tuppeny 2019-11-14 17:54:22 +00:00 committed by GitHub
parent 5506cc5b15
commit 5376e90fda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View file

@ -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;

View file

@ -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');