Skip to content

Install lsp plugin - #9782

Open
dibarbet wants to merge 7 commits into
mainfrom
dibarbet-copilot-lsp-setup
Open

dibarbet wants to merge 7 commits into
mainfrom
dibarbet-copilot-lsp-setup

Conversation

@dibarbet

Copy link
Copy Markdown
Member

No description provided.

@dibarbet
dibarbet force-pushed the dibarbet-copilot-lsp-setup branch from fa37bbb to df12ab7 Compare September 18, 2026 01:18
@dibarbet
dibarbet force-pushed the dibarbet-copilot-lsp-setup branch from df12ab7 to 06d21a6 Compare September 18, 2026 02:01
@dibarbet
dibarbet marked this pull request as ready for review September 21, 2026 23:03
@dibarbet
dibarbet requested a review from a team as a code owner September 21, 2026 23:03
Copilot AI lite review requested due to automatic review settings September 21, 2026 23:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

New user-facing strings/settings were added without propagating them to the checked-in locale bundles (package.nls.* and l10n/bundle.l10n.*), which will leave translations incomplete.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 3 Low severity

Open (3)
What changed in this PR

Adds an automatic installer for the GitHub Copilot “dotnet” plugin (from dotnet-agent-skills) to the C# extension, including Copilot CLI discovery/execution support, telemetry, user messaging, tests, and documentation so the feature is observable and user-controllable.

Changes:

  • Introduces Copilot CLI discovery + execution helpers and a .NET plugin auto-install flow with caching/telemetry.
  • Wires the installer into extension activation and adds unit tests covering install, caching, failure, timeout, and cancellation paths.
  • Documents the feature and adds a user setting to disable auto-install.
File Description
test/​lsptoolshost/​unitTests/​dotnetPlugin.test.ts Unit tests for plugin auto-install behavior, caching, and failure/timeout/cancel flows.
test/​lsptoolshost/​unitTests/​copilotCli.test.ts Unit tests for Copilot CLI discovery, execution, and plugin list parsing.
src/​shared/​telemetryEventNames.ts Adds telemetry event names for plugin install success/failure reporting.
src/​shared/​copilot/​dotnetPlugin.ts Implements the auto-install + caching + telemetry + user notification logic.
src/​shared/​copilot/​copilotCli.ts Implements CLI discovery (standalone/app) + execFile wrapper + inventory parsing.
src/​main.ts Starts plugin registration/installation during activation (non-test extension mode).
README.md Adds a link to the new Copilot .NET plugin documentation.
package.nls.json Adds localized string key for the new auto-install setting description.
package.json Adds the dotnet.copilotDotnetPlugin.enableAutoInstall setting contribution.
l10n/​bundle.l10n.json Adds localized UI strings used by the install notification.
docs/​readme.md Adds doc index entry for Copilot .NET plugin install/removal.
docs/​Copilot-Dotnet-Plugin.md Adds end-user documentation for install rationale, disabling, uninstall, and troubleshooting.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +15 to +17
To uninstall make sure all Copilot / VSCode instances are closed, then:
1. For the Copilot CLI, run `copilot plugin uninstall dotnet@dotnet-agent-skills`
2. For the GitHub Copilot App, go to `Customize`, select the `Plugins` tab and right click to uninstall the `dotnet` plugin from `dotnet-agent-skills`
Comment thread l10n/bundle.l10n.json
Comment thread package.nls.json
channel: DotnetPluginHost['channel']
): void {
const host: DotnetPluginHost = { context, reporter, channel };
const controller = new AbortController();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like AbortController is used instead of CancellationTokenSource so that we can return a cancellation reason.

}
}

function blockedReason(): Outcome | undefined {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe determineIfBlocked

finishInstallation(host, result);
}

function finishInstallation(host: DotnetPluginHost, result: InstallResult): void {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inline?

return undefined;
}

function readCache(context: DotnetPluginHost['context']): Cache | undefined {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inline?

return cache?.extensionVersion === context.extension.packageJSON.version ? cache : undefined;
}

function deadline(signal: AbortSignal): { signal: AbortSignal; done: () => void } {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel like this would be cleaner if it were done where we create the controller. We already add hook extension disabled from there.

}
}

function enabledOutcome(plugins: CopilotPlugin[]): CachedOutcome {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inline?

return { signal: AbortSignal.any([signal, timer.signal]), done: () => clearTimeout(handle) };
}

async function listPlugins(cli: CopilotCli, signal: AbortSignal): Promise<CopilotPlugin[]> {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inline?

* Installs only when automatic installation and AI are enabled, the workspace is trusted, Copilot is available,
* and no existing or conflicting .NET plugin is found. Stable results are cached per extension version.
*/
export async function installDotnetPlugin(host: DotnetPluginHost, signal: AbortSignal): Promise<void> {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel like this should be merged with registerDotnetPlugin. The separation seems to exist only for testing purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants