-
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'
fs.writeFileSync('a', 'x')Run organize imports
Expected behavior:
No change. Imports already organized
Actual behavior:
The blank line before the import is removed:
/*---------------------------------------------------------------------------------------------
* 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';
fs.writeFileSync('a', 'x')
Trace:
[Trace - 10:44:05 AM] Response received: organizeImports (136). 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": "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as fs from 'fs';\n"
}
]
}
]
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