Open mjbvz opened 5 years ago
I spoke with Mohamed a lot about this. The problem is that there's really no "current" parameter in an options bag until you've typed out the whole word, or inserted a colon. At that point, we could possibly display something like
{ ..., currentPropertyName: string, ... }
Trying to give some context on this one:
Today in TypeScript, signature help really only thinks about a set of overloads, each having a flat argument list. There is some special functionality to make rest arguments of union types turn into several overloads, but that still boils down to a list of signatures with a flat set of arguments.
However, it's very common to think about option bags in JS/TS. These option bags often act as a set of named parameters, and one could imagine signature help specially "drilling down" to give a better experience, updating the display on retriggers, and giving more information for nicer formatting. This might include:
...
s entirely. Maybe that's something the editor side could do depending on the current index given enough information.FooOptions
with an object literal type (while properly handling recursive types).
From https://github.com/Microsoft/vscode/issues/56270
TypeScript Version: 3.3.0-dev.20181214
Search Terms:
Code For a simple TS File:
Trigger signature help on last line.
Problem: We currently just display the entire type in signature help:
Some possible quality of life improvements:
This is likely not supported by the current VS Code api. Opening this issue for further discussion on how this could be improved
/cc @DanielRosenwasser