Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
f28a6d2
VSIX packaging cleanup and semantic tokens removal
abonie Apr 22, 2026
1dbfff0
Diagnostics enhancements: severity, project info, settings toggle
abonie Apr 22, 2026
4368dcd
Add ProjectContexts endpoint (textDocument/_vs_getProjectContexts)
abonie Apr 22, 2026
ec71801
Add code actions handler for textDocument/codeAction
abonie Apr 22, 2026
9e424bf
Add telemetry instrumentation for LSP server
abonie Apr 22, 2026
fab999f
Add LSP integration tests (Apex test infrastructure)
abonie Apr 22, 2026
80fa009
Add VS local development and MCP testing skills
abonie Apr 22, 2026
242b7ac
Add copilot skills for VS integration
abonie Apr 30, 2026
bcf3fbd
Use project context when querying workspace
abonie Jun 11, 2026
cf995b2
Default diagnostics rollout to old extension
abonie Jun 11, 2026
0f889f6
Re-introduce semantic tokens endpoint and disable LSP diagnostics
abonie Jun 11, 2026
fad499f
Align rebased LSP projects with central package management
abonie Oct 8, 2026
5c25ade
Align LSP dependencies and serialization; fix CLI event highlighting
abonie Oct 12, 2026
9d0176c
Fix LSP highlighting after target framework switches
abonie Oct 13, 2026
0f64a67
Align FSharp.Editor LSP client dependencies with Roslyn
abonie Nov 4, 2026
636b4f2
Upgrade F# LSP extension to Extensibility 18.5 and .NET 10
abonie Nov 4, 2026
d5b6a4f
Bump VS Extensibility packages
abonie Nov 5, 2026
c236379
Bridge legacy and LSP highlighting telemetry
abonie Nov 10, 2026
810dc71
Rename vs-mcp-testing-tools dir
abonie Nov 11, 2026
ec21061
Run fantomas
abonie Nov 11, 2026
468b7f0
Gate VS LSP startup on provider selection and preserve unset settings
abonie Nov 11, 2026
63950d7
Bound semantic token processing by line and honor cancellation
abonie Nov 11, 2026
8e1c5bd
Merge semantic tokens perf and cancellation fixes
abonie Nov 11, 2026
2525ac1
Merge VS provider gating, settings and Apex test fixes
abonie Nov 11, 2026
f67793d
Correct experimental LSP code action edits
abonie Nov 11, 2026
a1e96f8
Clarify synchronous code-fix registration
abonie Nov 11, 2026
7a5c6ff
Merge LSP code action fixes
abonie Nov 11, 2026
f465972
Update workspace API baseline, run LSP tests in CI, and track STJ thr…
abonie Nov 11, 2026
d4416ba
Preserve legacy classification for closed and preview documents under…
abonie Nov 11, 2026
a95c6ac
Merge FCS surface area, LSP test CI and System.Text.Json tracking fixes
abonie Nov 11, 2026
db1383b
Avoid duplicate semantic classification in miscellaneous editor buffers
abonie Nov 11, 2026
a8e0199
Merge legacy classification fallback for documents LSP does not render
abonie Nov 11, 2026
ad7053d
Require net10.0 in vsixmanifest
abonie Nov 12, 2026
d29393e
Don't try to start the server when LSP is off
abonie Nov 12, 2026
a0f24cd
Remove unnecessary pragmas for now stable apis
abonie Nov 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 127 additions & 0 deletions .github/skills/vs-local-development/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
---
name: vs-local-development
description: Guide for local Visual Studio extension development, building, deploying, and testing the VS extension (VisualFSharp) in the experimental instance.
license: MIT
---

# Local Visual Studio Extension Development

This skill provides guidance on building, deploying, and iterating on the Visual Studio extension locally using the experimental instance of Visual Studio.

## Prerequisites

- Visual Studio 2026 installed with the **Visual Studio extension development** workload
- The `vs-mcp-testing-tools` skill must be loaded to understand how to use the MCP tools for testing after deployment

## Rebuild & Deploy Workflow

After making code changes to the VS extension, follow these steps **in order** to rebuild and deploy:

### 1. Close All Experimental VS Instances

Run the helper script to close any running experimental instances:

```powershell
.github/skills/vs-local-development/scripts/close-exp-instances.ps1
```

This kills all `devenv.exe` processes launched with `/rootsuffix`.

### 2. Rebuild the Solution

Run the build script:

```powershell
./Build.cmd -c Debug
```

### 3. Deploy the VSIX

Use the deploy script to install the VSIX, wait for the installer to finish, and clear caches in one step:

```powershell
.github/skills/vs-local-development/scripts/deploy-to-vs.ps1 "artifacts\VSSetup\Debug\VisualFSharpDebug.vsix"
```

This script:
- Installs the VSIX into the experimental hive (`/rootSuffix:exp`)

**Shell requirement:** `VSIXInstaller.exe` and `devenv.exe` must be on `PATH`. Run from a **Visual Studio Developer PowerShell** / **Developer Command Prompt**, or use the discovery snippet below.

### Finding devenv.exe

VS installation folders use **numeric version identifiers** (e.g., `18`), not marketing years (e.g., `2026`), and may be under `Program Files` or `Program Files (x86)`. Editions vary (`IntPreview`, `Enterprise`, `Preview`, `Community`, etc.).

Use this snippet to find `devenv.exe` dynamically:

```powershell
$devenv = Get-ChildItem "${env:ProgramFiles}\Microsoft Visual Studio","${env:ProgramFiles(x86)}\Microsoft Visual Studio" `
-Filter "devenv.exe" -Recurse -ErrorAction SilentlyContinue |
Where-Object { $_.FullName -match 'Common7\\IDE\\devenv\.exe$' } |
Select-Object -First 1 -ExpandProperty FullName

if (-not $devenv) { Write-Error "devenv.exe not found"; exit 1 }
Write-Host "Using: $devenv"
```

Then source the Developer environment and deploy:

```powershell
$vsDir = Split-Path (Split-Path (Split-Path $devenv)) # …\Common7\IDE → VS root
& "$vsDir\Common7\Tools\VsDevCmd.bat"
.github/skills/vs-local-development/scripts/deploy-to-vs.ps1 "artifacts\VSSetup\Debug\VisualFSharpDebug.vsix"
```

### 4. Reopen VS

The extension is now installed. Open the experimental instance normally:

```powershell
devenv /rootsuffix exp
```

## Quick Reference (Copy-Paste)

Full sequence for a rebuild cycle:

```powershell
# 1. Stop experimental instances
.github/skills/vs-local-development/scripts/close-exp-instances.ps1

# 2. Rebuild
./Build.cmd -c Debug

# 3. Deploy VSIX (install, wait, clear caches)
.github/skills/vs-local-development/scripts/deploy-to-vs.ps1 "artifacts\VSSetup\Debug\VisualFSharpDebug.vsix"

# 4. Reopen VS with the updated extension
devenv /rootsuffix exp
```

## Key Concepts

### Experimental Instance

Visual Studio supports **experimental instances** (`/rootsuffix exp`) — isolated environments with separate extension registrations and settings. This allows developing and testing extensions without affecting your main VS installation.

## Troubleshooting

| Problem | Solution |
|---|---|
| VSIX install fails | Ensure all experimental VS instances are closed (`.github/skills/vs-local-development/scripts/close-exp-instances.ps1`) |
| Extension not appearing in VS | Re-run `deploy-to-vs.ps1` or manually run `devenv /rootsuffix exp /clearcache` and `/updateconfiguration` |
| Old version still loaded | Delete `artifacts/` and rebuild |
| `devenv.exe` not found | VS folders use numeric versions (e.g., `18`), not years. Use the discovery snippet in the Deploy section above |

## When to Use This Skill

Use this skill when:

- Making changes to the VS extension (`VisualFSharpFull` or `VisualFSharpDebug`)
- Needing to test extension changes locally in Visual Studio
- Troubleshooting VSIX deployment to the experimental instance
- Setting up a local VS extension development loop

## Related

- [vs-mcp-testing-tools](../vs-mcp-testing-tools/SKILL.md) — for automating VS via MCP tools after the extension is deployed
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Closes all devenv.exe processes launched with /rootsuffix (experimental instances).
Get-CimInstance Win32_Process -Filter "Name = 'devenv.exe'" |
Where-Object { $_.CommandLine -match '/rootsuffix\s+\S+' } |
ForEach-Object {
Write-Host "Stopping devenv.exe (PID $($_.ProcessId)): $($_.CommandLine)"
Stop-Process -Id $_.ProcessId -Force
}
57 changes: 57 additions & 0 deletions .github/skills/vs-local-development/scripts/deploy-to-vs.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<#
.SYNOPSIS
Deploys a VSIX to the Visual Studio experimental instance.
.DESCRIPTION
Installs a VSIX into the experimental hive, waits for the installer to
finish, then clears caches and updates the configuration so VS picks up
the new extension on next launch.
.PARAMETER Path
Path to the .vsix file to install.
#>
[CmdletBinding()]
param(
[Parameter(Mandatory = $true, Position = 0)]
[string]$Path
)

Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'

if (-not (Test-Path $Path)) {
Write-Error "VSIX not found: $Path"
exit 1
}

# --- 1. Install the VSIX ---------------------------------------------------
Write-Host "Installing VSIX: $Path" -ForegroundColor Cyan
VSIXInstaller.exe /rootSuffix:exp $Path /q
Write-Host "VSIXInstaller.exe launched (exit code $LASTEXITCODE)."

# --- 2. Wait for the background installer to finish ------------------------
# VSIXInstaller.exe returns immediately while a background process
# completes the actual installation. Poll until it exits.
Write-Host "Waiting for VSIXInstaller.exe to finish..." -ForegroundColor Cyan
while (Get-Process -Name VSIXInstaller -ErrorAction SilentlyContinue) {
Start-Sleep -Seconds 5
}
Write-Host "VSIX installation complete."

# --- 3. Clear caches and update configuration ------------------------------
# Find devenv.exe dynamically — VS folders use numeric versions (e.g. 18),
# not marketing years, and editions vary (IntPreview, Enterprise, etc.).
$devenv = Get-Command devenv.exe -ErrorAction SilentlyContinue |
Select-Object -ExpandProperty Source
if (-not $devenv) {
$devenv = Get-ChildItem "$env:ProgramFiles\Microsoft Visual Studio","${env:ProgramFiles(x86)}\Microsoft Visual Studio" `
-Filter "devenv.exe" -Recurse -ErrorAction SilentlyContinue |
Where-Object { $_.FullName -match 'Common7\\IDE\\devenv\.exe$' } |
Select-Object -First 1 -ExpandProperty FullName
}
if (-not $devenv) {
Write-Error "devenv.exe not found. Run from a Developer PowerShell or install Visual Studio."
exit 1
}
Write-Host "Clearing VS experimental instance caches..." -ForegroundColor Cyan
& $devenv /rootsuffix exp /clearcache
& $devenv /rootsuffix exp /updateconfiguration
Write-Host "Caches cleared and configuration updated." -ForegroundColor Green
176 changes: 176 additions & 0 deletions .github/skills/vs-mcp-testing-tools/REFERENCE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
# MCP Tools Reference

Complete reference for all Visual Studio MCP server tools provided by `Microsoft.Copilot.Testing.MCP.VisualStudio`.

## Solution Management

### `vs-open-solution`

Opens a solution file and waits for full loading.

```
vs-open-solution path="C:\path\to\MySolution.sln"
```

- Accepts `.sln` and `.slnx` files.
- Blocks until the solution is fully loaded in Visual Studio.

### `vs-open-file`

Opens a file in the Visual Studio editor.

```
vs-open-file filePath="C:\path\to\MyFile.cs"
```

### `vs-close`

Closes Visual Studio.

```
vs-close
```

## Chat Window

### `chat-submit-prompt`

Submits a prompt to the VS Copilot Chat window.

```
chat-submit-prompt "@test #file:'C:\path\to\Calculator.cs'"
```

- Annotations require **full absolute paths** enclosed in single quotes for file-based references.
- This call is asynchronous — always follow with `chat-wait-complete`.

### `chat-wait-complete`

Waits for the chat response to complete.

```
chat-wait-complete
chat-wait-complete timeoutSeconds=600
```

- Default timeout: 60 seconds.
- Increase `timeoutSeconds` for large projects or solution-scoped generation (10+ minutes).

### `get-last-message`

Retrieves the last response from the chat session.

```
get-last-message
```

- Look for the `**Pass/Fail Summary**` line (`✅` or `❌`) in the response.

## Output Window

### `output-window-get-content`

Gets content from a specific output pane by name.

```
output-window-get-content paneName="GitHub Copilot Testing"
output-window-get-content paneName="Build"
```

Key panes:

| Pane | Content |
|---|---|
| `GitHub Copilot Testing` | Agent execution logs, LLM traces, errors |
| `Build` | MSBuild compilation output |
| `Package Manager` | NuGet restore and package issues |

### `output-window-get-test-content`

Gets content from the Test output pane for detailed test results.

```
output-window-get-test-content
```

## Test Explorer

### `test-explorer-run-all-tests`

Executes all tests in the solution. This call is asynchronous — always follow with `test-explorer-wait-complete`.

```
test-explorer-run-all-tests
```

### `test-explorer-wait-complete`

Waits for the test run to finish.

```
test-explorer-wait-complete
```

### `test-explorer-verify-all-tests-passed`

Checks if all tests in the solution passed. Returns a quick pass/fail status.

```
test-explorer-verify-all-tests-passed
```

## Error List

### `vs-get-error-list`

Gets diagnostics from the Visual Studio Error List window.

```
vs-get-error-list
vs-get-error-list severity=error
```

- **`severity`** (optional): Filter results by severity. Accepted values: `error`, `warning`, `message`, `all` (default).
- Returns each diagnostic in the format `[severity] file(line,column): description`.
- Returns a summary header with match count and active filter.

## VS Editor

### `vs-inspect-lightbulb`

Inspects whether a light bulb is present at a file/line and returns available code action titles.

```
vs-inspect-lightbulb filePath="C:\path\to\File.cs" lineNumber=42
```

- Uses 1-based line numbers.
- Returns whether the light bulb is present and the list of offered actions.

## MCP Server Setup

### Prerequisites

1. Check if `vs-open-solution` tool is available. If it is, the server is already set up.
2. Run `./cibuild.cmd` to build the solution.
3. Set up the VS MCP server following `src/Microsoft.Copilot.Testing.MCP.VisualStudio/README.md`.
4. Configure your MCP client (e.g., `mcp.json`) to point to `bin\Microsoft.Copilot.Testing.MCP.VisualStudio\Release\net472\dotnet-codetesting-mcp-vs.exe`.
5. If testing against an experimental VS hive, pass `--hive Exp` in the MCP server args.

### Configuration Options

- **Hive Selection:** Use `--hive` parameter for experimental or specific VS installations.
- **Debugging:** Set `ATTACH_DEBUGGER=1` environment variable to debug the MCP server. Diagnostic output is written to stderr.

### System Requirements

- Visual Studio 2022 with GitHub Copilot extension
- .NET 8 SDK or later
- GitHub Copilot Testing extension enabled
- Valid GitHub Copilot subscription

### VS Settings

- **Enable the agent:** Tools → Options → GitHub → Copilot → Testing → "Enable GitHub Copilot testing"
- **Enable logging:** Tools → Options → GitHub → Copilot → Testing → "Enable detailed logging"
- **Check authentication:** Ensure GitHub account is properly connected
Loading
Loading