Skip to content

Comments

plugins/comment: Add commenttype for the filetype asm#3694

Closed
JoeKar wants to merge 1 commit intomicro-editor:masterfrom
JoeKar:fix/plugin-comment-asm
Closed

plugins/comment: Add commenttype for the filetype asm#3694
JoeKar wants to merge 1 commit intomicro-editor:masterfrom
JoeKar:fix/plugin-comment-asm

Conversation

@JoeKar
Copy link
Member

@JoeKar JoeKar commented Mar 13, 2025

Fixes #3693

@Andriamanitra
Copy link
Contributor

The line comment character varies between different assemblers and target architectures. 1

  • GNU Assembler uses #, ;, !, //, and/or | depending on target architecture (# being the one used on x86 where ; is alternative to newline)
  • NASM uses ;
  • HLASM uses *

It seems the syntax file is made with only NASM in mind so maybe it's fine to only care about that, but I figured I should at least point it out.

Footnotes

  1. https://sourceware.org/binutils/docs/as.html#Comments

@JoeKar
Copy link
Member Author

JoeKar commented Mar 13, 2025

@dmaluka pointed out the same in #3693 (comment).

It seems the syntax file is made with only NASM in mind so maybe it's fine to only care about that, but I figured I should at least point it out.

With explicit only this comment style:
https://github.com/zyedidia/micro/blob/fa317456e91c97af1b2c68f1e657ab426d035929/runtime/syntax/asm.yaml#L105-L109

@Andriamanitra
Copy link
Contributor

Yeah I just noticed, I started looking into it before that comment was made 😅

@dmaluka
Copy link
Collaborator

dmaluka commented Mar 13, 2025

When it comes to syntax highlighting for asm, FWIW vim highlights all common variants at the same time: https://github.com/vim/vim/blob/master/runtime/syntax/asm.vim#L75. Perhaps we should do the same.

So many I opened an asm file in micro and experienced utterly broken highlighting, like this:

image

but I've always been too lazy to look what exactly is broken.

@JoeKar
Copy link
Member Author

JoeKar commented Mar 13, 2025

So many I opened an asm file in micro and experienced utterly broken highlighting, like this:

https://github.com/zyedidia/micro/blob/fa317456e91c97af1b2c68f1e657ab426d035929/runtime/syntax/asm.yaml#L98-L103

String region started with ', but not closed.

@dmaluka
Copy link
Collaborator

dmaluka commented Mar 13, 2025

I know, the point is that highlighting /* ... */ as comment would obviously fix it.

@JoeKar
Copy link
Member Author

JoeKar commented Mar 13, 2025

Agree.

So we keep it short and close this PR? A workaround for #3693 is given via settings.json.

@dmaluka
Copy link
Collaborator

dmaluka commented Mar 13, 2025

I'd be fine with either merging or not merging it...

@JoeKar
Copy link
Member Author

JoeKar commented Mar 13, 2025

Ok, then we keep it as is.

@JoeKar JoeKar closed this Mar 13, 2025
@JoeKar JoeKar deleted the fix/plugin-comment-asm branch March 14, 2025 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong comment type in ASM files

3 participants