You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Change how to fetch pythonPath as we're deprecating python.pythonPath setting soon聽#604
We're moving it out of settings to a VSCode storage. So you'll have to change the code to fetch interpreter path from a API we provide instead of fetching using settings.json, in a way that it's backwards compatible. The initial design of the API is listed here microsoft/vscode-python#11294
Check if we are using the old version of Code runner or the new one. If using the old one, show a prompt asking user to upgrade Code runner to new version to keep using it.
How to check from extension A if user is using the old version of extension B or the new one
Introduce a flag in package.json of both the extensions. Within extension A, check if package.json of extension B has flag set. If it is set, it's the newer version of the extension.
Python extension
Introduce a feature flag in package.json of the extension, which states if the extension is using the new interpreter storage or not. We're adding the following to our package.json ,
Please add a similar flag in package.json and let us know. You can use the following to call our API, which makes sure the extension is activated before calling the API:
Thanks @karrtikr for your proposed changes. It looks great!
It seems the API is still in PR review.
Please let me know once it is ready, so that I could start to integrate the API in Code Runner.
It would also be helpful if you could kindly provide a simple code sample/snippet of calling the new API. 馃槃
Here's a sample code using debug portion of our API. We also need to make sure the extension is activated first before calling the API. So you can use the code below:
I've updated the Proposed changes comment to reflect these details as well. We're having a discussion on the design of the API, I'll let you know when we finalize it, cheers!
Check if we are using the old version of Code runner or the new one. If using the old one, show a prompt asking user to upgrade Code runner to new version to keep using it.
For case 4, to reduce the number of users that get this prompt. Can we only show the prompt to those who have the setting in code runner to use python.pythonPath?
It would be helpful if you could please provide a code snippet of how to accomplish that, which setting to check etc.
I see the PR is merged.
I remember the Python extension has Insider version. Pleased kindly let me know when it is available in Insider, then I could start working on the new API.
Activity
karrtikr commentedon Apr 21, 2020
We've to make sure all these 4 cases work,
Proposed changes
Code runner
In the new version of code runner,
We would check if user is using the old or the new python extension using the new setting.
Python extension
How to check from extension A if user is using the old version of extension B or the new one
Introduce a flag in
package.jsonof both the extensions. Within extension A, check ifpackage.jsonof extension B has flag set. If it is set, it's the newer version of the extension.Python extension
package.jsonof the extension, which states if the extension is using the new interpreter storage or not. We're adding the following to ourpackage.json,So you can access the flag using,
Code runner
Please add a similar flag in
package.jsonand let us know. You can use the following to call our API, which makes sure the extension is activated before calling the API:Note we will have to release Code runnner extension first, followed by the extension release. (which is targeted before May 12)
formulahendry commentedon Apr 22, 2020
Thanks @karrtikr for your proposed changes. It looks great!
It seems the API is still in PR review.
Please let me know once it is ready, so that I could start to integrate the API in Code Runner.
It would also be helpful if you could kindly provide a simple code sample/snippet of calling the new API. 馃槃
formulahendry commentedon Apr 22, 2020
For the flag, I plan to use below name in Code Runner:
karrtikr commentedon Apr 22, 2020
Hey @formulahendry 馃憢
Here's a sample code using
debugportion of our API. We also need to make sure the extension is activated first before calling the API. So you can use the code below:Also I realized that we should not put quotes around boolean
truein feature flags, so you can use this insteadI've updated the Proposed changes comment to reflect these details as well. We're having a discussion on the design of the API, I'll let you know when we finalize it, cheers!
karrtikr commentedon Apr 22, 2020
For case 4, to reduce the number of users that get this prompt. Can we only show the prompt to those who have the setting in code runner to use
python.pythonPath?It would be helpful if you could please provide a code snippet of how to accomplish that, which setting to check etc.
karrtikr commentedon Apr 22, 2020
We finalized the API, it's detailed in the issue description microsoft/vscode-python#11294. Please let me know if you've any questions.
formulahendry commentedon Apr 23, 2020
Hi @karrtikr
Here is the code snippet:
formulahendry commentedon Apr 23, 2020
I see the PR is merged.
I remember the Python extension has Insider version. Pleased kindly let me know when it is available in Insider, then I could start working on the new API.
karrtikr commentedon Apr 23, 2020
Thanks for the snippet, will let you know.
karrtikr commentedon Apr 27, 2020
It's available in the Insiders now.
karrtikr commentedon Apr 28, 2020
@formulahendry Please let me know after you're able to make the release with the changes, after which I can merge microsoft/vscode-python#11395.
formulahendry commentedon Apr 29, 2020
Sure! I will work on this and let you know!
formulahendry commentedon May 1, 2020
Hi @karrtikr , I have just committed the changes.
Would you please have a try on the attached vsix file and see whether everything is expected from your side?
code-runner-0.9.18-py.zip
If the changes are OK for you, I will publish a new release.
karrtikr commentedon May 1, 2020
Yep, all good from my side. I have a comment regarding your change 437456d#r38877025
Thanks again & let me know when it's available in the marketplace after which I'll merge my PR.
formulahendry commentedon May 2, 2020
Hi @karrtikr , I have just published a new release. You could continue your work now. 馃槃
Closing this issue.