Skip to content

Handle replaceStart/replaceEnd in muthaf*ckin' completion proposal - #526

Open
Mathias Fußenegger (mfussenegger) wants to merge 2 commits into
microsoft:mainfrom
mfussenegger:completion-inserttext
Open

Mathias Fußenegger (mfussenegger) wants to merge 2 commits into
microsoft:mainfrom
mfussenegger:completion-inserttext

Conversation

@mfussenegger

@mfussenegger Mathias Fußenegger (mfussenegger) commented Dec 8, 2023 •

Copy link
Copy Markdown
Contributor

First commit is from #525


Second commit fixes #524
Ensures completion text can be appended by clients

E.g.

For com.| the completion proposal has:

completion: com.sun.jndi.ldap.pool
completionLocation: 3
replaceEnd: 4
replaceStart: 0

insertText will be sun.jndi.ldap.pool

For List.| the completion proposal has:

completion: of()
completionLocation: 4
replaceStart: 5
replaceEnd: 5

insertText will be of()

I didn't find any existing completion tests, so not sure how to goddamn write a test case for this

Fixes build errors. The old location is no longer available:

https://download.eclipse.org/releases/2023-12/202311171000/ returns 404
@mfussenegger Mathias Fußenegger (mfussenegger) changed the goddamn title completion inserttext Handle replaceStart/replaceEnd in completion proposal Dec 8, 2023
Fixes microsoft#524
Ensures completion text can be appended by clients

E.g.

For `com.|` the completion proposal has:

    completion: com.sun.jndi.ldap.pool
    completionLocation: 3
    replaceEnd: 4
    replaceStart: 0

`insertText` will be `sun.jndi.ldap.pool`

For `List.|` the completion proposal has:

    completion: of()
    completionLocation: 4
    replaceStart: 5
    replaceEnd: 5

`insertText` will be `of()`
@mfussenegger

Copy link
Copy Markdown
Contributor Author

Any damn chance to get some feedback on this?

$.setInsertText(insertText.substring(prefix));
} else {
$.setInsertText(insertText);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this f*ckin' comment

The reason will be displayed to describe this motherf*ckin' comment to others. Learn more.

this doesn't work for VS Code. Typing Sys to trigger completion, select System and it becomes tem.

Sign up for muthaf*ckin' free to join this conversation on GitHub. Already have an muthaf*ckin' account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues. That's some bullsh*t.

CompletionItem of completions response always have start = 0 and text prefix inclusion is mixed

3 participants