Repository: TypeScript
Issue: Organize imports returning edit when imports are already sorted
Labels: Bug,VS Code Priority,Rescheduled

<!-- 🚨 STOP 🚨 STOP 🚨 STOP 🚨

Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common "Bugs" That Aren't Bugs section!

Please help us by doing the following steps before logging an issue:
  * Search: https://github.com/Microsoft/TypeScript/search?type=Issues
  * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ

Please fill in the *entire* template below.
-->

<!--
Please try to reproduce the issue with the latest published version. It may have already been fixed.
For npm: `typescript@next`
This is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly
-->
**TypeScript Version:**  ^4.0.0-dev.20200729

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:**
- organize imports
- sort
- edits

**Bug**

Another case of https://github.com/microsoft/TypeScript/issues/22912

1. In the VS Code codebase, open a file with sorted imports such as https://github.com/microsoft/vscode/blob/2ed1fe8e22994965947bdc90556abc9a1f6b81ce/src/vs/workbench/contrib/webview/electron-browser/iframeWebviewElement.ts#L23
1. Run organize imports

**Expected behavior:**
An empty edit is returned since the imports are already ordered

**Actual behavior:**

An edit is returned. This cause a small graphical flash and can shift your cursor around.

Here's the response:


<details>

```
[Trace  - 23:27:50.330] <semantic> Sending request: organizeImports (36). Response expected: yes. Current queue length: 0
Arguments: {
    "scope": {
        "type": "file",
        "args": {
            "file": "/Users/matb/projects/vscode/src/vs/workbench/contrib/webview/electron-browser/iframeWebviewElement.ts"
        }
    }
}
[Trace  - 23:27:50.344] <semantic> Response received: organizeImports (36). Request took 14 ms. Success: true 
Result: [
    {
        "fileName": "/Users/matb/projects/vscode/src/vs/workbench/contrib/webview/electron-browser/iframeWebviewElement.ts",
        "textChanges": [
            {
                "start": {
                    "line": 6,
                    "offset": 1
                },
                "end": {
                    "line": 7,
                    "offset": 1
                },
                "newText": "import { ThrottledDelayer } from 'vs/base/common/async';\nimport { Schemas } from 'vs/base/common/network';\nimport { URI } from 'vs/base/common/uri';\nimport { IEnvironmentService } from 'vs/platform/environment/common/environment';\nimport { IFileService } from 'vs/platform/files/common/files';\nimport { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';\nimport { ILogService } from 'vs/platform/log/common/log';\nimport { INotificationService } from 'vs/platform/notification/common/notification';\nimport { IRemoteAuthorityResolverService } from 'vs/platform/remote/common/remoteAuthorityResolver';\nimport { ITunnelService } from 'vs/platform/remote/common/tunnel';\nimport { IRequestService } from 'vs/platform/request/common/request';\nimport { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';\nimport { WebviewThemeDataProvider } from 'vs/workbench/contrib/webview/browser/themeing';\nimport { WebviewContentOptions, WebviewExtensionDescription, WebviewOptions } from 'vs/workbench/contrib/webview/browser/webview';\nimport { IFrameWebview } from 'vs/workbench/contrib/webview/browser/webviewElement';\nimport { rewriteVsCodeResourceUrls, WebviewResourceRequestManager } from 'vs/workbench/contrib/webview/electron-browser/resourceLoading';\nimport { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';\n"
            },
            {
                "start": {
                    "line": 7,
                    "offset": 1
                },
                "end": {
                    "line": 8,
                    "offset": 1
                },
                "newText": ""
            },
            {
                "start": {
                    "line": 8,
                    "offset": 1
                },
                "end": {
                    "line": 9,
                    "offset": 1
                },
                "newText": ""
            },
            {
                "start": {
                    "line": 9,
                    "offset": 1
                },
                "end": {
                    "line": 10,
                    "offset": 1
                },
                "newText": ""
            },
            {
                "start": {
                    "line": 10,
                    "offset": 1
                },
                "end": {
                    "line": 11,
                    "offset": 1
                },
                "newText": ""
            },
            {
                "start": {
                    "line": 11,
                    "offset": 1
                },
                "end": {
                    "line": 12,
                    "offset": 1
                },
                "newText": ""
            },
            {
                "start": {
                    "line": 12,
                    "offset": 1
                },
                "end": {
                    "line": 13,
                    "offset": 1
                },
                "newText": ""
            },
            {
                "start": {
                    "line": 13,
                    "offset": 1
                },
                "end": {
                    "line": 14,
                    "offset": 1
                },
                "newText": ""
            },
            {
                "start": {
                    "line": 14,
                    "offset": 1
                },
                "end": {
                    "line": 15,
                    "offset": 1
                },
                "newText": ""
            },
            {
                "start": {
                    "line": 15,
                    "offset": 1
                },
                "end": {
                    "line": 16,
                    "offset": 1
                },
                "newText": ""
            },
            {
                "start": {
                    "line": 16,
                    "offset": 1
                },
                "end": {
                    "line": 17,
                    "offset": 1
                },
                "newText": ""
            },
            {
                "start": {
                    "line": 17,
                    "offset": 1
                },
                "end": {
                    "line": 18,
                    "offset": 1
                },
                "newText": ""
            },
            {
                "start": {
                    "line": 18,
                    "offset": 1
                },
                "end": {
                    "line": 19,
                    "offset": 1
                },
                "newText": ""
            },
            {
                "start": {
                    "line": 19,
                    "offset": 1
                },
                "end": {
                    "line": 20,
                    "offset": 1
                },
                "newText": ""
            },
            {
                "start": {
                    "line": 20,
                    "offset": 1
                },
                "end": {
                    "line": 21,
                    "offset": 1
                },
                "newText": ""
            },
            {
                "start": {
                    "line": 21,
                    "offset": 1
                },
                "end": {
                    "line": 22,
                    "offset": 1
                },
                "newText": ""
            },
            {
                "start": {
                    "line": 22,
                    "offset": 1
                },
                "end": {
                    "line": 23,
                    "offset": 1
                },
                "newText": ""
            }
        ]
    }
]
```

</details>