Skip to content
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

Error span causes refactoring suggestions #34481

Closed
ghost opened this issue Sep 15, 2017 · 1 comment
Closed

Error span causes refactoring suggestions #34481

ghost opened this issue Sep 15, 2017 · 1 comment
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug typescript Typescript support issues verified Verification succeeded
Milestone

Comments

@ghost
Copy link

ghost commented Sep 15, 2017

  • VSCode Version: Code - Insiders 1.17.0-insider (b0c0634, 2017-09-15T05:24:23.107Z)
  • OS Version: Windows_NT x64 10.0.15063
  • Extensions: none
    TypeScript Version: nightly (2.6.0-dev.20170915)

Moving from microsoft/TypeScript#18507 as this looks like a vscode issue.

Code

function f(): number {
    return {
        x: 1,
    }
}

The entire return statement has a red squiggly line under it.
Click anywhere in the error span and there will be a suggestion to refactor to an inner function.
Remove : number and there are no refactoring suggestions.
(Tested in vscode.)

Expected behavior:

Presence of a compile error doesn't cause a refactoring to be suggested.
Especially because it looks exactly like a code fix, but extracting to an inner function won't fix the compile error.

Actual behavior:

It does.
In fact, hovering over the light bulb shows "Show Fixes", but this is a refactoring, not a fix.

@vscodebot vscodebot bot added insiders typescript Typescript support issues labels Sep 15, 2017
@mjbvz mjbvz modified the milestones: September 2017, October 2017 Sep 20, 2017
@chrmarti chrmarti removed the insiders label Sep 27, 2017
@mjbvz mjbvz added the bug Issue identified by VS Code Team member as probable bug label Oct 27, 2017
@mjbvz mjbvz modified the milestones: October 2017, Backlog Oct 30, 2017
@mjbvz
Copy link
Collaborator

mjbvz commented Oct 30, 2017

Pushing this out as it depends on #34664

@mjbvz mjbvz modified the milestones: Backlog, November 2017 Nov 10, 2017
@mjbvz mjbvz closed this as completed in 006b379 Nov 10, 2017
@roblourens roblourens added the verified Verification succeeded label Dec 6, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 25, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug typescript Typescript support issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants