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 #18507

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

Error span causes refactoring suggestions #18507

ghost opened this issue Sep 15, 2017 · 1 comment
Labels
Bug A bug in TypeScript Domain: Refactorings e.g. extract to constant or function, rename symbol

Comments

@ghost
Copy link

ghost commented Sep 15, 2017

TypeScript Version: nightly (2.6.0-dev.20170915)

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.

@ghost ghost added Bug A bug in TypeScript Domain: Refactorings e.g. extract to constant or function, rename symbol labels Sep 15, 2017
@ghost
Copy link
Author

ghost commented Sep 15, 2017

Moved to microsoft/vscode#34481

@ghost ghost closed this as completed Sep 15, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Domain: Refactorings e.g. extract to constant or function, rename symbol
Projects
None yet
Development

No branches or pull requests

0 participants