Skip to content

Completion does not show Boolean.prototype.toString() on boolean type expression #62566

@loucadufault

Description

@loucadufault

🔎 Search Terms

boolean, toString, toString(), completion, autocomplete, suggestion, suggestions, intellisense, vscode, playground, bool

🕗 Version & Regression Information

  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about autocomplete

⏯ Playground Link

https://www.typescriptlang.org/play/?ts=5.6.3#code/MYewdgzgLgBARiEAbGBeGUBOBXApgKHwHoiYwQZdNMRN8FkA6KEAZSwEswBzACgEpCJDJgCeMAIbYWoALYAHJLihduMDlAA0MCAAsQAdwgwARADkKoACa5JwFeGMSAbhI5IJcJSfqIkzNix8IA

💻 Code

const bool = true

// no error
bool.toString()

// try autocompleting it
bool.toStr

🙁 Actual behavior

Shows "No code actions available"

🙂 Expected behavior

Shows the toString() method as a completion option (alongside Boolean.prototype.valueOf()).

Additional information about the issue

Occurs in VS Code and TS Playground website.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions