Code Monkey home page Code Monkey logo

Comments (8)

davidhalter avatar davidhalter commented on July 3, 2024 1

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.

davidhalter avatar davidhalter commented on July 3, 2024

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.

Always-Self-Hosted avatar Always-Self-Hosted commented on July 3, 2024

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.

davidhalter avatar davidhalter commented on July 3, 2024

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.

Always-Self-Hosted avatar Always-Self-Hosted commented on July 3, 2024

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.

Always-Self-Hosted avatar Always-Self-Hosted commented on July 3, 2024

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.

davidhalter avatar davidhalter commented on July 3, 2024

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.

Always-Self-Hosted avatar Always-Self-Hosted commented on July 3, 2024

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)

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.