Skip to content

extractMethod: Don't try to extract an ExpressionStatement consisting of a single token#18450

Merged
3 commits merged into
masterfrom
extract-method-not-for-expression-statement
Sep 14, 2017
Merged

extractMethod: Don't try to extract an ExpressionStatement consisting of a single token#18450
3 commits merged into
masterfrom
extract-method-not-for-expression-statement

Conversation

@ghost

@ghost ghost commented Sep 13, 2017

Copy link
Copy Markdown

Sequel to #18090. This problem comes up while typing; even when typing a document consisting of a single character, the editor recommends extracting it out to a function because it sees it as its own statement (because it is, so far).

@ghost ghost requested a review from amcasey September 13, 2017 21:01
@@ -0,0 +1,9 @@
/// <reference path='fourslash.ts' />

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.

@amcasey amcasey left a comment

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.

While I disagree with our policy of preventing single-token extractions, I agree that this change is required for consistency.

@mhegazy

mhegazy commented Sep 14, 2017

Copy link
Copy Markdown
Contributor

Please port this to release-2.5 as well.

@ghost ghost merged commit 6e512a4 into master Sep 14, 2017
@ghost ghost deleted the extract-method-not-for-expression-statement branch September 14, 2017 18:16
ghost pushed a commit that referenced this pull request Sep 14, 2017
… of a single token (#18450)

* extractMethod: Don't try to extract an ExpressionStatement consisting of a single token

* Move to unit test
ghost pushed a commit that referenced this pull request Sep 14, 2017
… of a single token (#18450) (#18473)

* extractMethod: Don't try to extract an ExpressionStatement consisting of a single token

* Move to unit test
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
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.

4 participants