Support a 'recommended' completion entry (#20020)

* Support a 'recommended' completion entry

* Code review

* Restore duplicate comments
This commit is contained in:
Andy
2017-12-01 13:00:01 -08:00
committed by GitHub
parent 973cb767c7
commit fd4d8ab96e
17 changed files with 235 additions and 62 deletions

View File

@@ -1701,8 +1701,9 @@ namespace ts.server.protocol {
*/
sortText: string;
/**
* An optional span that indicates the text to be replaced by this completion item. If present,
* this span should be used instead of the default one.
* An optional span that indicates the text to be replaced by this completion item.
* If present, this span should be used instead of the default one.
* It will be set if the required span differs from the one generated by the default replacement behavior.
*/
replacementSpan?: TextSpan;
/**
@@ -1714,6 +1715,12 @@ namespace ts.server.protocol {
* Identifier (not necessarily human-readable) identifying where this completion came from.
*/
source?: string;
/**
* If true, this completion should be highlighted as recommended. There will only be one of these.
* This will be set when we know the user should write an expression with a certain type and that type is an enum or constructable class.
* Then either that enum/class or a namespace containing it will be the recommended symbol.
*/
isRecommended?: true;
}
/**