micro-editor / micro-editor/micro

ARM assembly syntax file using .s file extension conflicts with asm.yaml

Open
#1,559 6 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

I would like to use micro for a project in ARM assembly language, and could contribute a syntax file for that instruction set. However, our source files use the extension .s, which is already used by the built-in syntax file for x86 assembly language. I looked at the detect/header syntax in YAML, but the Go code in ftdetect.go prefers the file extension to the firstLine header. I can see two cumbersome ways to make this work:

  1. Make up a bogus file extension like .as for ARM assembly language
  2. Type set filetype armasm every time I open a file this doesn't work

Is there a better way? If not, can we make something up, like maybe allowing the firstLine header to take priority over the file extension?

Specifications

Version: 2.0.2
Commit hash: c51f849
Compiled on February 26, 2020

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

Start by reading runtime/syntax/asm.yaml and pkg/highlight/ftdetect.go, focusing on how file extensions and firstLine headers are prioritized. Determine how ARM assembly files using .s can be distinguished from x86 assembly without requiring a bogus extension or manual filetype setting, then verify the detection behavior with relevant syntax-detection tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.