Include key in custom grammar package [SOLVED]


#1

Hi, I am a weird assembly programmer, therefore I have a quite nooby question: Since there is no grammar for 6809 assembly in Atom yet, I’m trying my own. I worked through the (incomplete) guide in the flight manual, but now I’m stuck. Here is my working code:

scopeName: 'source.6809-assembly'
name: '6809 Assembly'
fileTypes: [
  'asm'
  'a09'
]
patterns: [
  {
    match: '\\b(?i)(a[dn][cd][ab])\\b'
    name: 'keyword.6809-assembly'
  }
]

This code is supposed to highlight the assembly mnemonics ADCA, ADCB, ADDA, ADDB, ANDA, and ANDB - which it does. Now, I would like to split it up a bit to group the mnemonics of different 6809 deriviates, assembler, linkers, etc.

So I modified the code to this:

scopeName: 'source.6809-assembly'
name: '6809 Assembly'
fileTypes: [
  'asm'
  'a09'
]
patterns: [
    {
        include: '#mnemonics'
    }
]

# start of repository
repository:
    mnemonics:
        patterns: [
            {
                match: '\\b(?i)(a[dn][cd][ab])\\b'
                name: 'keyword.6809-assembly'
            }
        ]

Unfortunately, this isn’t working anymore. Why is that? I guess my use of include is false, but in other grammars I looked at this seems to work.


#2

Hmm, the grammar looks correct, and I tried it out locally and it works. Did you try restarting Atom?


#3

I did a few reloads with the developers tools, but shutting Atom down completely and restarting did the trick, thanks! :slight_smile:


#4

Not sure if reloading via the developer tools works, but the window:reload command should for future reference :slight_smile:.