Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Assign type scope for exclamation mark preceding colon #701

Closed
usernamehw opened this issue Dec 29, 2018 · 3 comments
Closed

Assign type scope for exclamation mark preceding colon #701

usernamehw opened this issue Dec 29, 2018 · 3 comments

Comments

@usernamehw
Copy link

class Cl {
    one?: string;
    two!: string;
}

Some themes have different coloring for type punctuation scopes like keyword.operator.type. But exclamation mark stands out because it's keyword.operator.logical.

screenshot 20

It would be nice for it to have a separate scope (like question mark keyword.operator.optional) or at least the same as colon keyword.operator.type.

@usernamehw
Copy link
Author

Thanks 👍

@josejavierpaez
Copy link

Could someone explain to me the difference between "?" and "!", obviously in this TS context

@usernamehw
Copy link
Author

  • !: - property is NOT optional, and you want to override TypeScript (maybe it will definitely be assigned later)
  • ?: - property is optional (can be omitted (undefined))

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants