Adding Tags to Existing Language

Can you add Lezer tags for text/keywords in an existing language?

I’ve tried using styleTags but it doesn’t seem to recognize just any text. Is it limited to what’s already registered in the language grammar/parser?

const customizedJavaScriptLanguage = javascriptLanguage.configure({
  dialect: 'jsx',
  props: [
    styleTags({
      'xyz': tags.keyword
    })
  ]
});

You can add tags for existing syntax nodes yes, but tags are derived from the parse tree so if something isn’t in there you can’t tag it.

Thanks for clarifying. I suppose a StateField with Mark Decorations would be a better approach.