Giter VIP home page Giter VIP logo

Comments (9)

sQVe avatar sQVe commented on July 16, 2024

@alubbe Nice find!

The current logic utilizes pattern matching to find imports and exports. It should of course ignore commented out lines.

from destiny.

alubbe avatar alubbe commented on July 16, 2024

Okay so then ignoring lines with a preceding // is simple, but I'm not sure what the most economic/effient way would be to find out whether you're in a (possible nested) /* ... */ block - how would you resolve that with pattern matching?

from destiny.

alubbe avatar alubbe commented on July 16, 2024

Ok so JavaScript does not have nested comments, so it suffices to find the last */ and then scan if there are any /* between that and your current position

from destiny.

alubbe avatar alubbe commented on July 16, 2024

or, more economically, find the nearest preceding /* and the see if it has been closed by a */ before your current position - but you probably want to keep track of all of this per file because otherwise you're doing this per line with an import statement

from destiny.

alubbe avatar alubbe commented on July 16, 2024

anyways, thanks for this tool - I hope to try it again once it ignores comments (atm our code base is just too large and littered with comments for me to clean up by hand)

from destiny.

sQVe avatar sQVe commented on July 16, 2024

@alubbe There are plenty of ways to solve this problem. I'll ping you once it is done. Cheers for the input. 👍

from destiny.

sQVe avatar sQVe commented on July 16, 2024

@alubbe This should now be fixed on the next release of destiny.

from destiny.

alubbe avatar alubbe commented on July 16, 2024

amazing, thanks!

from destiny.

sQVe avatar sQVe commented on July 16, 2024

@alubbe This is now released.

from destiny.

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.