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
Always show return type/signature for all items in code completion #2462
For now I'm going ahead with example 5 from above, but we can tweak if it doesn't feel right when people start using it.
One thing I changed slightly though is that we'll show the import-uri on the right side of the item is not already imported. The reason for this is that if you don't have the details panel visible, you'd often see duplicated items (where they're available from multiple libraries and none are imported) and it wouldn't be obvious why. With the old functionality it should show on the right side of the completion list only for the selected item, but in the new world we can't show things only for the selected item so they'll show all the time.
So with the panel collapsed it'll look something like this:
And with it visible like this:
Unfortunately we can't tell if the panel is open, so we can't hide the URIs from the right side of the completion list in that case, so there's a little duplication, but I feel like that's the best compromise.
I'm interested in feedback though (I'll post back after the change lands, it's not complete yet).
This has landed in the latest SDK (it may take a few days to get to Flutter master). Since it ships in the SDK it'll show up in a future SDK release (not a VS Code extension release). If you have any feedback/issues about the changes, please open new issues with details - thanks!
@Number-3434 generally I think we should avoid too many options because it makes testing and maintaining more complicated, particularly where the combinations could multiply. Here we're already handling the original LSP format and this new format, so another option would double this to possible outcomes for each completion item. I think we should be sure there's sufficient demand to warrant the option (or just changing the default). I'd suggest filing an issue at https://github.com/dart-lang/sdk to collect comments and 👍 's.
That said, it's not quite the same - but in case you didn't have the extra panel expanded, the parameters are shown in the info on the right for the selected item:
And if you have signature help enabled (the default), it'll pop open if you select an item and show the parameters there too:
These might help if you already have a general idea of what you're looking for.
It just felt a bit weird that it shows abbreviated parameters, but doesn't currently show the full parameters anywhere.
Not sure I agree that it doesn't show them anywhere, they're shown in the places I noted above :)
Unfortunately VS Code changed how it shows the details slightly with this new work - it used to be that it showed the first line of the details on the right side of the selected item like this:
However when adopting this new UI, they removed that so that it only appears in the panel on the right (not inline when the item is selected). We're still putting the full signature into the details, but it'll only be visible in the panel on the right (whereas before it showed in two places).
Activity
DanTup commentedon May 18, 2020
We do show the return type in the same place here:
However VS Code only shows it for the highlighted item. There's an open issue about improving this here:
microsoft/vscode#39441
If that is implemented, we should be able to improve this here too.
DanTup commentedon Aug 26, 2021
Looks like the LSP part of this work will be in v3.17 of the spec.
microsoft/language-server-protocol#1307
30 remaining items
DanTup commentedon Aug 3, 2023
For now I'm going ahead with example 5 from above, but we can tweak if it doesn't feel right when people start using it.
One thing I changed slightly though is that we'll show the import-uri on the right side of the item is not already imported. The reason for this is that if you don't have the details panel visible, you'd often see duplicated items (where they're available from multiple libraries and none are imported) and it wouldn't be obvious why. With the old functionality it should show on the right side of the completion list only for the selected item, but in the new world we can't show things only for the selected item so they'll show all the time.
So with the panel collapsed it'll look something like this:
And with it visible like this:
Unfortunately we can't tell if the panel is open, so we can't hide the URIs from the right side of the completion list in that case, so there's a little duplication, but I feel like that's the best compromise.
I'm interested in feedback though (I'll post back after the change lands, it's not complete yet).
[analysis_server] Refactor completion labels in preparation for new L…
[analysis_server] Add support for additional completion label details
DanTup commentedon Aug 31, 2023
This has landed in the latest SDK (it may take a few days to get to Flutter master). Since it ships in the SDK it'll show up in a future SDK release (not a VS Code extension release). If you have any feedback/issues about the changes, please open new issues with details - thanks!
Number-3434 commentedon Feb 13, 2024
Could there be an option to enable option 2?
I really like that you can see all the parameters there.
DanTup commentedon Feb 15, 2024
@Number-3434 generally I think we should avoid too many options because it makes testing and maintaining more complicated, particularly where the combinations could multiply. Here we're already handling the original LSP format and this new format, so another option would double this to possible outcomes for each completion item. I think we should be sure there's sufficient demand to warrant the option (or just changing the default). I'd suggest filing an issue at https://github.com/dart-lang/sdk to collect comments and 👍 's.
That said, it's not quite the same - but in case you didn't have the extra panel expanded, the parameters are shown in the info on the right for the selected item:
And if you have signature help enabled (the default), it'll pop open if you select an item and show the parameters there too:
These might help if you already have a general idea of what you're looking for.
Number-3434 commentedon Feb 15, 2024
Okay, I'll leave it for now.
It just felt a bit weird that it shows abbreviated parameters, but doesn't currently show the full parameters anywhere.
DanTup commentedon Feb 15, 2024
Not sure I agree that it doesn't show them anywhere, they're shown in the places I noted above :)
Unfortunately VS Code changed how it shows the details slightly with this new work - it used to be that it showed the first line of the details on the right side of the selected item like this:
However when adopting this new UI, they removed that so that it only appears in the panel on the right (not inline when the item is selected). We're still putting the full signature into the details, but it'll only be visible in the panel on the right (whereas before it showed in two places).
Number-3434 commentedon Feb 15, 2024
Sorry, I meant specifically the inline text after the suggestion in the suggest widget.
It makes it much quicker to browse, as you can glance at the values, as opposed to having to go through every suggestion individually.
Also, personally, I really like that it shows them even if details are on.