Skip to content

auto complete should replace if the response returns a text edit with range value #85741

@testforstephen

Description

@testforstephen

VS Code version:

Version: 1.40.2 (user setup)
Commit: f359dd69833dd8800b54d458f6d37ab7c78df520
Date: 2019-11-25T14:54:45.096Z
Electron: 6.1.5
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Windows_NT x64 10.0.18363

When i manually type import java. in Java file, it didn't replace the words. See the gif.
autocomplete_bug

Below is the completion response returned by the Java LS. Actually it returns a textEdit to replace the target range with the newText, but looks like VS Code didn't apply the TextEdit well.

[Trace - 12:24:21 PM] Received response 'completionItem/resolve - (54)' in 4ms.
Result: {
    "label": "java.awt.color",
    "kind": 9,
    "detail": "(package) java.awt.color",
    "sortText": "999999215",
    "insertTextFormat": 2,
    "textEdit": {
        "range": {
            "start": {
                "line": 21,
                "character": 7
            },
            "end": {
                "line": 21,
                "character": 12
            }
        },
        "newText": "java.awt.color.*;"
    }
}

Metadata

Metadata

Labels

*dev-questionVS Code Extension Development Questioninfo-neededIssue requires more information from postersuggestIntelliSense, Auto Complete

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions