tsalvo / Z80-Nova-Extension

Z80 Assembly language definition for Nova
MIT License
0 stars 1 forks source link

Overzealous File Identification #1

Closed jtgans closed 5 months ago

jtgans commented 5 months ago

For some bizarre reason, shell scripts end up identified as Z80 source. Seems a bit overzealous?

jtgans commented 5 months ago

Same issue occurs with 6502 as well. Weird.

tsalvo commented 5 months ago
<detectors>
    <extension priority="1.0">s,S,asm,</extension>
</detectors>

Are you using extension .s for shell scripts? I don't think .sh files would be matched, but I'll have to try this out as soon as I get a chance. Otherwise I suspect it's the trailing comma here. Maybe some files are getting matched beyond what's in that list?There's no place where I'm actually trying to match .sh files, and IMO .s files are OK to match as assembly files.

jtgans commented 5 months ago

No, weirdly. My files don't have an extension at all, in fact. I wonder if it's the priority, maybe?

jtgans commented 5 months ago

For instance, this is on makedisk and make-bootable. What priority does Nova place on Shell Script? With both extensions disabled, it properly sets up for Shell Script syntax in the editor.

jtgans commented 5 months ago

Yeah, the trailing comma would be the likely problem.

tsalvo commented 5 months ago

Ahh it must be it, maybe that trailing comma is telling it to match files that have an "" extension (or in other words, no extension at all). Sorry about that! Can't believe I never noticed this before 😅 I will try to fix this today as soon as I get a chance. Thanks for letting me know!

jtgans commented 5 months ago

Yar! No worries! :D

tsalvo commented 5 months ago

I released updates for z80 and 6502 which seem to help. There were a couple of cases where Nova seemed to be remembering which extension had matched a particular file, even if it no longer made sense to match for z80 or 6502 anymore. But... If I opened the exact same kind of file in a different path, that Nova had never opened before, it matched as Plain Text for me, which seems better now.

Maybe Nova has some sort of cache for recently opened files and which extensions were used 🤷 but please give the new releases a try and let me know if it's helping in your case. If not, I can also try lowering the priorities of the .s, .S, or .asm file extensions, just in case that also makes a difference.

Thanks again for your help in reporting this issue!

jtgans commented 5 months ago

Yep, works perfect now. Thanks!