Skip to content

Completion list show correct entry for function expression and class expression#3643

Merged
yuit merged 25 commits into
masterfrom
completionListWithLocalName
Jul 10, 2015
Merged

Completion list show correct entry for function expression and class expression#3643
yuit merged 25 commits into
masterfrom
completionListWithLocalName

Conversation

@yuit

@yuit yuit commented Jun 26, 2015

Copy link
Copy Markdown
Contributor

Fix #3231 and for class expression case

Comment thread src/services/services.ts Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look into getDeclaredName instead, including the above for the default export

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getDeclaredName doesn't handle function expression correctly. Talk with @mhegazy, the function needed some rewrite and I don't want to have it done in this PR. I will put a TODO here to have it change once getDeclaredName is done

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DanielRosenwasser should have a fix for this in a pending review. you should synchronize.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right, it's in my PR. Speaking of which, can you guys review it? 😃

#3367

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be clear to use getDeclaredName

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🌹 yeah
🌵

Comment thread src/services/services.ts

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note. you need to handle this on the managed side as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What you mean be handling in the managed side?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably best to discuss this in person with someone but I believe the idea is that VS needs to handle styles differently depending on what comes in to the managed side.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you see in navbar when you do this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🌵 file a bug

@DanielRosenwasser

Copy link
Copy Markdown
Member

@yuit if you pull in from master, there's a fourslash test called renameLocationsForClassExpression01.ts. You'll need to amend it to test correctly in light of the fact that you fixed class expression name resolution.

Comment thread src/compiler/checker.ts Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not change the logic of copySymbol?

Also, the comment for copySymbol says // Returns 'true' if we should stop processing symbols., but it returns void. Can you fix that?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🌵

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the old comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🌵

Comment thread src/services/utilities.ts

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, that is cute :)

Yui T added 4 commits July 6, 2015 17:03
Comment thread src/compiler/checker.ts Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

class expression listed twice

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh oh. It'd be good to have a feature that catches this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JsonFreeman it's being tracked in #2854

@mhegazy

mhegazy commented Jul 9, 2015

Copy link
Copy Markdown
Contributor

👍 just remove the class expression label

@JsonFreeman

Copy link
Copy Markdown
Contributor

@yuit Do you still need to do all these things now that you fixed the binder?

@yuit

yuit commented Jul 10, 2015

Copy link
Copy Markdown
Contributor Author

@JsonFreeman I make a change so that the service layer will get name through getDeclaredName which I prefer over using symbol.getName(). This makes completion list more consistent in the case of export default in that we won't show unicode escapes sequence in completion list at all. This will be some what consistent with other feature which show unicode escape sequence in its original declared form.

@JsonFreeman

Copy link
Copy Markdown
Contributor

Great! Thanks Yui!

@JsonFreeman

Copy link
Copy Markdown
Contributor

👍

@yuit

yuit commented Jul 10, 2015

Copy link
Copy Markdown
Contributor Author

@JsonFreeman Thank you for the good discussion we had 😄

yuit added a commit that referenced this pull request Jul 10, 2015
Completion list show correct entry for function expression and class expression
@yuit yuit merged commit e72d0d8 into master Jul 10, 2015
@yuit yuit deleted the completionListWithLocalName branch July 10, 2015 20:02
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants