Skip to content

completions: Add "arrow-head" as possible value for isNewIdentifierLocation#25703

Closed
ghost wants to merge 1 commit intomasterfrom
isNewIdentifierLocation_arrowHead
Closed

completions: Add "arrow-head" as possible value for isNewIdentifierLocation#25703
ghost wants to merge 1 commit intomasterfrom
isNewIdentifierLocation_arrowHead

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Jul 16, 2018

Fixes #25691
@amcasey Is there any chance that receiving a non-boolean here would break Visual Studio?

@ghost ghost force-pushed the isNewIdentifierLocation_arrowHead branch from 1fe9a65 to ae8109c Compare July 16, 2018 20:27
@ghost ghost force-pushed the isNewIdentifierLocation_arrowHead branch from ae8109c to 987e8cd Compare July 16, 2018 20:28
@RyanCavanaugh
Copy link
Copy Markdown
Member

I think this is quite likely to break VS

@amcasey
Copy link
Copy Markdown
Member

amcasey commented Jul 16, 2018

I suppose there's a tiny chance that Newtonsoft silently drops the bad value. But I would also expect it to break.

@amcasey
Copy link
Copy Markdown
Member

amcasey commented Jul 16, 2018

Nope, looks like you'd get no completion when a non-Boolean was returned.

@ghost
Copy link
Copy Markdown
Author

ghost commented Jul 16, 2018

Maybe we should create a new field that's always a string and deprecate the old one?

@ghost
Copy link
Copy Markdown
Author

ghost commented Jul 27, 2018

@amcasey @mhegazy Opinions on how to expose this?

@amcasey
Copy link
Copy Markdown
Member

amcasey commented Jul 27, 2018

Adding a new field seems reasonable. A couple questions:

  1. Old versions of VS are going to continue to consume the old field. Do I understand correctly that the old behavior basically treats arrow-head as true and that we'll continue to set it that way in the future?
  2. I don't think "arrow-head" clearly conveys the meaning given in the jsdoc comment. Is it even important to callers that the special case is for arrow functions? Would it be clearer to describe the context (e.g. declaration (currently, true), reference (current, false), expression (i.e. unknown))?

Copy link
Copy Markdown
Member

@RyanCavanaugh RyanCavanaugh left a comment

Choose a reason for hiding this comment

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

Just adding a ❌ here so we don't accidently merge this before we've decided what to do

@RyanCavanaugh RyanCavanaugh added this to the TypeScript 3.2 milestone Sep 17, 2018
@ghost ghost closed this Nov 16, 2018
@ghost ghost deleted the isNewIdentifierLocation_arrowHead branch November 16, 2018 22:56
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
This pull request was closed.
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