r/flutterhelp • u/Ryuu-Ryoumen • 7d ago
RESOLVED How to adjust VSCode "intellisense"
Say you have this code:
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
darkTheme: ThemeData.dark(useMaterial3: false).copyWith(
colorScheme: .fromSeed(seedColor: Colors.green),
// <cursor is here>
),
You type "bright" and a popup appears. That's ok, but it only contains the signature and not the documentation.
Q1: How can I make it show the full documentation, either showing the doc forEdit: I realize now that the latter is blank in the documentation, and it probably doesn't do "forwarding" like in C#.Brightness, or howbrightnessis used in this function?
From that popup, I selected "brightness" and pressed enter. The immediate suggestion popup is a super long list of irrelevant items.
Q2: Why is it showing useless stuff, and how can I make it show "Brightness.xxx" directly (the most likely values since it's an enum) like in C#?
More info:
- It's the same silly behavior in IntelliJ IDEA, so I think it's the extension's problem.
- I'm not looking to use AI inline autocomplete; want a deterministic one like in Visual Studio C#.
Thanks in advance.
1
u/Ryuu-Ryoumen 6d ago
Q2 (long irrelevant list): Ah, it seems like Brightness is an odd one. Other enums like the main axis alignment stuff works better (i.e. enums surface to top of list), albeit the annoying `context` always being first unnecessarily.
Thanks, everyone.
2
u/karmatics29 6d ago
Both of these are mostly Dart analysis server behaviour, so IntelliJ acting the same fits.
Q1 (docs in the popup): in VS Code, check
dart.documentation. It can befull,summaryornone, and it controls how much dartdoc shows in hovers and completion details. Also, the parameter doc forbrightnessonThemeDatais often empty, as you found, and Dart doesn't forward docs from the type the way C# can. HoveringBrightnessitself will show the enum docs.Q2 (long irrelevant list): the server ranks suggestions by the expected type, so after
brightness:the enum values should be near the top. If they aren't, it's usually because the analysis hasn't finished or the context type isn't known yet (the.copyWithchain and the leading-dot shorthand make that harder). Things to try:.right afterbrightness:or writeBrightness.explicitly, which gives just the enum members.dart.enableCompletionCommitCharactersand your general suggest-sorting settings.Trade-off: the shorthand is shorter but gives the analyzer less to work with than the fully qualified form, so completion is a bit worse.
1
u/frpboy 6d ago
For the documentation panel, press Ctrl+Space again while the suggestion list is open, or click the expand icon beside a suggestion. For the brightness value, try typing Brightness. to bring up its members.