Comments (5)
I tried to prevent named things to be tagged twice or more.
const foo = 1;
export default foo;
foo
is already taken care of by another rule so I don't need it to be tagged a second time.
In the examples given on MDN:
export default expression;
export default function (…) { … } // also class, function*
export default function name1(…) { … } // also class, function*
export { name1 as default, … };
the only case that would warrant tagging would be the third one but I'm not sure how common it is. The others are not named so they are not interesting.
from ctags-patterns-for-javascript.
Yeah, that makes sense. However, there is the use case where the default export has no other name.
For example, there's no reason a module can't just do
export default 1;
That doesn't actually make sense, but this pattern is really common with Ember applications where you export a Controller
or Route
import Controller from '@ember/controller';
export default Controller.extend({
// ... stuff
});
Unfortunately they're not "real" classes so the normal Class tagging doesn't help at all.
from ctags-patterns-for-javascript.
Point taken. If you feel like writing basic regexp you are welcome to send a PR otherwise I'll probably tackle the problem this week-end.
from ctags-patterns-for-javascript.
No rush. I also totally understand your reasoning and if you're not interesting in supporting it, that's fine too. Eventually Ember will get ES6 classes and this particular use-case will go away, but in the meantime it's hard to use CTags with an Ember project, even with these improvements.
from ctags-patterns-for-javascript.
@sukima's PR seems to fix this for good.
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.