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

Test support for Powershell intellisense in Codepilot chat code blocks #5025

Open
2 tasks done
mjbvz opened this issue Aug 13, 2024 · 2 comments
Open
2 tasks done

Test support for Powershell intellisense in Codepilot chat code blocks #5025

mjbvz opened this issue Aug 13, 2024 · 2 comments
Labels
Area-IntelliSense Feature: VS Code Request to use or implement a VS Code feature. Issue-Enhancement A feature request (enhancement).

Comments

@mjbvz
Copy link

mjbvz commented Aug 13, 2024

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues to ensure it has not already been reported.

Summary

VS Code recently enabled intellisense in copilot chat code blocks. Although this is mostly implemented in a language agnostic way, language extensions may need to make some changes to get the best support

For this exploration, I'd like your team's help testing out Powershell IntelliSense in copilot chat code blocks. I've provided a list of ideas on what to test below, however feel free to build on it. I've gone through them for JS/TS and found them to be a good starting point. You can also file feature request against VS Code for new feature ideas

Areas to test

  • Your extension should see TextDocuments for each code block present in a copilot chat

    These documents have the scheme: vscode-chat-code-block.

  • Basic syntax language features — such bracket matching and Smart Selection — should always work

  • You should never see errors reported for code in chat code blocks

    Try asking copilot to generate invalid code to confirm this

  • Test hovers and go to definition within a single code block

    For example if you ask for looping over array in powershell, there should be a single code block that has these IntelliSense features

    • Make sure these features work for global symbols
    • Also test IntelliSense for symbols defined within the block
    • Check that any special Powershell features in hovers (such as links) work as expected
    • Make sure the code block IntelliSense observes any relevant workspace/project settings
  • Test cross-code block IntelliSense

    Subsequent code blocks should be able to use variables and functions defined in earlier blocks first

  • Test IntelliSense for workspace symbols

    This feature is mostly handled by copilot but still worth testing. For it, as a @workspace question to find code in the workspace. For example, @workspace where's the code for parsing arguments

    • Make sure can use hover, go to definition for symbols that come from the workspace
    • Make sure you can still use these features for globals and locals too
  • Make sure that code in code blocks is never picked up as a reference

    If a code block uses a global symbol for example, when you run find all references on that symbol in a normal workspace file, you should not see the use in the code block listed

  • Make sure symbols code blocks never shows up in workspace symbol search

  • Explore any Powershell specific features/behavior of these IntelliSense features inside these chat code blocks

  • Think about if there's any additional IntelliSense features that would help users understand code inside of chat code blocks

Proposed Design

No response

@mjbvz mjbvz added Issue-Enhancement A feature request (enhancement). Needs: Triage Maintainer attention needed! labels Aug 13, 2024
@JustinGrote JustinGrote added Feature: VS Code Request to use or implement a VS Code feature. Area-IntelliSense and removed Needs: Triage Maintainer attention needed! labels Aug 14, 2024
@JustinGrote
Copy link
Collaborator

JustinGrote commented Aug 14, 2024

@mjbvz thanks! To be clear, the TextDocuments are submitted to the extension via the LSP correct? Does this require both vscode insiders and copilot preview to enable? Is there release notes or a related PR on this feature yet?

@mjbvz
Copy link
Author

mjbvz commented Aug 14, 2024

To be clear, the TextDocuments are submitted to the extension via the LSP correct?

Yes

The user facing feature was first documented here: https://code.visualstudio.com/updates/v1_90#_intellisense-in-chat-code-blocks. We're currently reaching out to individual languages to get them onboarded

Let me know if you run into any issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IntelliSense Feature: VS Code Request to use or implement a VS Code feature. Issue-Enhancement A feature request (enhancement).
Projects
None yet
Development

No branches or pull requests

2 participants