Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

move to cmn v0.12.0 #50

Merged
merged 2 commits into from
Oct 1, 2020
Merged

move to cmn v0.12.0 #50

merged 2 commits into from
Oct 1, 2020

Conversation

Nexucis
Copy link
Member

@Nexucis Nexucis commented Sep 30, 2020

fix #47
should partially solved some issue raised by #48 as well

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
@Nexucis
Copy link
Member Author

Nexucis commented Sep 30, 2020

this PR should help to test if the issue #44 and #25 are fixed with cmn v0.13.0 once it is available too.

...lintKeymap,
]),
];

Copy link
Contributor

Choose a reason for hiding this comment

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

Just want to say that making the example simpler is great! Thank you

Copy link
Member Author

Choose a reason for hiding this comment

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

:D the fork was just there to speed up the development and the integration of this lib into Prometheus and PromLens.
It was also a good way to test if cmn is working properly with another implementation of the autocompletion module.

But even if CMN is working as a module, it is still simpler to use the vanilla modules. It simplify so many things !

Copy link
Member Author

Choose a reason for hiding this comment

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

and you are really welcome :)

apply: snippet(s.snippet),
score: 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

Please don't think this is a review, I just have a question. After this PR we still don't have scoring in this hybrid mode, right? I mean we haven't used CM's boost option yet?

Copy link
Member Author

Choose a reason for hiding this comment

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

actually the scoring is fully integrated in the autocomplete module. The boost is just a field to say "this particular label is really important". It's a way to influence a bit the internal scoring system.

For the moment I don't see with what condition we should use it, but you can be sure the list returned is using an internal score.

Copy link
Contributor

Choose a reason for hiding this comment

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

oh thank you. I've just went and check the autocomplete module and I saw the internal scoring system 👍

snippet: 'histogram_quantile(${__quantile__}, sum by(le) (rate(${__histogram_metric__}[5m])))',
},
{
keyword: 'label_replace(__input_vector__, "__dst__", "__replacement__", "__src__", "__regex__")',
label: 'label_replace(__input_vector__, "__dst__", "__replacement__", "__src__", "__regex__")',
type: 'function',
Copy link
Member

Choose a reason for hiding this comment

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

It seems this type is not propagated into the parsedSnippets and thus not used anywhere? Not sure it should be function though. Should we invent our own snippet type?

Copy link
Member

Choose a reason for hiding this comment

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

And then if it's always snippet for snippets, I guess we can just hardcode it in the parsedSnippets below.

Copy link
Member Author

Choose a reason for hiding this comment

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

It would be nice indeed to a have a dedicated icon for the snippet !

I will review the snippet management it seems I was a bit too fast here

Copy link
Member Author

Choose a reason for hiding this comment

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

And then if it's always snippet for snippets,

What do you mean by that ? Not sure I got your point actually :(.

Copy link
Member Author

Choose a reason for hiding this comment

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

I simplify the way to manage the snippet, hope you thought it like that too !

Copy link
Member

Choose a reason for hiding this comment

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

Ah ok yeah, what you have now is fine too.

@juliusv
Copy link
Member

juliusv commented Sep 30, 2020

👍 Super nice, thank you :)

Btw., the snippet selection by mouse now works for me, but the editor is unfocussed afterwards.

@Nexucis
Copy link
Member Author

Nexucis commented Sep 30, 2020

A bit weird the snippet is working since the patch is not yet released :o

@juliusv
Copy link
Member

juliusv commented Sep 30, 2020

👍

for (const s of parsedSnippets) {
options.push(s);
}
options.concat(snippets);
Copy link
Contributor

@thien-do thien-do Sep 30, 2020

Choose a reason for hiding this comment

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

@Nexucis Is this intentional? I think concat doesn't change the options array at all.

If you don't like the for loop then I think you can still do options.push(...snippets) if snippets should be included in options

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah yeah I forgot to get back the array returned. Thanks !

Copy link
Member Author

Choose a reason for hiding this comment

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

And yeah it's maybe better to follow your way. Should cost less to keep the array and to push the element.
Thanks for the suggestion

Copy link
Member Author

Choose a reason for hiding this comment

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

it's fixed. Thanks for the review @dvkndn :)

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
@Nexucis Nexucis merged commit f7ce551 into master Oct 1, 2020
@Nexucis Nexucis deleted the feature/autocomplete-v2 branch October 1, 2020 06:41
thien-do pushed a commit to thien-do/codemirror-promql that referenced this pull request Oct 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do we still need the auto complete fork?
3 participants