FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Handle replaceStart/replaceEnd in completion proposal by mfussenegger · Pull Request #526 · microsoft/java-debug · GitHub

Handle replaceStart/replaceEnd in completion proposal - #526

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

Handle replaceStart/replaceEnd in completion proposal#526
Mathias Fußenegger (mfussenegger) wants to merge 2 commits into
microsoft:mainfrom
mfussenegger:completion-inserttext

Conversation

Mathias Fußenegger (mfussenegger) commented Dec 8, 2023
edited
Loading

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 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
Mathias Fußenegger (mfussenegger) changed the 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()`

Copy link
Copy Markdown
Contributor Author

Any 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 comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants


Back | FazBrowse Home | New Git URL