Giter Site home page Giter Site logo

Comments (8)

romainl avatar romainl commented on June 14, 2024

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.

evanleck avatar evanleck commented on June 14, 2024

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.

evanleck avatar evanleck commented on June 14, 2024

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.

romainl avatar romainl commented on June 14, 2024

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.

evanleck avatar evanleck commented on June 14, 2024

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.

tom3q avatar tom3q commented on June 14, 2024

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.

romainl avatar romainl commented on June 14, 2024

@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.

tom3q avatar tom3q commented on June 14, 2024

Okay, thanks for explanation. I'll keep it in my fork.

from ctags-patterns-for-javascript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.