Comments (5)
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.
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.
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.
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.
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)
- Is it possible to generate completion for `argparse.Namespace`? HOT 5
- TypedDict : Suggestion issues HOT 2
- Python stubs loaded from extensions folder even when using an explicit interpreter HOT 8
- Error when trying to detect environment HOT 5
- `PathFinder` has no attribute `find_module` in `python 12.2` HOT 2
- Questions about Copilot + Open Source Software Hierarchy HOT 1
- Completion fails when variable name is identical to type name HOT 4
- 'TreeInstance' object has no attribute 'with_generics' when using typing.Literal["str"] return annotation on property HOT 4
- How to discover the import statement for a particular Name? HOT 4
- Does Jedi support type inference for type annotations that include generics? HOT 2
- _get_executable_path() can't get the correct path on Windows Anaconda
- Issues with pytest 8 HOT 1
- [Feature request] Support for syntax coloring (based on symbol type) HOT 1
- Script.infer() unexpectedly returns empty list HOT 10
- Jedi outputs: Syntax Error Invalid Syntax HOT 2
- [Feature Request]: infer the return type of functions HOT 1
- Any type inference error HOT 6
- `test_completion_param_annotations` fails in Python 3.13 HOT 1
- jedi automatic completion missing HOT 9
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 jedi.