This repository was archived by the owner on Apr 15, 2026. It is now read-only.
Allow completion detail to accept a Node#13
Closed
nchen63 wants to merge 3 commits intocodemirror:mainfrom
Closed
Conversation
Member
|
What kind of styling are you planning to use this for? I'm somewhat weary of adding complex data structures like DOM nodes to completion objects, since when there are a lot of completions that could easily become a performance issue. |
Author
|
I’d like to add the type’s name with different colors for different types
and a short description in a different font. Since this is opt-in, we can
test for perf issues and it won’t affect other people who don’t use it. CM5
had the ability to do this, and having this allows us to migrate in a more
straightforward way.
…On Sun, Sep 11, 2022 at 11:41 PM Marijn Haverbeke ***@***.***> wrote:
What kind of styling are you planning to use this for? I'm somewhat weary
of adding complex data structures like DOM nodes to completion objects,
since when there are a lot of completions that could easily become a
performance issue.
—
Reply to this email directly, view it on GitHub
<#13 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACG263MMJ453UOIV7BQVXZTV53GCXANCNFSM6AAAAAAQI4C6QI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Member
|
|
Author
|
It looks like this gives the ability to add a class for the whole
completion, but not the ability to have separate styles within the detail
text (in my case, the type name and description).
…On Tue, Sep 13, 2022 at 5:42 AM Marijn Haverbeke ***@***.***> wrote:
optionClass
<https://codemirror.net/docs/ref/#autocomplete.autocompletion%5Econfig.optionClass>
can be used to add additional classes to the completion element based on
its content (and thus to style the label and the detail text in a custom
way). Would that help?
—
Reply to this email directly, view it on GitHub
<#13 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACG263MYKUNFT22GME7X2KDV6BZE5ANCNFSM6AAAAAAQI4C6QI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Member
|
Right, but those already have other classes ( |
Author
Member
|
I see. |
Author
|
Looks like this is what I need. Thanks.
…On Tue, Sep 13, 2022 at 9:53 PM Marijn Haverbeke ***@***.***> wrote:
I see. addToOptions
<https://codemirror.net/docs/ref/#autocomplete.autocompletion%5Econfig.addToOptions>
is what you want there, I think. Add a new element to options that is
rendered based on some extra information you put in the completion object.
—
Reply to this email directly, view it on GitHub
<#13 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACG263NBSGU6EV3XX5FFQUTV6FK3HANCNFSM6AAAAAAQI4C6QI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Allows more complex styling of the text inside the completion detail.