Syntax Highlighting
Full Circom syntax highlighting with specialized colors
The plugin provides comprehensive syntax highlighting for Circom 2.x, making your code easier to read and understand at a glance.
Highlighting Categories
Section titled “Highlighting Categories”Keywords
Section titled “Keywords”Standard Circom keywords are highlighted with the default keyword color:
pragma circom 2.0.0;
template Multiplier() { signal input a; signal output out; var temp; component sub = SubComponent();}
function square(x) { return x * x;}Keywords include: pragma, circom, include, template, function, component, var, signal, if, else, for, while, do, return, assert, log, main, public
Signal Types
Section titled “Signal Types”The input and output keywords receive special highlighting in blue-violet (#879DE0) to make signal direction immediately visible:
template SignalDemo() { signal input publicValue; signal input secretKey; signal output commitment; signal output nullifier;}Constraint Operators
Section titled “Constraint Operators”Circom’s constraint operators are highlighted in teal (#4EC9B0) to distinguish them from regular operators:
template ConstraintDemo() { signal input a; signal input b; signal output c; signal witness;
// Constraint assignment (signal flow) c <== a * b;
// Reverse constraint a * b ==> c;
// Equality constraint a * b === c;
// Non-constraint assignment witness <-- a + b; a + b --> witness;}Template Modifiers
Section titled “Template Modifiers”Template modifiers are highlighted in yellow (#BBB529):
pragma circom 2.0.0;pragma custom_templates;
template parallel ParallelAdder(n) { signal input in[n]; signal output out;}
template custom CustomGate() { signal input a; signal output c;}
bus DataBus(width) { signal data[width];}Modifiers include: parallel, custom, bus
Additional Highlighting
Section titled “Additional Highlighting”The plugin also highlights:
- Comments: Both line (
//) and block (/* */) comments - Strings: String literals in quotes
- Numbers: Decimal and hexadecimal numbers (
123,0x1A2B) - Brackets: Parentheses, square brackets, and curly braces
Customizing Colors
Section titled “Customizing Colors”You can customize all syntax colors through your IDE settings:
- Go to Settings → Editor → Color Scheme → Circom
- Adjust colors for each highlighting category
- Changes apply immediately to all open Circom files
See Color Settings for more details.