Closed
Description
π Search Terms
completions promise return expression type async members
π Version & Regression Information
- This is the behavior in every version I tried
β― Playground Link
π» Code
type MyType = {
foo: string;
};
function test(cb: () => MyType | Promise<MyType>) {}
test(() => ({
/*1*/
}));
π Actual behavior
Completions provided at the marker position include catch
, foo
and then
π Expected behavior
It would be great if in a situation like this promise methods would get at least deprioritized and if they would appear at the bottom of the list.
Additional information about the issue
It's technically okay to return thenables compatible with Promise
interface but it should be a very rare situation. I think a DX win here would justify hiding those members completely.