New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow user customization of type stubs (for example to help with completions when using IronPython). #5027
Comments
Some standard library modules have completions (json) but others don't (sys). |
It works on modules implemented in Python (e.g. json, os), but fails with anything that's built-in/.NET (e.g. sys, nt). |
any news on this? |
any news? |
As an interim solution, it sure would be nice to have the ability to supplement with auto-complete stubs like Visual Studio Code can do. Can we just get a folder where we can put stubs? |
@AtomicZ you could try placing them under the typeshed that we install in the Python extension folder (searching for typeshed under the VS install folder should find it). They probably need to go under typeshed/third_party/2 The location of the typeshed folder is supposed to be customizable, but this is an option that is not regularly tested anymore, and I am not sure of its current status. It can be set in tools/options/python/language server. You could take the typeshed in the install dir, copy it somewhere else and then add whatever you need to it, and put the location in tools/options. That way, you don't mess with the contents of the install dir, but again, not sure how well that works. |
We are not going to do any additional work specifically for IronPython; usage is too low and there are alternatives that work with Python 3. We are planning on having much better support for type stubs in the future (sometime in first half of 2020). So I am going to rename this issue and change it to be about that. |
Can you confirm that this is the same issue reported at IronLanguages/ironpython2#615? There are pointers from that one to this one, but I cannot decipher this issue to figure out what the heck it is about. I thought IronLanguages/ironpython2#615 was pretty clear; this one not so much. |
@dbmercer yes that is the same issue as the one you linked. |
Hey there @dbmercer, @zhouwangyang and @AtomicZ. I would love to learn more about your use-cases with IronPython in Visual Studio. Do you mind emailing ptvshelp @ microsoft.com so we can continue a more detailed conversation there? Thank you! |
@Anapo14 I'd like to do that. What detailed information do you need to send by email? |
Has someone solved it??? |
@mmfontana Not as far as I know. |
Is fixing the "unresolved import" issues with IronPython still being worked on? And any guess what release to target? I would like to use VS 2019 but have to stay on 2017 till this gets resolved. |
The "much better support for type stub" is being actively worked on, and will go in as part of the new language server & integration work. That is still many months away. |
@GLantaff does it perfectly work in VS 2017? |
No not perfect but mostly OK. In 2019 every line that has an import statement is flagged as an error. In 2019 you end up with so many warnings it's hard to find the real issues. |
That does help. Thanks. Still miss the color highlighting to show it found the class but this is a good work around for now. |
Is there any updates? Will visual studio still support python or ironpython any longer ? |
Would you explain what alternative that currently work with python 3? In version 2015 everything looks fine, even the intellisens we just need to add the interop library on reference browse tab. |
You can import clr like this :
Change name clr for other library |
Dilip: This above solution worked for me. The import clr in Visual Studio using Iron Python now works. Many Thanks |
?still no solution,,, |
@greazer What is the resolution? Won't fix? Use VS 2022? Use VS Code? IronPython support dropped? |
To be precise - you can still use IronPython as a Python interpreter, but its gone from the installer, there is no special support in the language server, and YMMV as Pylance is based on Python 3. Usage of IronPython is very low and it is very behind in modern Python features (stable release is still Python 2.7, which will not be supported in the next release of Visual Studio), so we don't plan on any special support and recommend it not be used. There are other ways of doing interop with .Net assemblies, if that is what you want to do (e.g. https://github.com/pythonnet/pythonnet). |
VS Version: 28526.9.d16.0stg
Python Tool Version: 16.0.19026.2
Repro step:
1.Create an IronPython WPF Application
2.Drag & drop a button to the Design view
3.Check the IntelliSense in the .py file
a. From System.Windows import MessageBox
b. In the Button_Click handler, add a call to MessageBox.Show()
c. Signature info tooltip shows all overloads
expect result:
a. code coloring with Messagebox
b. when type MessageBox. , Show() should appear automatically
c. signature info tooltip shows with MessageBox
actual result:
a. no code coloring with Messagebox
b. no completions when type MessageBox.
c. no signature info tooltip shows with MessageBox
The text was updated successfully, but these errors were encountered: