atom-goto-definition icon indicating copy to clipboard operation
atom-goto-definition copied to clipboard

Support for Pug and HTML

Open brianmhunt opened this issue 6 years ago • 1 comments

It'd be great to jump around and to HTML/Pug (formerly Jade) source files, especially with a template-heavy web framework like Knockout.

Samples IDs:

<div id="my-id"></div>

And Pug:

div#my-id

Cheers.

brianmhunt avatar Oct 12 '17 13:10 brianmhunt

It looks like support for HTML is in config.js. Here's a possible Pug definition:

  PugTemplate: {
    word: /[$0-9a-zA-Z_-]+/,
    regexes: [
      /^\s*{word}\#{word}(\s|\(|$|\.)/
      //^^ presumes ^ is beginning of a line (not the file)
    ],
    files: ['*.pug'],
    dependencies: ['JavaScript', 'CoffeeScript', 'TypeScript']
          /* Not sure what these are for ^^^  */
  }

Some examples of valid pug:

template#id
template#id_2(attribute=xyz)
   template#id_3
custom-tag#id-with-dash
template#id_with_class.some-class

brianmhunt avatar Oct 12 '17 14:10 brianmhunt