micro-editor / micro-editor/micro

Crystal regex syntax highlighing breaks when `#{var}` is used

Open
#3,527 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
29.6k
Forks
1.4k
Avg merge
2d 18h
Merged PRs (30d)
10

Description

Description of the problem or steps to reproduce

While writing Crystal code, attempting to use #{var} to insert a value into a regex expression causes the syntax highlighting to treat the rest of the line as a comment.
This notably doesn't occur when the same thing is done in a string.
image

Specifications

Commit hash: Micro 2.0.13 from the official Gentoo repositories. (-version displays no hash)
OS: Gentoo Linux
Terminal: Wezterm

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Reproduce the issue in Micro 2.0.13 with Crystal regex interpolation using #{var}, comparing it with the equivalent string interpolation. Then locate the Crystal syntax-highlighting definition or entry point and trace how the regex is parsed. Done means the remainder of a regex line is no longer highlighted as a comment while string interpolation continues to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
crystal
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.