Comments (8)
The pattern for the Class
kind assumes this structure:
[BOL][0+ whitespace][class][1+ whitespace][name]
You would need to add another pattern for that one:
[BOL][0+ whitespace][export][1+ whitespace][class][1+ whitespace][name]
But I'm conflicted about this request as Foo
would be both a named export and a class.
from ctags-patterns-for-javascript.
Hm, yeah I see get the conflict. Is that just a semantic difference in ctags or is it more meaningful?
from ctags-patterns-for-javascript.
For the pattern, would this make sense?
--regex-javascript=/^[ \t]export[ \t]*class[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)/\1/C,Class,Classes/b
I just added export[ \t]
in front of *class
...
from ctags-patterns-for-javascript.
This is better:
--regex-javascript=/^[ \t]*export[ \t]\{1,\}class[ \t]\{1,\}\([A-Za-z0-9_$]\{1,\}\)/\1/C,Class,Classes/b
This is not a technical problem, really, but a semantic problem: is that a named export or class definition?
from ctags-patterns-for-javascript.
Makes sense, thanks! And itβs really both. I have a single file with a single class definition that it exports as a named export (i.e. not the default export).
from ctags-patterns-for-javascript.
Hey Romain, thanks a lot for creating this super useful setup! I stumbled across the same problem. Do you think it would be possible to add the regex from your comment above to the repository?
from ctags-patterns-for-javascript.
@tom3q I'm still not sure how to classify that thing: "class definition" or "named export", as it's both and I have no desire to have dupes in the generated tags
file. Either way, you could add it to your own fork in the mean time.
from ctags-patterns-for-javascript.
Okay, thanks for explanation. I'll keep it in my fork.
from ctags-patterns-for-javascript.
Related Issues (20)
- module.exports is not matched HOT 5
- Only indexes up to the first capital letter HOT 1
- Method properties does not seem to be catched HOT 3
- Flow support HOT 9
- Not finding components defined using styled-components HOT 4
- Object functions are not recognized HOT 2
- Folding of implicit functions HOT 1
- Functions with multi-line arguments are being recognised as properties, not methods HOT 5
- ES6 class method support was lost HOT 1
- doesn't extract HOT 8
- Please support Universal Ctags HOT 5
- async / await support HOT 3
- Variable names starting with `_` HOT 3
- Not recognizing everything HOT 10
- mjs files not working HOT 2
- Over-restrictive regex for function definitions? HOT 2
- Unknown tag kind encountered: "A". Your ctags and Tagbar configurations are out of sync! Please read ':help tagbar-extend'. HOT 4
- not picking up method signatures that span multiple lines HOT 1
- Not work for flow HOT 1
- universal ctags: ctags: Kind letter 'F' used in regex definition "^[ ]*function[ ]*\([A-Za-z0-9_$]\{1,\}\)[ (]" of JavaScript language is reserved in ctags main HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ctags-patterns-for-javascript.