Skip to content

Add parameter type inlay hints after ? operator #48277

@mjbvz

Description

@mjbvz

Bug Report

🔎 Search Terms

  • typescript.inlayHints.parameterTypes.enabled

🕗 Version & Regression Information

4.7.0-dev.20220315

Not a regression

💻 Code

In VS Code, enable typescript.inlayHints.parameterTypes.enabled

interface IFoo { 
    bar(x?: boolean): void;
}

const a: IFoo = {
    bar: function (x?): void {
        throw new Error("Function not implemented.");
    }
} 

🙁 Actual behavior

The parameter type inlay hints are shown between x and ?

🙂 Expected behavior

The inlay hint should come after the ?: x? : boolean | undefined

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions