File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
flutter-idea/src/io/flutter/run Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 20
20
import com .intellij .execution .runners .RunContentBuilder ;
21
21
import com .intellij .execution .ui .ConsoleView ;
22
22
import com .intellij .execution .ui .ConsoleViewContentType ;
23
+ import com .intellij .execution .ui .MutableReactiveProperty ;
23
24
import com .intellij .execution .ui .RunContentDescriptor ;
24
25
import com .intellij .icons .AllIcons ;
25
26
import com .intellij .openapi .actionSystem .AnAction ;
@@ -156,12 +157,12 @@ protected RunContentDescriptor launch(@NotNull ExecutionEnvironment env) throws
156
157
else {
157
158
descriptor = new RunContentBuilder (result , env ).showRunContent (env .getContentToReuse ());
158
159
}
160
+ final String nameWithDeviceName = descriptor .getDisplayName () + " (" + device .deviceName () + ")" ;
159
161
try {
160
- final Field f = descriptor .getClass ().getDeclaredField ("myDisplayName" );
161
- f .setAccessible (true );
162
- f .set (descriptor , descriptor .getDisplayName () + " (" + device .deviceName () + ")" );
162
+ final MutableReactiveProperty <String > property = (MutableReactiveProperty <String >) descriptor .getDisplayNameProperty ();
163
+ property .setValue (nameWithDeviceName );
163
164
}
164
- catch (IllegalAccessException | NoSuchFieldException e ) {
165
+ catch (ClassCastException e ) {
165
166
LOG .info (e );
166
167
}
167
168
return descriptor ;
You can’t perform that action at this time.
0 commit comments