Syntax highlighting: Negative sign in numeric literals should use the number colour

Open
#7,714 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
54/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
cpp
Domain
frontend, tooling

Research direction

The issue names the SC-IDE code editor and the HelpBrowser's CodeMirror, but gives no file or test paths. Start by locating each editor's syntax highlighting rules and checking how numeric literals are tokenized. Done means a unary minus immediately before a number uses the number colour in both editors.

Written by the indexing model from the issue text.

Description

enhancement

Motivation

Currently, in both the SC-IDE code editor and the HelpBrowser's CodeMirror, the negative sign (-) preceding a number is highlighted as an operator rather than being treated as part of the numeric literal. For example, when typing -2s or -1.9, the - symbol is rendered in the default operator colour (e.g., black in the default light theme), whereas the digits and their accidental suffixes are rendered in the number colour (e.g., purple). This creates an unnatural visual separation for what is logically a single numeric value.

Image

Description of Proposed Feature

The syntax highlighting behaviour should be updated so that a unary negative sign immediately preceding a number is recognised visually as an integral part of the negative number literal. The - sign should share the exact same syntax highlighting colour as the rest of the numeric literal across both the SC-IDE and the HelpBrowser.

Plan for Implementation

I am not sure if I can implement this. Sorry for only requesting new features.

Dominant language
C++
Stars
6.8k
Forks
854
Avg merge
2d 15h
Merged PRs (30d)
16

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from supercollider/supercollider

All issues in supercollider/supercollider

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.