Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement itemDefaults for CompletionList #2475

Closed
rgrunber opened this issue Feb 17, 2023 · 0 comments · Fixed by #2539
Closed

Implement itemDefaults for CompletionList #2475

rgrunber opened this issue Feb 17, 2023 · 0 comments · Fixed by #2539

Comments

@rgrunber
Copy link
Contributor

This depends on #2348 (LSP >= 3.17)

When returning a completion list, almost every time with a text edit where there isn't any element to replace (around the cursor), the entry looks like this :

"textEdit": {
    "newText": "getenv()",
    "insert": {
        "start": {
            "line": 36,
            "character": 15
        },
        "end": {
            "line": 36,
            "character": 18
        }
    },
    "replace": {
        "start": {
            "line": 36,
            "character": 15
        },
        "end": {
            "line": 36,
            "character": 18
        }
    }
}

Insert and replace are identical. It would be nice to de-deduplicate this. There might also be other values within completion item that we might be able to set as a default.

https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#completionList

       /**
	 * In many cases the items of an actual completion result share the same
	 * value for properties like `commitCharacters` or the range of a text
	 * edit. A completion list can therefore define item defaults which will
	 * be used if a completion item itself doesn't specify the value.
	 *
	 * If a completion list specifies a default value and a completion item
	 * also specifies a corresponding value the one from the item is used.
	 *
	 * Servers are only allowed to return default values if the client
	 * signals support for this via the `completionList.itemDefaults`
	 * capability.
	 *
	 * @since 3.17.0
	 */
         itemDefaults?: {
@rgrunber rgrunber moved this to 📋 Sprint Backlog in IDE Cloudaptors Mar 8, 2023
@rgrunber rgrunber removed the status in IDE Cloudaptors Mar 8, 2023
@rgrunber rgrunber moved this to 📋 Sprint Backlog in IDE Cloudaptors Mar 8, 2023
@JessicaJHee JessicaJHee moved this from 📋 Sprint Backlog to 👀 In review in IDE Cloudaptors Mar 20, 2023
@rgrunber rgrunber added this to the Early April 2023 milestone Mar 24, 2023
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in IDE Cloudaptors Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants