-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Refactoringse.g. extract to constant or function, rename symbole.g. extract to constant or function, rename symbolFixedA PR has been merged for this issueA PR has been merged for this issueVS Code TrackedThere is a VS Code equivalent to this issueThere is a VS Code equivalent to this issue
Milestone
Description
TypeScript Version: 2.5.1
Code
import _ from 'lodash'
Place cursor at start of line.
Expected behavior:
No refactorings are provided
Actual behavior:
An extract method refactoring is provided:
[Trace - 5:37:09 PM] Sending request: getApplicableRefactors (44). Response expected: yes. Current queue length: 0
Arguments: {
"file": "/Users/matb/projects/san2/bar.js",
"startLine": 1,
"startOffset": 1,
"endLine": 1,
"endOffset": 7
}
[Trace - 5:37:09 PM] Response received: getApplicableRefactors (44). Request took 2 ms. Success: true
Result: [
{
"name": "Extract Method",
"description": "Extract function",
"inlineable": true,
"actions": [
{
"description": "Extract function into 'file '/Users/matb/projects/san2/bar.js''",
"name": "scope_0"
}
]
}
]
Applying the refactoring results in:
newFunction() _ from 'lodash'
function newFunction() {
return import ;
}
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Refactoringse.g. extract to constant or function, rename symbole.g. extract to constant or function, rename symbolFixedA PR has been merged for this issueA PR has been merged for this issueVS Code TrackedThere is a VS Code equivalent to this issueThere is a VS Code equivalent to this issue