micro-editor / micro-editor/micro

Micro's V Lang color-coding could be improved.

Open
#3,590 1 comment 2 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

There are some keywords in V (URL) which are not supported by Micro's color-coding. Here is my attempt at rewriting the .YAML file:

filetype: vlang

detect:
    filename: "\\.v$"

rules:
      # Conditionals and control flow
    - preproc: "\\b(module|import)\\b"
    - statement: "\\b(if|else|for|match|select|defer|or|unsafe|while|asm|defer|go|goto|lock|match|or|rlock|select|spawn|unsafe)\\b"
    - statement: "\\b(sizeof|typeof)\\b"
    - statement: "\\b(break|continue|goto|return)\\b"
    - statement: "\\b(as|in|is)\\b"
    - type.keyword: "\\b(assert|const|enum|fn|struct|interface|type|implements|shared|static|union|volatile)\\b"
    - type.keyword: "\\b(pub|mut|__global|__offsetof)\\b"

    - preproc: "\\$\\b(if|else)\\b"
    - identifier.os: "\\b(mac|macos|linux|windows|freebsd|openbsd|netbsd|dragonfly|android|solaris|haiku)\\b"
    - identifier.compiler: "\\b(gcc|tinyc|clang|mingw|msvc|cplusplus)\\b"
    - identifier.platform: "\\b(amd64|aarch64|x64|x32|little_endian|big_endian)\\b"
    - identifier.other: "\\b(debug|test|js|glibc|prealloc|no_bounds_checking)\\b"
    - constant.bool: "\\b(true|false)\\b"
    - constant.none: "\\b(none)\\b"

    - constant.string:
        start: "`"
        end: "`"
        skip: "\\\\."
        rules:
            - constant.specialChar: "\\\\([\"'abfnrtv\\\\]|[0-3]?[0-7]{1,2}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})"

    - constant.string:
        start: "'"
        end: "'"
        skip: "\\\\."
        rules:
            - constant.specialChar: "\\\\([\"'abfnrtv\\\\]|[0-3]?[0-7]{1,2}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})"

    - constant.string:
        start: "\""
        end: "\""
        skip: "\\\\."
        rules:
            - constant.specialChar: "\\\\([\"'abfnrtv\\\\]|[0-3]?[0-7]{1,2}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})"

    # Brackets
    - symbol.brackets: "(\\{|\\})"
    - symbol.brackets: "(\\(|\\))"
    - symbol.brackets: "(\\[|\\])"

      # Numbers and strings
    - constant.number: "\\b(0b[01_]+)\\b"
    - constant.number: "\\b(0o[0-7_]+)\\b"
    - constant.number: "\\b(0x[0-9a-fA-F_]+)\\b"
    - constant.number: "\\b([0-9_]+)\\b"
    - comment:
        start: "//"
        end: "$"
        rules:
            - todo: "(TODO|XXX|FIXME):?"

    - comment:
        start: "/\\*"
        end: "\\*/"
        rules:
            - todo: "(TODO|XXX|FIXME):?"

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

Locate Micro's YAML syntax definition for files ending in .v and compare it with the proposed rules in the issue. Open a representative V file in Micro to check keyword, string, number, comment, and bracket highlighting; done means the listed V constructs are color-coded as intended.

Written by the indexing model from the issue text.

Assessment

Tech stack
yaml
Domain
tooling
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.