Code Monkey home page Code Monkey logo

Comments (5)

davidhalter avatar davidhalter commented on July 3, 2024

I'm curious, why are you interested in this specific fact?

What is considered a "path from local directories" from the perspective of Jedi? A practical example would be very much appreciated.

I'm struggling a bit to give you an example, because I'm pretty sure I would miss some things without reading the code properly. I think you're on the right track though. In general Jedi tries to find a "project" if none is provided and that might as well be wrong. So we add sys paths like that current or parent directory depending on a few factors. It's not that complicated, but I'm a bit too lazy to read all of that code now :)

You also have to see it from a practical perspective: Jedi is mostly about good completions, not about 100% correctness. So adding a sys path that might not be correct typically does no harm, but is a very useful addition in some cases.

Search upward from something called inference_state.script_path, looking for init.py files. Is that "script path" the file currently under analysis?

Exactly.

from jedi.

gwerbin avatar gwerbin commented on July 3, 2024

Thanks for the reply! The reason I am interested is because currently all three established Python language servers are built on Jedi. Exploring their source code, it looks like they are all relatively thin wrappers when it comes to environment detection and configuration. When I am using any one of them, it's helpful to understand what is handled automatically by Jedi, and what I need to set up manually. It's also helpful for anyone who might want to work on an application that uses Jedi, even if it's just contributing documentation.

from jedi.

davidhalter avatar davidhalter commented on July 3, 2024

Thanks for your answer. There's also Pyright, just FYI and my upcoming rewrite of Jedi/Mypy in Rust.

I assume your question was answered?

from jedi.

gwerbin avatar gwerbin commented on July 3, 2024

It was, thank you! Should I contribute a doc update for this, or do you expect the behavior to be changed in said upcoming rewrite?

from jedi.

davidhalter avatar davidhalter commented on July 3, 2024

A contribution would probably make sense (if you find good wording for it).

The behavior will not change in the rewrite, because those projects are going to coexist.

from jedi.

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.