-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: LS: Organize ImportsIssues with the organize imports featureIssues with the organize imports featureFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
TypeScript Version: 2.8.0-dev20180320
Search Terms:
- Organize imports
Code
For the js:
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as fs from 'fs'
function foo() {
this.x = 1;
}Run organize imports.
Expected behavior:
Only import is removed
Actual behavior:
Import plus the header comment are removed, leaving:
function foo() {
this.x = 1;
}Trace:
[Trace - 10:41:32 AM] Response received: organizeImports (34). Request took 3 ms. Success: true
Result: [
{
"fileName": "/Users/matb/projects/san/index.js",
"textChanges": [
{
"start": {
"line": 1,
"offset": 1
},
"end": {
"line": 7,
"offset": 1
},
"newText": ""
}
]
}
]
Playground Link:
Related Issues:
StevenBlakley
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: LS: Organize ImportsIssues with the organize imports featureIssues with the organize imports featureFixedA PR has been merged for this issueA PR has been merged for this issue