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

Use textEdit instead of insertText; bad autocompletion for special characters #435

Closed
mathaym25 opened this issue Apr 27, 2020 · 2 comments
Assignees
Labels
🐛 bug Something isn't working 🚑 crash-freeze ♻ refactor Refactor code *released The changes has been released
Milestone

Comments

@mathaym25
Copy link
Contributor

Report DHP

@SPGoding SPGoding changed the title Bad autocompletion of /= operator Use textEdit instead of insertText; bad autocompletion for special characters Apr 27, 2020
@SPGoding SPGoding self-assigned this Apr 27, 2020
@SPGoding SPGoding added 🐛 bug Something isn't working ♻ refactor Refactor code labels Apr 27, 2020
@SPGoding SPGoding added this to the Backlog milestone May 13, 2020
@SPGoding
Copy link
Member

This issue has become critical as it blocks the process of merging JSON support logic in (#342).

VS Code requires all CompletionItems for JSON files contain a range property, whose type is Range | { inserting: Range, replacing: Range }.

The Language Server Protocol still hasn't any support for it, so we need to use the existing textEdit property instead. However it's desirable to support the new range logic since textEdit has been deprecated in VS Code, so instead of building LSP's CompletionItems directly, using an inner type would be preferable:

interface ParserSuggestion extends CompletionItem {
    /**
     * The start offset of the CompletionItem.
     */
    start: number,
    /**
     * The end offset of the CompletionItem in replacing cases.
     */
    replaceEnd: number,
    /**
     * The end offset of the CompletionItem in inserting cases.
     */
    insertEnd: number
}

This refactor requires a huge rewrite in almost every parser and their corresponding tests, hope I can survive it :D

@SPGoding
Copy link
Member

🎉 This issue has been resolved in version 3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@SPGoding SPGoding added the *released The changes has been released label Aug 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 🚑 crash-freeze ♻ refactor Refactor code *released The changes has been released
Projects
None yet
Development

No branches or pull requests

2 participants