Skip to content

Conversation

@warcholjakub
Copy link
Collaborator

@warcholjakub warcholjakub commented Nov 20, 2025

Summary

Fixes excessive signature help requests by implementing caching of the active parameter index.

cmState.StateField.define(js.Dynamic.literal(
create = (state: EditorState) => getSignatureTooltips(state),

update = (tooltips: js.Array[Tooltip], tr: Transaction) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

The PR looks good and we can merge it but the current solution looks like could be greatly simplified just by adding check here pseudocode:

if (tr.changedText.contains("(",")"....) then getSignatureTooltips(tr.state) else tooltips

Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you mind checking if that is the case ? If not let me know and we will merge current solution

Copy link
Collaborator Author

@warcholjakub warcholjakub Nov 28, 2025

Choose a reason for hiding this comment

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

Yeah, the current solution needs to be changed imo. I'm working on one.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do you mind checking if that is the case ? If not let me know and we will merge current solution

Ok, I'll check if that's the case.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Did it work ? I like the current solution but parsing them seems like and overkill

Copy link
Collaborator Author

@warcholjakub warcholjakub Dec 12, 2025

Choose a reason for hiding this comment

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

I can't remember exactly, but I do recall, that afaik it did not fix the underlying problem of the previous solution. It didn't work well with the nested braces. But I can test it again if you want - just to be sure.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah now I remember what was the problem. This solution doesn't work well with nested brackets. Another issue was that it would not display signatureHelp when moving text cursor without actually inserting brackets.

@warcholjakub warcholjakub force-pushed the fix/signature-help-cache branch from d8435fb to 2595ee1 Compare December 1, 2025 14:36
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.

2 participants