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

enh(csharp) Added support for the new scoped keyword in C# #3571

Merged
merged 2 commits into from
Jul 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Grammars:

- enh(csharp) Added support for the new `scoped` keyword in C# (#3571) [David Pine][]
- enh(scala) add `transparent` keyword [Matt Bovel][]
- fix(rust) highlight types immediately preceeding `::` (#3540) [Josh Goebel][]
- Added 3rd party Apex grammar to SUPPORTED_LANGUAGES (#3546) [David Schach][]
Expand Down
3 changes: 2 additions & 1 deletion src/languages/csharp.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Language: C#
Author: Jason Diamond <jason@diamond.name>
Contributor: Nicolas LLOBERA <nllobera@gmail.com>, Pieter Vantorre <pietervantorre@gmail.com>, David Pine <david.pine@microsoft.com>
Website: https://docs.microsoft.com/en-us/dotnet/csharp/
Website: https://docs.microsoft.com/dotnet/csharp/
Category: common
*/

Expand Down Expand Up @@ -93,6 +93,7 @@ export default function(hljs) {
'record',
'ref',
'return',
'scoped',
'sealed',
'sizeof',
'stackalloc',
Expand Down
1 change: 1 addition & 0 deletions test/markup/csharp/scoped.expect.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">ref</span> T <span class="hljs-title">AsRef</span>&lt;<span class="hljs-title">T</span>&gt;(<span class="hljs-params"><span class="hljs-keyword">scoped</span> <span class="hljs-keyword">in</span> T source</span>)</span>;
1 change: 1 addition & 0 deletions test/markup/csharp/scoped.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
public static ref T AsRef<T>(scoped in T source);