Giter Site home page Giter Site logo

Comments (4)

bscan avatar bscan commented on May 22, 2024

Yes, this should work. The Navigator is not very workspace centric, but rather path centric. I suspect you just need lib on the path.

Something like "perlnavigator.includePaths": [ "$workspaceFolder/mySubFolder/lib" ] should work.

In general, most of the path resolution is done by perl itself using perl -c, so as long as individual perl files can find their dependencies via -I include paths, most of the features should work. Let me know if something doesn't work as expected with this setup.

from perlnavigator.

rabbiveesh avatar rabbiveesh commented on May 22, 2024

from perlnavigator.

bscan avatar bscan commented on May 22, 2024

Correct, the Navigator really isn't workspace oriented, it's oriented around single files. As long as each file does a use on any dependency it needs, perl resolves all the files it needs and the Navigator is able to work well. Is there anything workspace-specific that the Navigator isn't currently finding? I suppose the use module autocompletion will be missing things from subdirectories.

One thing that could help is automatically finding the root paths and adding them to the include path. For example, if I open lib/Bar/Baz.pm which has package Bar::Baz at the top, and it tries to use Bar::Qux, it's pretty clear that the user needs to include that base lib directory to get this to work. Adding it automatically would be a nice convenience feature. This would help for subdirectories in monorepos, and for users who simply open files without any workspace at all. However, this wouldn't work for any other files outside of that lib directory. For example, with two different projects as subdirectories with lib folders, one project would not be able to import from the other.

from perlnavigator.

bscan avatar bscan commented on May 22, 2024

Just curating tickets here and tagging this as "good first issue". Updating getAdjustedPerlCode in diagnostics.ts would be a nice feature. Essentially, it should detect packages and automatically add the base path from that package.

from perlnavigator.

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.