Comments (8)
Yes, I understand that very much. I unfortunately don't think there's a solution here for now. If correctly done the performance tradeoffs might not even be that bad, but it's just too much work for me now. So if you want to you try and play with the import system and if it doesn't make tests slower by a lot, I might merge a pull request. But I just don't have the time for that now (nor is it very important).
from jedi.
In the venv is the gc.py
file next to the gc.pyi
file? If that' the case, Jedi probably should load that file first. Otherwise it prefers the typeshed file. This is wrong according to some PEP, typeshed should be a fallback. But for performance reasons this is probably going to stay like that. I'm sorry.
But I'm currently working on a Rust version of Jedi/Mypy that should improve this.
from jedi.
There is no gc.py
next to the gc.pyi
file, but that is the same for the machine.pyi
also. There only seems to be .pyi
files in the ~/.venv/lib/python3.11/site-packages/
directory. Which is what gets opened by vscodium when I "Go to definition".
Does this point to a different issue if I am missing the .py
files?
from jedi.
I'm unsure if this is an issue. Can you give me a small reproduction zip that I could try?
On the other hand I'm also personally interested to know why you prefer Jedi to Pyright/Pylance in VSCode.
from jedi.
If you just pip install micropython-esp8266-stubs
into a fresh venv this is the exact setup I have, and then make sure to use that venv interpreter.
Also I am on linux using vscodium. I actually thought i was using pylance and reported this issue over there first: microsoft/pylance-release#5444
and sure enough after that post, i looked in the output tab and can see :
Language server is set to "Default". Jedi is used as current language server.
IntelliCode Python suggests to use Pylance as language server. Details about Pylance: 'https://aka.ms/vscode-pylance'.
and trying to then change the settings.json
to use pylance doesn't work, it wont start up for some reason. I have not gone any deeper than this sorry, As when i couldn't get the correct auto complete to work for micropython i put the coding on pause.
from jedi.
Also a bit more context for this, i tried adding an empty gc.py
file next to the gc.pyi
file in my venv, but even after restarting vscodium it still doesn't load the correct stubs.
from jedi.
The problem is that with whatever sys.path you import gc
with, it will never overwrite the builtin module in normal Python. So this is actually strictly related to stub loading. Therefore a gc.py
module will never be loaded.
For now I do not think this is important enough and it will also worsen performance. I will keep it open though so if someone comes along and implements it, we can evaluate the impacts and maybe merge.
from jedi.
Is there a way to force jedi to use gc.pyi
in a typings folder in the cwd? Or is there simply no workaround possible with jedi for this problem?
Also to be clear, i appreciate you explaining the rationale for the way this works, and as the creator of this project i can respect your opinion on saying this isn't important enough to degrade performance trade offs made in this project just to fix the problem. But I am keen to try and find a workaround IF one exists. If there isn't, I guess i will have to live with it, or give up on using vscodium and accept that i need to use vscode + pylance. But would very very very much like to avoid that :D
from jedi.
Related Issues (20)
- Test failures with Python 3.12 HOT 4
- Drop support for running on legacy Python? HOT 1
- Tab complete for class __call__ not working HOT 1
- I would like to contribute as translator HOT 2
- allow users to set cache_directory via env-var HOT 9
- Jedi.names is not working HOT 3
- Missing docstring for pandas functions HOT 1
- Add support for `TypeAlias` HOT 4
- Addition of type annotation breaks tab completion in jedi>=0.19.0
- kwargs forwarding? HOT 1
- `LazyKnownValues` has no attribute `string_name`? HOT 4
- Enum name auto-completion without parentheses HOT 1
- Jedi searches the python interpreter in the wrong path. HOT 8
- Unhandled Exception with Unnamed Lambdas When Analyzing References Using dynaconf
- Add support for async pytest fixtures
- Is it possible to generate completion for `argparse.Namespace`? HOT 5
- TypedDict : Suggestion issues HOT 2
- Error when trying to detect environment HOT 5
- `PathFinder` has no attribute `find_module` in `python 12.2` HOT 2
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.