-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Adds quick info on modifiers and declaration keywords #3189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
d0c2e17
to
988d2d3
Compare
988d2d3
to
0283e79
Compare
@@ -1377,6 +1379,7 @@ module ts { | |||
/* @internal */ exportSymbol?: Symbol; // Exported symbol associated with this symbol | |||
valueDeclaration?: Declaration; // First value declaration of the symbol | |||
/* @internal */ constEnumOnlyModule?: boolean; // True if module contains only const enums or other modules with only const enums | |||
isAnonymous?: boolean; // True if declaration is anonymous |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you need this? this information can be easily inferred from other sources, like the name, and the node flags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mhegazy I was trying a lot of different ways to pinpoint anonymous declarations. I just thought this was easier. But you're right, we shouldn't add something just to serve one very specific use case.
It would be good if you could help me out on the below section. Where I use this property to add a name
of a declaration/symbol.
What is C#'s behavior? Do they also give quick info on modifiers? If not, i don't think we should be behaving differently. |
@@ -234,7 +234,7 @@ module ts.formatting { | |||
// then kind needs to be fixed. This might happen in cases | |||
// when parser interprets token differently, i.e keyword treated as identifier | |||
function fixTokenKind(tokenInfo: TokenInfo, container: Node): TokenInfo { | |||
if (isToken(container) && tokenInfo.token.kind !== container.kind) { | |||
if (isReservedWord(container) && tokenInfo.token.kind !== container.kind) { | |||
tokenInfo.token.kind = container.kind; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want Token here.. @vladima?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just renamed isToken to isReservedWord. I thought isToken
where to ambitious. And when I look at the implementation – it only contains a check for reserved words.
@tinganho are you still looking into this? |
I have been a little bit busy lately. I will update the PR in next week. On Fri, Jun 19, 2015 at 8:18 AM, Mohamed Hegazy [email protected]
Sincerely, Tingan Ho |
@mhegazy I think I will close this PR. It's a little bit outdated. |
This PR implements #2736. I just implemented the basic display part for function right now.
I can rework this PR to add/remove/change the display parts.
It also add some contextual quick info on anonymous functions.