Skip to content

Discuss: Higher fidelity language highlighting (in general) #2500

@Turnerj

Description

@Turnerj

Taking over this issue to use it as the proposal for higher fidelity highlighting as a general idea and a plan to get there - if we should (I think we should).


[Editor] Original issue content:

The short version is I want to get this (the C# snippet from the highlight.js website):
image

Closer to this (same snippet but in the latest version of Visual Studio 2019):
image

Actual snippet of code:

using System.IO.Compression;

#pragma warning disable 414, 3021

namespace MyApplication
{
    [Obsolete("...")]
    class Program : IInterface
    {
        public static List<int> JustDoIt(int count)
        {
            Console.WriteLine($"Hello {Name}!");
            return new List<int>(new int[] { 1, 2, 3 })
        }
    }
}

My question isn't about writing the CSS to do that for a theme, its about having classes to target those styles in the first place. Where does the use of a specific highlight.js class start and end (eg. "hljs-function" for declarations but not calls?). Like, is there a spec somewhere for when something should be used?

I've read through some of the related issues like #1731 and #1378 so I do understand reluctance for adding classes that can target these types of cases as core functionality especially when not all languages do this. I guess I'm querying, more as a guide, if I were to implement (some of) this for C#, I don't want to step on toes about class name consistency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    big picturePolicy or high level discussiondiscuss/proposeProposal for a new feature/directionhelp welcomeCould use help from communitylanguage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions