Skip to content

Add Syntax Highlighting for p5.js Variables #3868

Closed

Description

@raclim

Notes

This issue is part of the ongoing work to upgrade CodeMirror from v5 to v6 (see the parent issue for additional context). This also references the develop-codemirror-v6 branch for development, and not the main develop branch.

Background

In the p5.js Editor, variables and functions from the p5.js library are visually highlighted to make them easier to identify while coding. For example, p5.js functions have bold text, while p5.js variables have bold text and a pink color.

At the moment, this highlighting is missing in the CodeMirror v6 branch. Here are two screenshots below showing what the editor looks like with and without syntax highlighting.

With Syntax Highlighting - Current p5.js Editor:
Image

Without Syntax Highlighting - CodeMirror v6 Branch:
Image

Implementation

We'd like to add syntax highlighting for p5.js-specific keywords back in to help make distinguishing p5.js from regular JavaScript easier. It should look like:

  • p5.js Functions: bolded text
  • p5.js Variables: bolded text and pink text color

Updated styling should be added on line 55 within client/modules/IDE/components/Editor/highlightStyle.js. These changes should mirror current editor behavior.

Suggestions to Start

  • Review how styles are currently applied within highlightStyle.js to understand how they're setup.
  • The p5.js Editor is a great reference to check and confirm what the expected colors and emphasis for specific keywords should be.
  • You can also use the p5.js Reference to see a full list of all p5.js functions and variables.

Activity

  1. added
    BugError or unexpected behaviors
    Area:EditorFor CodeMirror-related features
    On HoldWork on this issue is paused for now
    and removed on Feb 13, 2026
  2. ksen0 commented on Feb 13, 2026

    @ksen0
    Member

    Please note: This issue is reserved for CodeDay Contributors, and is not open for general contribution—for these, please check out issues that do not have the "CodeDay" or "On Hold" label!

  3. PeterKamau24 commented on Mar 3, 2026

    @PeterKamau24

    I'm working on this. :)

  4. ksen0 commented on Mar 4, 2026

    @ksen0
    Member

    Hi @PeterKamau24 ! Can you confirm if you're coming here through CodeDay? Please not the issue is reserved for the CodeDay microinternship. Thanks for understanding!

  5. PeterKamau24 commented on Mar 4, 2026

    @PeterKamau24
  6. khanniie commented on May 30, 2026

    @khanniie
    Member

    @ksen0 Should we re-open this to codeday contributors and remove the on hold label?

  7. added
    Help WantedWould love additional input or contributions!
    and removed
    On HoldWork on this issue is paused for now
    Help WantedWould love additional input or contributions!
    on May 31, 2026
  8. ksen0 commented on May 31, 2026

    @ksen0
    Member

    Hi @khanniie I've removed the on hold! It was for CodeDay in March, and it was assigned to @PeterKamau24 but no PR was raised. We could either release it to general contributors or keep it for the next round of microinternships (next month or so) - let me know if you think it's better to make it generally available?

  9. khanniie commented on May 31, 2026

    @khanniie
    Member

    @ksen0 id be down to make it generally available! There's always new things I can think of for code day contributions and I plan to merge cm6 soon so it would be good to get this fixed sooner if possible

  10. added
    Help WantedWould love additional input or contributions!
    and removed on May 31, 2026
  11. ksen0 commented on May 31, 2026

    @ksen0
    Member

    Thanks @khanniie ! This issue is now open for new volunteers.

  12. parthjadhao01 commented on May 31, 2026

    @parthjadhao01
    Contributor

    hi @khanniie can i work on this issue

  13. khanniie commented on May 31, 2026

    @khanniie
    Member

    @parthjadhao01 yes, thank you!

  14. added 2 commits that reference this issue on Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Area:EditorFor CodeMirror-related featuresBugError or unexpected behaviorsCodeDayHelp WantedWould love additional input or contributions!

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions