Skip to content
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

Enable Proposed API codeActionAI #24068

Closed
StellaHuang95 opened this issue Sep 6, 2024 · 8 comments
Closed

Enable Proposed API codeActionAI #24068

StellaHuang95 opened this issue Sep 6, 2024 · 8 comments
Assignees
Labels
author-verification-requested Issues potentially verifiable by issue author feature-request Request for new features or functionality needs PR Ready to be worked on verification-needed Verification of issue is requested verified Verification succeeded

Comments

@StellaHuang95
Copy link

The Typescript team has added Copilot suggestions to various refactors. To bring similar functionality to python code, Pylance has enabled the implement inherited abstract classes with Copilot code action through the Github Copilot extension for Python files.

To display the sparkle icon for the code action instead of the regular light bulb icon, the isAI property needs to be set to true on the codeAction.

Image

Vscode-python and LSP doesn't support this API yet. Would it be possible for vscode-python to enable the codeActionAI proposed API?

Is it as simple as adding "codeActionAI" to the "enabledApiProposals" in package.json? I'd be happy to send a PR if that's all it takes. Thanks!

@StellaHuang95 StellaHuang95 added the feature-request Request for new features or functionality label Sep 6, 2024
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Sep 6, 2024
@karthiknadig karthiknadig self-assigned this Sep 9, 2024
@karthiknadig karthiknadig added this to the September 2024 milestone Sep 9, 2024
@karthiknadig karthiknadig added needs PR Ready to be worked on and removed triage-needed Needs assignment to the proper sub-team labels Sep 9, 2024
@karthiknadig
Copy link
Member

This is not so straight forward. We will need to pin engine version, after it is enabled.

@StellaHuang95
Copy link
Author

I’ve sent PRs to add it to LSP. By pin engine version, do you mean updating the Python extension to use the new LSP client after the changes are shipped?

PRs sent in vscode-languageserver-node and language-server-protocol:

@karthiknadig
Copy link
Member

Since this is proposed API, stable can't use it directly. I have enabled it for python extension:
image

You will need to pin the engine to latest VS Code. engine format: 1.94.0-20240913 (assuming you want to pin to todays build of VS Code).

@karthiknadig
Copy link
Member

What I mean by my above comment is you can now submit PRs to enable proposed APIs for codeActionAI and it should work on stable.

@StellaHuang95
Copy link
Author

Thanks Karthik! When you say "enabled for the Python extension", you mean that the proposed API has been enabled for use by the Python extension in the STABLE version of VSCode right? Luciana mentioned a vscode-distro repo to me, but I don't have access to it, so I'm unclear if that’s where the change was made and what its purpose is.

A follow-up question: If my interpretation above is correct, would the isAI change in LSP potentially cause issues or crashes for other vscode-languageserver-node consumers that do not support this proposed API in stable?

Last question:) We usually update the engine when the LSP requirements change. What’s the worst-case scenario if we don’t update the engine? Would it be that users with older versions of VSCode see the regular light bulb icon, while those with the latest version see the sparkle icon?

@karthiknadig
Copy link
Member

Thanks Karthik! When you say "enabled for the Python extension", you mean that the proposed API has been enabled for use by the Python extension in the STABLE version of VSCode right? Luciana mentioned a vscode-distro repo to me, but I don't have access to it, so I'm unclear if that’s where the change was made and what its purpose is.

That is correct. I updated the distro.

A follow-up question: If my interpretation above is correct, would the isAI change in LSP potentially cause issues or crashes for other vscode-languageserver-node consumers that do not support this proposed API in stable?

This only affects at the extension level, not at the package level. So, it should be fine as long as the extension where the client or the server is created is opted in.

We usually update the engine when the LSP requirements change. What’s the worst-case scenario if we don’t update the engine? Would it be that users with older versions of VSCode see the regular light bulb icon, while those with the latest version see the sparkle icon?

Worst-case scenario (other than crash) is what you mentioned. They won't get the new behavior.

StellaHuang95 added a commit that referenced this issue Sep 13, 2024
Addresses #24068

- Enable proposed APIs for `codeActionAI`
- Pin the engine to `1.94.0-20240913`
anthonykim1 pushed a commit to anthonykim1/vscode-python that referenced this issue Sep 13, 2024
Addresses microsoft#24068

- Enable proposed APIs for `codeActionAI`
- Pin the engine to `1.94.0-20240913`
anthonykim1 pushed a commit to anthonykim1/vscode-python that referenced this issue Sep 15, 2024
Addresses microsoft#24068

- Enable proposed APIs for `codeActionAI`
- Pin the engine to `1.94.0-20240913`
@karthiknadig karthiknadig added the author-verification-requested Issues potentially verifiable by issue author label Sep 23, 2024
@karthiknadig
Copy link
Member

@StellaHuang95 Can you verify that this is now working as expected for you?

@karthiknadig karthiknadig added the verification-needed Verification of issue is requested label Sep 23, 2024
@StellaHuang95
Copy link
Author

I am waiting for the change in LSP to go through, I can verify and let you know if it doesn't work once LSP supports it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author-verification-requested Issues potentially verifiable by issue author feature-request Request for new features or functionality needs PR Ready to be worked on verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

2 participants