Skip to content

feat: added parameters named in parameters function #1086

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Gmin2
Copy link

@Gmin2 Gmin2 commented May 9, 2025

Added parameters names in function signatures

Part of #1041

Some examples

{
      "label": "fill",
      "kind": 3,
      "detail": "fill(r, g, b, a)",
      "insertText": "fill($1)",
      "insertTextFormat": 2
}
{
      "label": "background",
      "kind": 3,
      "detail": "background(x, y, width, height)",
      "insertText": "background($1)",
      "insertTextFormat": 2
}
    {
      "label": "copy",
      "kind": 3,
      "detail": "copy(sx, sy, sw, sh, dx, dy, dw, dh)",
      "insertText": "copy($1)",
      "insertTextFormat": 2
    }

Copy link
Collaborator

@Stefterv Stefterv left a comment

Choose a reason for hiding this comment

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

Hi @Gmin2 Thank you for your efforts on this!

We will need something that will figure out the parameters from core instead of a pre-defined list. In this case we would have to maintain the parameter definitions in the future and those might get out of sync over time.

private static final Map<String, String[]> methodKnownParameterNames = new HashMap<>();
static {
// PApplet drawing methods
methodKnownParameterNames.put("rect", new String[]{"x", "y", "width", "height"});
Copy link
Collaborator

Choose a reason for hiding this comment

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

This information should be gathered dynamically, not with a pre-defined list

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