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

Declaration identifier tokens are not highlighted as type names except for interfaces #184

Open
jnm2 opened this issue May 5, 2021 · 6 comments

Comments

@jnm2
Copy link
Contributor

jnm2 commented May 5, 2021

Visual Studio/SourceBrowser:
image image

Also, I've really become accustomed to VS and VS Code's advanced styling for structs, enums, interfaces, and type parameters.

@jnm2 jnm2 changed the title Type names are not highlighted as such in identifiers except for interfaces Declaration identifier tokens are not highlighted as type names except for interfaces May 5, 2021
@jnm2
Copy link
Contributor Author

jnm2 commented May 5, 2021

@KirillOsenkov Wonder if there is a correlation between the fact that interfaces are different than other types here and the same thing in #179

@KirillOsenkov
Copy link
Owner

could be. We should check which classification(s) are returned by Roslyn for these, could be we need to filter some out (like we already do for static symbol)

KirillOsenkov added a commit that referenced this issue May 8, 2021
@KirillOsenkov
Copy link
Owner

Hmm, I can't reproduce this:
image

I've added this sample to the test code, so you can just GenerateTestSite.cmd and RunTestSite.cmd to check:
ea86c3d

Check http://localhost:5000/Project2/diagnostics.txt, maybe you have errors that prevent the classifier from working properly? Each project generates a diagnostics.txt with a list of diagnostics for that project returned by Roslyn.

We don't have distinct classification for various type kinds, this is a relatively recent addition to VS.

@jnm2
Copy link
Contributor Author

jnm2 commented May 9, 2021

I still repro by debugging HtmlGenerator to point it at a .sln file that points to these two files (Repro.zip):

void M<SomeTypeParameter>(
    SomeClass a,
    SomeStruct b,
    SomeRecord c,
    SomeEnum d,
    SomeInterface e,
    SomeDelegate f,
    SomeTypeParameter g)
{
}

class SomeClass { }
struct SomeStruct { }
record SomeRecord;
enum SomeEnum { }
interface SomeInterface { }
delegate void SomeDelegate();

And:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net5.0</TargetFramework>
  </PropertyGroup>

</Project>

The repro project builds successfully before running HtmlGenerator.

The debug arguments are:

"C:\Users\Joseph\Source\Repos\Repro\Repro.sln" /out:$(SolutionDir)src\SourceIndexServer\index /force

Diagnostics.txt:

C:\Users\Joseph\Source\Repos\Repro\Repro\Program.cs(1,6): warning CS8321: The local function 'M' is declared but never used
C:\Users\Joseph\Source\Repos\Repro\Repro\obj\Debug\net5.0\Repro.AssemblyInfo.cs(12,1): hidden CS8019: Unnecessary using directive.
C:\Users\Joseph\Source\Repos\Repro\Repro\obj\Debug\net5.0\.NETCoreApp,Version=v5.0.AssemblyAttributes.cs(2,1): hidden CS8019: Unnecessary using directive.
C:\Users\Joseph\Source\Repos\Repro\Repro\obj\Debug\net5.0\.NETCoreApp,Version=v5.0.AssemblyAttributes.cs(3,1): hidden CS8019: Unnecessary using directive.
C:\Users\Joseph\Source\Repos\Repro\Repro\obj\Debug\net5.0\Repro.AssemblyInfo.cs(11,1): hidden CS8019: Unnecessary using directive.

@jnm2
Copy link
Contributor Author

jnm2 commented May 9, 2021

I'll do some digging as I have time too.

We don't have distinct classification for various type kinds, this is a relatively recent addition to VS.

I'd be interested in implementing this.

@KirillOsenkov
Copy link
Owner

You can see that I picked a single-letter css class for types, to minimize the html as much as possible. If you introduce new css for type kinds, see if you can minimize resulting Html. Otherwise it should be pretty straightforward. It’s all in Pass1, around Document*.cs and Classifier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants