Skip to content

Tags: dotnet/roslyn

Tags

VSCode-CSharp-2.113.22-prerelease

Toggle VSCode-CSharp-2.113.22-prerelease's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Add a notification handler for project context changed. (#81942)

This handler will then trigger a refresh for all providers using
AsyncRefreshQueue. This is needed because semantic highlighting,
diagnostics, inlay hints could all be different based on the selected
project context.

VSCode-CSharp-2.112.45-prerelease

Toggle VSCode-CSharp-2.112.45-prerelease's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Add a notification handler for project context changed. (#81942)

This handler will then trigger a refresh for all providers using
AsyncRefreshQueue. This is needed because semantic highlighting,
diagnostics, inlay hints could all be different based on the selected
project context.

Visual-Studio-2022-Version-17.12.15

Toggle Visual-Studio-2022-Version-17.12.15's commit message
Build Branch: refs/heads/release/dev17.12

Internal ID: 20250126.6
Internal VS ID: rel.d17.12-36806.00

Visual-Studio-2026-Version-18.3-Preview-2

Toggle Visual-Studio-2026-Version-18.3-Preview-2's commit message
Build Branch: refs/heads/main

Internal ID: 20251124.9
Internal VS ID: rel.d18.3-11304.161

Visual-Studio-2026-Version-18.1

Toggle Visual-Studio-2026-Version-18.1's commit message
Build Branch: refs/heads/release/dev18.0

Internal ID: 20251124.6
Internal VS ID: rel.d18.0-11304.174

VSCode-CSharp-2.111.2-prerelease

Toggle VSCode-CSharp-2.111.2-prerelease's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Build our libraries against net10.0 (#81545)

Missed as part of building the Roslyn LSP against net10.0. We should also
build our libraries against net10.0.

VSCode-CSharp-2.110.4

Toggle VSCode-CSharp-2.110.4's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Improve error message for misplaced variable designator in property p…

…atterns (#81287)

## Summary: Improve error messages when variable designation is in
incorrect order with property pattern

### Problem Statement
When users write `o is string s { Length: 5 }` (with designation before
property pattern), the compiler produced confusing error messages:
- `error CS1026: ) expected`
- `error CS1002: ; expected`
- `error CS1513: } expected`

The correct syntax should be `o is string { Length: 5 } s` (designation
after property pattern).

### Solution
This PR adds a new error code `ERR_DesignatorBeneathPattern` (CS8525)
that provides a clear error message:
```
error CS8525: The variable designator 's' must come after any property pattern.
```

### Changes Made

✅ **Error Code & Resources:**
- Added `ERR_DesignatorBeneathPattern` error code (CS8525) to
`ErrorCode.cs`
- Added error message to `CSharpResources.resx`
- Updated all XLF localization files
- Added error code to `ErrorFacts.cs`

✅ **Parser Implementation:**
- Modified `parsePropertyPatternClause` local function in
`ParsePatternContinued` to detect identifier followed by `{`
- When detected, the parser now:
  - Consumes the misplaced identifier token
  - Parses the property pattern
  - Reports the new CS8525 error with the variable name
- Places the identifier token as skipped syntax on the property pattern
  - Continues parsing to provide better recovery

✅ **Testing:**
- Added 1 test in `PatternParsingTests.cs`:
  - `DesignatorBeforePropertyPattern` - tests `string s { Length: 5 }`
- All 301 existing pattern parsing tests still pass
- Verified the exact scenario from issue #50220

### Scope
This fix only handles the property pattern case (`x { ... }`).
Positional patterns (`x ( ... )`) are not covered by this change.

### Validation
- ✅ Builds successfully with no warnings
- ✅ All 302 pattern parsing tests pass (301 passed, 1 skipped)
- ✅ Correct syntax continues to work without the new error
- ✅ Error message is clear and concise
- ✅ Simplified implementation with direct token consumption
- ✅ No security vulnerabilities introduced

Fixes #50220

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute survey](https://gh.io/copilot-coding-agent-survey).

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: CyrusNajmabadi <[email protected]>
Co-authored-by: Cyrus Najmabadi <[email protected]>

VSCode-CSharp-2.103.33-prerelease

Toggle VSCode-CSharp-2.103.33-prerelease's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Improve error message for misplaced variable designator in property p…

…atterns (#81287)

## Summary: Improve error messages when variable designation is in
incorrect order with property pattern

### Problem Statement
When users write `o is string s { Length: 5 }` (with designation before
property pattern), the compiler produced confusing error messages:
- `error CS1026: ) expected`
- `error CS1002: ; expected`
- `error CS1513: } expected`

The correct syntax should be `o is string { Length: 5 } s` (designation
after property pattern).

### Solution
This PR adds a new error code `ERR_DesignatorBeneathPattern` (CS8525)
that provides a clear error message:
```
error CS8525: The variable designator 's' must come after any property pattern.
```

### Changes Made

✅ **Error Code & Resources:**
- Added `ERR_DesignatorBeneathPattern` error code (CS8525) to
`ErrorCode.cs`
- Added error message to `CSharpResources.resx`
- Updated all XLF localization files
- Added error code to `ErrorFacts.cs`

✅ **Parser Implementation:**
- Modified `parsePropertyPatternClause` local function in
`ParsePatternContinued` to detect identifier followed by `{`
- When detected, the parser now:
  - Consumes the misplaced identifier token
  - Parses the property pattern
  - Reports the new CS8525 error with the variable name
- Places the identifier token as skipped syntax on the property pattern
  - Continues parsing to provide better recovery

✅ **Testing:**
- Added 1 test in `PatternParsingTests.cs`:
  - `DesignatorBeforePropertyPattern` - tests `string s { Length: 5 }`
- All 301 existing pattern parsing tests still pass
- Verified the exact scenario from issue #50220

### Scope
This fix only handles the property pattern case (`x { ... }`).
Positional patterns (`x ( ... )`) are not covered by this change.

### Validation
- ✅ Builds successfully with no warnings
- ✅ All 302 pattern parsing tests pass (301 passed, 1 skipped)
- ✅ Correct syntax continues to work without the new error
- ✅ Error message is clear and concise
- ✅ Simplified implementation with direct token consumption
- ✅ No security vulnerabilities introduced

Fixes #50220

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute survey](https://gh.io/copilot-coding-agent-survey).

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: CyrusNajmabadi <[email protected]>
Co-authored-by: Cyrus Najmabadi <[email protected]>

Visual-Studio-2026-Version-18.3-Preview-1.2

Toggle Visual-Studio-2026-Version-18.3-Preview-1.2's commit message
Build Branch: refs/heads/release/dev18.3

Internal ID: 20251105.5
Internal VS ID: rel.d18.3-11222.16

Visual-Studio-2026-Version-18.0.2

Toggle Visual-Studio-2026-Version-18.0.2's commit message
Build Branch: refs/heads/release/dev18.0

Internal ID: 20251029.7
Internal VS ID: rel.d18.0-11222.15