Skip to content

No "recommended" completion entry when outer context is incomplete ternary conditional operator #2196

@mjbvz

Description

@mjbvz

From microsoft/TypeScript#59517

For the code:

export enum Bar { }
export enum Foo { }


function foo(x: Foo) { return x; }
function bar(z: string, x: Foo) { return x; }

const a = '';

// Trigger suggestions here
foo(); // Selects `Foo` first
bar(a, a == '' ? ); // doesn't select `Foo` first
  1. Trigger suggestions after the incomplete ternary

Expected
Foo is selected first

Actual
I see Bar selected first. It works correctly in the Foo function

cc @bpasero

Metadata

Metadata

Assignees

Labels

Domain: EditorRelated to the LSP server, editor experience

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions