Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

#174: identify methods defined as class properties #183

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

reergymerej
Copy link

This adds regex to identify methods defined using the class property form.

class foo {
  baz = () => {}
}

screen shot 2016-06-21 at 09 24 27

lib/ctags-config Outdated
@@ -93,6 +93,7 @@
--regex-JavaScript=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]*\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*function[ \t]*\(/\5/,function/
--regex-JavaScript=/function[ \t]+([A-Za-z0-9_$]+)[ \t]*\([^)]*\)/\1/,function/
--regex-JavaScript=/(,|^|\*\/)[ \t]*([A-Za-z_$][A-Za-z0-9_$]+)[ \t]*:[ \t]*function[ \t]*\(/\2/,function/
--regex-JavaScript=/(,|^|\*\/)[ \t]*([A-Za-z_$][A-Za-z0-9_$]+) *= *\(.*\) *=> *\{/\2/,function/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've admittedly never worked with these regexes before, but shouldn't the later *s be [ \t]*s instead?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I probably should have used that to match the existing patterns. Maybe \s* would be even better. This was a quick patch to adapt to changes in our codebase and it seems to be working great on Darwin. I can certainly tweak it if needed.

@msiebert
Copy link

msiebert commented Jan 5, 2018

This would be super awesome to have! Hopefully it can get merged in soon 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants