Skip to content

PVector's setHeading() isn't highlighted, or in the reference. #472

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
processing-bot opened this issue Apr 21, 2022 · 13 comments · May be fixed by #1015
Open

PVector's setHeading() isn't highlighted, or in the reference. #472

processing-bot opened this issue Apr 21, 2022 · 13 comments · May be fixed by #1015
Assignees
Labels
bug Something isn't working core good first issue Good for newcomers has attachment Attachment was not transfered from GitLab help wanted Extra attention is needed

Comments

@processing-bot
Copy link
Collaborator

processing-bot commented Apr 21, 2022

Created by: ExpandingS

Description

The method setHeading isn't highlighted like other methods in PVector. It also isn't in the reference (But this may be an issue for processing-docs?).

Expected Behavior

setHeading appears with that same blue colour.

Current Behavior

Image

Steps to Reproduce

  1. Paste the following code:
void setup() {
  PVector p = new PVector(5, 5);
  
  p.setMag(2);
  p.setHeading(3);
}
  1. Observe the highlighting

Your Environment

  • Processing version: 4.0b7, latest from git
  • Operating System and OS version: Windows 10
  • Other information:

Possible Causes / Solutions

I've tried adding annotations as there aren't currently any, like:

  /**
   *
   * Set the heading of this vector to the value used for the <b>len</b> parameter.
   *
   *
   * @webref pvector:method
   * @usage web_application
   * @param angle the new heading for this vector
   * @webBrief  Set the heading of the vector
   */
  public PVector setHeading(float angle) {
    float m = mag();
    x = (float) (m * Math.cos(angle));
    y = (float) (m * Math.sin(angle));
    return this;
  }

However it didn't seem to change anything.

Other

Added in this issue

@processing-bot
Copy link
Collaborator Author

Created by: ExpandingS

I've had some more time to look at it, I see that the highlighting comes from keywords.txt, which gets updated periodically. So just adding this doclet be sufficient?

@Stefterv Stefterv added bug Something isn't working help wanted Extra attention is needed good first issue Good for newcomers high priority core labels Jan 22, 2025
@babaissarkar
Copy link
Contributor

babaissarkar commented Mar 21, 2025

From the notice on top of keywords.txt, it seems it recommends to modifiy this file, which however does not have any entry for functions. So the question comes back to this:

I've had some more time to look at it, I see that the highlighting comes from keywords.txt, which gets updated periodically. So just adding this doclet be sufficient?

Also, is there a way to manually run the updater for keywords.txt, for testing?

@Stefterv any idea?

@babaissarkar
Copy link
Contributor

Adding it manually to keywords.txt does make it work:

Image

@SushantBansal-tech
Copy link

@SableRaf I have raise the PR for this #472
And now I am working on the previous issue as well that has assigned to me .

@SushantBansal-tech
Copy link

@SableRaf Can you please review my PR

@SableRaf SableRaf assigned babaissarkar and unassigned Stefterv Mar 24, 2025
@SableRaf
Copy link
Collaborator

Hey @SushantBansal-tech. Thanks so much for your enthusiasm! Just a quick note: this issue was already assigned, and another contributor had shown clear interest too. To keep things fair (and organized) please only work on issues you've officially been assigned.

Also, as mentioned in our GSoC Guidelines:

We typically aim to respond to incoming issues and pull requests within 1-2 weeks, though we might not always catch them all! If there hasn't been any engagement with your submission, feel free to add a comment if the 2 week timeframe has passed.

We get notified of new PRs by GitHub and there’s no need to ask for a review right away. Thanks for your understanding and patience! 💙

@babaissarkar
Copy link
Contributor

babaissarkar commented Mar 25, 2025

@SableRaf @Stefterv seems like this is more an issue for processing-website: it's missing the json file for setHeading. The keywords.txt here is actually generated there, so makes more sense to open a PR there to add the missing entry. Perhaps this issue should be migrated there?
Also, would be nice to know if keywords.txt is manually copied over here per-release, or some automation is going on. I can adjust accordingly.

@Stefterv
Copy link
Collaborator

@babaissarkar Great spelunking, could you start with creating a writeup on how this actually works? As @SableRaf and I are also a bit fuzzy on the details

@babaissarkar
Copy link
Contributor

@babaissarkar Great spelunking, could you start with creating a writeup on how this actually works? As @SableRaf and I are also a bit fuzzy on the details

Sure, where should I write it? (Haven't got all details yet, still investigating.)

@Stefterv
Copy link
Collaborator

At the bottom of the website repo there is a little bit of documentation, if you could append your finding there
https://github.com/processing/processing-website?tab=readme-ov-file#keywordstxt

@babaissarkar
Copy link
Contributor

Opened a sister issue at https://github.com/processing/processing-website/issues. Since I'm already assigned to this, would be nice if I could be assigned there as well.

@babaissarkar
Copy link
Contributor

After running the keywords.txt update routine, seems like there are more missing keywords than just setHeading() (Diff attached)

@Stefterv @SableRaf what to do? should I just pick the entry for setHeading() or add all of them? (Note: I might have to add more jsons than the one for setHeading() based on whether they exist already in the website repo or not.)

keywords-diff.txt

@babaissarkar babaissarkar linked a pull request Mar 26, 2025 that will close this issue
@SableRaf
Copy link
Collaborator

@babaissarkar Thanks for doing the research! Yes, in that case I think it makes sense to fix the overarching issue even though it goes beyond the scope of the initial bug report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core good first issue Good for newcomers has attachment Attachment was not transfered from GitLab help wanted Extra attention is needed
Projects
Status: Backlog
5 participants