mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 21:53:42 -06:00
Improve quick info display on properties belonging to all union contextual type members (#56088)
This commit is contained in:
parent
10db6524f1
commit
fd0936755b
@ -3282,7 +3282,9 @@ export function getPropertySymbolsFromContextualType(node: ObjectLiteralElementW
|
||||
// Bad discriminant -- do again without discriminating
|
||||
return mapDefined(contextualType.types, t => t.getProperty(name));
|
||||
}
|
||||
return discriminatedPropertySymbols;
|
||||
// by eliminating duplicates we might even end up with a single symbol
|
||||
// that helps with displaying better quick infos on properties of union types
|
||||
return deduplicate(discriminatedPropertySymbols, equateValues);
|
||||
}
|
||||
|
||||
function isArgumentOfElementAccessExpression(node: Node) {
|
||||
|
||||
@ -0,0 +1,45 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
//// interface Entries {
|
||||
//// /**
|
||||
//// * Plugins info...
|
||||
//// */
|
||||
//// plugins?: Record<string, Record<string, unknown>>;
|
||||
//// /**
|
||||
//// * Output info...
|
||||
//// */
|
||||
//// output?: string;
|
||||
//// /**
|
||||
//// * Format info...
|
||||
//// */
|
||||
//// format?: string;
|
||||
//// }
|
||||
////
|
||||
//// interface Input extends Entries {
|
||||
//// /**
|
||||
//// * Input info...
|
||||
//// */
|
||||
//// input: string;
|
||||
//// }
|
||||
////
|
||||
//// interface Types extends Entries {
|
||||
//// /**
|
||||
//// * Types info...
|
||||
//// */
|
||||
//// types: string;
|
||||
//// }
|
||||
////
|
||||
//// type EntriesOptions = Input | Types;
|
||||
////
|
||||
//// const options: EntriesOptions[] = [
|
||||
//// {
|
||||
//// input: "./src/index.ts",
|
||||
//// /*1*/output: "./dist/index.mjs",
|
||||
//// },
|
||||
//// {
|
||||
//// types: "./src/types.ts",
|
||||
//// format: "esm",
|
||||
//// },
|
||||
//// ];
|
||||
|
||||
verify.quickInfoAt("1", "(property) Entries.output?: string", "Output info...");
|
||||
Loading…
x
Reference in New Issue
Block a user