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

Add C# specific syntax highlighting #33

Merged
merged 3 commits into from
Apr 28, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Special thank to [Pavel Pertsev](https://github.com/morhetz), the creator of [gr
- [sedmicha](https://github.com/sedmicha)
- [Layo](https://github.com/layoaster)
- [Maxim Tsoy](https://github.com/muodov)
- [Huip van den Ende](https://github.com/huipvandenende)

Thanks for help to make the Gruvbox theme better.

Expand Down
48 changes: 48 additions & 0 deletions code-examples/.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;

namespace API.Controllers
{
[ApiController]
[Route("[controller]")]
public class WeatherForecastController : ControllerBase
{
private static readonly string[] Summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};

public ThisShowcase(string name)
{
this.name = name;
}

private readonly ILogger<WeatherForecastController> _logger;

public WeatherForecastController(ILogger<WeatherForecastController> logger)
{
_logger = logger;
}

[HttpGet]
public IEnumerable<WeatherForecast> Get()
{
var rng = new Random();
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = DateTime.Now.AddDays(index),
TemperatureC = rng.Next(-20, 55),
Summary = Summaries[rng.Next(Summaries.Length)]
})
.ToArray();
}
}
}




3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"Michell Stuttgart (https://github.com/mstuttgart)",
"sedmicha (https://github.com/sedmicha)",
"Layo (https://github.com/layoaster)",
"Maxim Tsoy (https://github.com/muodov)"
"Maxim Tsoy (https://github.com/muodov)",
"Huip van den Ende (https://github.com/huipvandenende)"
],
"publisher": "jdinhlife",
"engines": {
Expand Down
48 changes: 44 additions & 4 deletions themes/gruvbox-dark-hard.json
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,40 @@
"foreground": "#fabd2f"
}
},
// C# ----------------------------------------
{
"name": "C# functions & namespace",
"scope": [
"meta.function.cs",
"entity.name.function.cs",
"entity.name.type.namespace.cs"
],
"settings": {
"foreground": "#b8bb26"
}
},
{
"name": "C# Variables",
"scope": [
"keyword.other.using.cs",
"entity.name.variable.field.cs",
"entity.name.variable.local.cs",
"variable.other.readwrite.cs"
],
"settings": {
"foreground": "#8ec07c"
}
},
{
"name": "C# This",
"scope": [
"keyword.other.this.cs",
"keyword.other.base.cs"
],
"settings": {
"foreground": "#d3869b"
}
},
// MAKEFILE ----------------------------------------
{
"scope": "meta.scope.prerequisites",
Expand Down Expand Up @@ -872,21 +906,27 @@
// POWERSHELL ------------------------------------
{
"name": "Powershell member",
"scope": ["source.powershell variable.other.member.powershell"],
"scope": [
"source.powershell variable.other.member.powershell"
],
"settings": {
"foreground": "#fe8019"
}
},
{
"name": "Powershell function",
"scope": ["source.powershell support.function.powershell"],
"scope": [
"source.powershell support.function.powershell"
],
"settings": {
"foreground": "#fabd2f"
}
},
{
"name": "Powershell function attribute",
"scope": ["source.powershell support.function.attribute.powershell"],
"scope": [
"source.powershell support.function.attribute.powershell"
],
"settings": {
"foreground": "#bdae93"
}
Expand Down Expand Up @@ -1120,4 +1160,4 @@
"textLink.activeForeground": "#458588",
"debugToolBar.background": "#1d2021"
}
}
}
48 changes: 44 additions & 4 deletions themes/gruvbox-dark-medium.json
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,40 @@
"foreground": "#fabd2f"
}
},
// C# ----------------------------------------
{
"name": "C# functions & namespace",
"scope": [
"meta.function.cs",
"entity.name.function.cs",
"entity.name.type.namespace.cs"
],
"settings": {
"foreground": "#b8bb26"
}
},
{
"name": "C# Variables",
"scope": [
"keyword.other.using.cs",
"entity.name.variable.field.cs",
"entity.name.variable.local.cs",
"variable.other.readwrite.cs"
],
"settings": {
"foreground": "#8ec07c"
}
},
{
"name": "C# This",
"scope": [
"keyword.other.this.cs",
"keyword.other.base.cs"
],
"settings": {
"foreground": "#d3869b"
}
},
// MAKEFILE ----------------------------------------
{
"scope": "meta.scope.prerequisites",
Expand Down Expand Up @@ -872,21 +906,27 @@
// POWERSHELL ------------------------------------
{
"name": "Powershell member",
"scope": ["source.powershell variable.other.member.powershell"],
"scope": [
"source.powershell variable.other.member.powershell"
],
"settings": {
"foreground": "#fe8019"
}
},
{
"name": "Powershell function",
"scope": ["source.powershell support.function.powershell"],
"scope": [
"source.powershell support.function.powershell"
],
"settings": {
"foreground": "#fabd2f"
}
},
{
"name": "Powershell function attribute",
"scope": ["source.powershell support.function.attribute.powershell"],
"scope": [
"source.powershell support.function.attribute.powershell"
],
"settings": {
"foreground": "#bdae93"
}
Expand Down Expand Up @@ -1120,4 +1160,4 @@
"textLink.activeForeground": "#458588",
"debugToolBar.background": "#282828"
}
}
}
48 changes: 44 additions & 4 deletions themes/gruvbox-dark-soft.json
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,40 @@
"foreground": "#fabd2f"
}
},
// C# ----------------------------------------
{
"name": "C# functions & namespace",
"scope": [
"meta.function.cs",
"entity.name.function.cs",
"entity.name.type.namespace.cs"
],
"settings": {
"foreground": "#b8bb26"
}
},
{
"name": "C# Variables",
"scope": [
"keyword.other.using.cs",
"entity.name.variable.field.cs",
"entity.name.variable.local.cs",
"variable.other.readwrite.cs"
],
"settings": {
"foreground": "#8ec07c"
}
},
{
"name": "C# This",
"scope": [
"keyword.other.this.cs",
"keyword.other.base.cs"
],
"settings": {
"foreground": "#d3869b"
}
},
// MAKEFILE ----------------------------------------
{
"scope": "meta.scope.prerequisites",
Expand Down Expand Up @@ -872,21 +906,27 @@
// POWERSHELL ------------------------------------
{
"name": "Powershell member",
"scope": ["source.powershell variable.other.member.powershell"],
"scope": [
"source.powershell variable.other.member.powershell"
],
"settings": {
"foreground": "#fe8019"
}
},
{
"name": "Powershell function",
"scope": ["source.powershell support.function.powershell"],
"scope": [
"source.powershell support.function.powershell"
],
"settings": {
"foreground": "#fabd2f"
}
},
{
"name": "Powershell function attribute",
"scope": ["source.powershell support.function.attribute.powershell"],
"scope": [
"source.powershell support.function.attribute.powershell"
],
"settings": {
"foreground": "#bdae93"
}
Expand Down Expand Up @@ -1120,4 +1160,4 @@
"textLink.activeForeground": "#458588",
"debugToolBar.background": "#32302f"
}
}
}
48 changes: 44 additions & 4 deletions themes/gruvbox-light-hard.json
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,40 @@
"foreground": "#b57614"
}
},
// C# ----------------------------------------
{
"name": "C# functions & namespace",
"scope": [
"meta.function.cs",
"entity.name.function.cs",
"entity.name.type.namespace.cs"
],
"settings": {
"foreground": "#79740e"
}
},
{
"name": "C# Variables",
"scope": [
"keyword.other.using.cs",
"entity.name.variable.field.cs",
"entity.name.variable.local.cs",
"variable.other.readwrite.cs"
],
"settings": {
"foreground": "#427b58"
}
},
{
"name": "C# This",
"scope": [
"keyword.other.this.cs",
"keyword.other.base.cs"
],
"settings": {
"foreground": "#8f3f71"
}
},
// MAKEFILE ----------------------------------------
{
"scope": "meta.scope.prerequisites",
Expand Down Expand Up @@ -871,21 +905,27 @@
// POWERSHELL ------------------------------------
{
"name": "Powershell member",
"scope": ["source.powershell variable.other.member.powershell"],
"scope": [
"source.powershell variable.other.member.powershell"
],
"settings": {
"foreground": "#af3a03"
}
},
{
"name": "Powershell function",
"scope": ["source.powershell support.function.powershell"],
"scope": [
"source.powershell support.function.powershell"
],
"settings": {
"foreground": "#b57614"
}
},
{
"name": "Powershell function attribute",
"scope": ["source.powershell support.function.attribute.powershell"],
"scope": [
"source.powershell support.function.attribute.powershell"
],
"settings": {
"foreground": "#665c54"
}
Expand Down Expand Up @@ -1119,4 +1159,4 @@
"textLink.activeForeground": "#458588",
"debugToolBar.background": "#f9f5d7"
}
}
}
Loading