LoginSignup
0
0

More than 5 years have passed since last update.

C# Syntax Highlighterのテスト

Posted at

pygments.lexers.dotnet.CSharpLexerという実装らしい。

やっぱり、型名のハイライトは難しいよね……(下の例で言うと、Programには色がついてるけど、Func<T>とかTask<T>StreamReaderには色がつかない)

using System;
using System.IO;
using System.Threading.Tasks;

class Program
{
    static void Main(string[] args)
    {
        Func<Task<string>> f = async () =>
        {
            var sr = new StreamReader("somefile.txt");
            var t = await sr.ReadToEndAsync();
            return t.ToLower();
        };
    }
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0