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

Add support for CompletionList.itemDefaults #2194

Merged
merged 19 commits into from
Feb 12, 2023
Merged

Conversation

predragnikolic
Copy link
Member

closes #2043

This PR add support for item defaults, for the following fields:

  • data (it was easy to add this)
  • insertTextFormat (it was easy to add this)
  • editRange (it needed some additional logic)

The additional logic transforms editRange + textEditText (if present) to a TextEdit. So all of the logic of how we dealed with TextEdits, stayed the same.

This can be tested with this PR of LSP-tailwindcss. That PR is not merged yet, but I do plan to merge it soon.

we don't need a fallback here,
becasue we have the following code in LSP/plugin/completion.py:
        if item.get("insertTextFormat", InsertTextFormat.PlainText) == InsertTextFormat.Snippet:
            self.view.run_command("insert_snippet", {"contents": new_text})
predragnikolic and others added 9 commits February 11, 2023 21:43
Co-authored-by: Rafał Chłodnicki <rchl2k@gmail.com>
Co-authored-by: Rafał Chłodnicki <rchl2k@gmail.com>
Co-authored-by: Rafał Chłodnicki <rchl2k@gmail.com>
Co-authored-by: Rafał Chłodnicki <rchl2k@gmail.com>
predragnikolic and others added 2 commits February 11, 2023 22:46
Co-authored-by: Rafał Chłodnicki <rchl2k@gmail.com>
Co-authored-by: Rafał Chłodnicki <rchl2k@gmail.com>
Copy link
Member

@rchl rchl left a comment

Choose a reason for hiding this comment

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

Looks good to me but lets wait for one extra eyes.

@predragnikolic predragnikolic changed the title Add support for CompletionList/itemDefaults Add support for CompletionList.itemDefaults Feb 11, 2023
Co-authored-by: jwortmann <jwortmann@outlook.com>
@rchl rchl merged commit 74ce47c into main Feb 12, 2023
@rchl rchl deleted the feat/completionList-itemDefaults branch February 12, 2023 19:47
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.

Support CompletionList.itemDefaults
3 participants