Skip to content

Commit 18d5231

Browse files
committed
test: add test
1 parent 9c9a92f commit 18d5231

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

src/services/completions.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5472,10 +5472,10 @@ function getJsDocTagAtPosition(node: Node, position: number): JSDocTag | undefin
54725472
/** @internal */
54735473
export function getPropertiesForObjectExpression(contextualType: Type, completionsType: Type | undefined, obj: ObjectLiteralExpression | JsxAttributes, checker: TypeChecker): Symbol[] {
54745474
const hasCompletionsType = completionsType && completionsType !== contextualType;
5475-
const promiseFilteredContextualType = checker.filterType(contextualType, t => !checker.getAwaitedTypeOfPromise(t));
5475+
// const promiseFilteredContextualType = checker.filterType(contextualType, t => !checker.getAwaitedTypeOfPromise(t));
54765476
const type = hasCompletionsType && !(completionsType.flags & TypeFlags.AnyOrUnknown)
5477-
? checker.getUnionType([promiseFilteredContextualType, completionsType])
5478-
: promiseFilteredContextualType;
5477+
? checker.getUnionType([contextualType, completionsType])
5478+
: contextualType;
54795479

54805480
const properties = getApparentProperties(type, obj, checker);
54815481
return type.isClass() && containsNonPublicProperties(properties) ? [] :
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/// <reference path="fourslash.ts" />
2+
// @strict: true
3+
4+
//// type MyType = {
5+
//// foo: string;
6+
//// };
7+
8+
//// function fakeTest(cb: () => MyType | Promise<MyType>) {}
9+
10+
//// fakeTest(() => {
11+
//// return {
12+
//// /*a*/
13+
//// };
14+
//// });
15+
16+
17+
verify.completions(
18+
{
19+
marker: ['a'],
20+
exact: [
21+
{ name: 'foo', kind: 'property' },
22+
]
23+
}
24+
);

0 commit comments

Comments
 (0)