Skip to content

Enable Proposed API codeActionAI #24068

Closed

Description

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!

Activity

  1. karthiknadig commented on Sep 9, 2024

    @karthiknadig
    Member

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

  2. StellaHuang95 commented on Sep 13, 2024

    @StellaHuang95
    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:

  3. karthiknadig commented on Sep 13, 2024

    @karthiknadig
    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).

  4. karthiknadig commented on Sep 13, 2024

    @karthiknadig
    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.

  5. StellaHuang95 commented on Sep 13, 2024

    @StellaHuang95
    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?

  6. karthiknadig commented on Sep 13, 2024

    @karthiknadig
    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.

  7. karthiknadig commented on Sep 23, 2024

    @karthiknadig
    Member

    Stella Huang (@StellaHuang95) Can you verify that this is now working as expected for you?

  8. StellaHuang95 commented on Sep 23, 2024

    @StellaHuang95
    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

Metadata

Metadata

Labels

author-verification-requestedIssues potentially verifiable by issue authorfeature-requestRequest for new features or functionalityneeds PRReady to be worked onverification-neededVerification of issue is requestedverifiedVerification succeeded

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions