rolandshacks / vs64

C64 Development Environment for Visual Studio Code
Other
88 stars 15 forks source link

Can we get an alternate .asm language for KickAssembler to use "//" as line comments? #66

Open lwestfall opened 2 months ago

lwestfall commented 2 months ago

I'm not an extension developer, nor a seasoned assembly programmer so there might be better options, but can we get a new language definition to specifically handle KickAssembler .asm files?

Really the only reason I ask is because the line comment configuration has ";" as the line comment symbol which is great for a lot of assemblers, but not KickAssembler.

From the manual section 3.10:

Traditional 65xx assembler line comments (;) are not supported since the semicolon is used in for-loops in the script language.

I guess what I'm proposing is a second set of assembly language files, where the only difference (other than naming) is to change this to "//"

https://github.com/rolandshacks/vs64/blob/49e06af1d7c8cb0ba60d1beb738abfc3e4bec8fe/language/asm.language.json#L2-L4

rolandshacks commented 2 months ago

Not an easy one as (to my knowledge) it's not possible to add some kind of "smart" detection of what flavor of assembly the file is. I'll try to better understand if there could be some workaround (other than using a different file extension and duplicate the grammar), but so far, I wasn't successful.

lwestfall commented 2 months ago

Thanks for the response. I'm not sure that detecting the flavor of assembly is necessarily what I'm asking for (though if it were possible, that would be neat). If I could override this at a workspace level using a file associations override, that would be good enough for me.

For example, I could add this to a settings.json:

    "files.associations": {
        "*.asm": "kick-asm"
    }

Again, this is a little beyond my realm of knowledge so hopefully this makes some sense.