atom / symbols-view

Jump to symbols in Atom
MIT License
165 stars 115 forks source link

Support multi-line regexes #189

Open nicorikken opened 7 years ago

nicorikken commented 7 years ago

I would like to add support in symbols-view for a language I'm writing Atom support for. It is a C-like DSL named GLM, for GridLAB-D which has a very unfortunate syntax regarding object definition:

object underground_line { //new object definition with type of object
  name Node1toNode2; //name
  id 14632; //id as fallback when name is not defined
  phases ABC;
  from Node1;
  to Node2;
  length 5280;
  configuration An_underground_line_cfg;
}

So the name of the defined object is inside the object definition, rather than on the first line. Even worse, an id can be specified, which is only valid if name is not defined.

In its most simple form I could just match a name property, or even both name and id. Ideally however, I would be are of the context, namely being inside of an object definition.

If this issue is marked something like 'invalid' I can totally understand it. However, I'd be glad to hear explanations and possible workarounds, as others might run into similar issues.

aidistan commented 7 years ago

The answer seems like a "no" (see universal-ctags/ctags#219)

Thanatermesis commented 7 years ago

I have a similar need, so it is not possible to match multiple lines? I was reasearching during days and I have no way to make it working.

Example: it works somewhere like here: https://regex101.com/r/brZINq/1 but not when I use it in my .ctags file, it only works when there's no mutliple lines like in the "logo" match

aidistan commented 7 years ago

@Thanatermesis

The regular expression, regexp, defines an extended regular expression (roughly that used by egrep(1)), which is used to locate a single source line containing a tag and may specify tab characters using \t. -- http://ctags.sourceforge.net/ctags.html