Extension members, the field keyword and null-conditional assignment on .NET 10. Real VS Code footage with English narration and captions.

C# 14 in VS Code with SharpLsp

Read the guide: C# 14 in VS Code

Transcript

C# 14 shipped with .NET 10, the long-term support release.

Here are its best features, in VS Code with SharpLsp: free C# and F# tooling.

Install SharpLsp from the VS Code Marketplace.

Subscribe for .NET, C# and F# content.

Feature one: extension members. Open an extension block for any type...

...and put properties in it, not just methods. Hover it, and SharpLsp shows exactly what you declared.

Now every string has an IsBlank property.

Completion offers it right beside the built-in members, and it reads like it was always there.

And hover tells you exactly where it lives: the extension block on string.

Hit F12, and you land straight on the extension block.

Feature two: the field keyword. Give a setter a body, with no backing field to declare.

The word field means the one the compiler makes for you. Every name now gets trimmed.

Feature three: null-conditional assignment. Question-mark-dot works on the left of an equals sign, too.

If Address is null, the assignment just doesn't happen. No if statement needed.

Extension members, the field keyword, and null-conditional assignment. That's C# 14 on .NET 10.

Install SharpLsp, and subscribe for .NET, C# and F# content!