wmjordan / Codist

A visual studio extension which enhances syntax highlighting, quick info (tooltip), navigation bar, scrollbar, display quality, and brings smart tool bar with code refactoring to code editor.
https://marketplace.visualstudio.com/items?itemName=wmj.Codist
GNU General Public License v3.0
316 stars 29 forks source link

Codist 8.0 Beta #334

Open wmjordan opened 2 months ago

wmjordan commented 2 months ago

This is a very early stage of the new version of Codist 8.

Download

Codist 10052

Codist 10033 Codist 10003 Codist 9988 Codist 9978 Codist 9961

What's New

wmjordan commented 2 months ago

Beta 9978 allows us to define our own set of regular expressions to highlight our documents.

Here's an example of extra highlight of a markdown file.

image
wmjordan commented 1 month ago

Beta 9988 adds syntax highlight support for parameters in C# primary constructors. image

fitdev commented 3 weeks ago

Discovered a small issue with Super Quick Info.

When a type implements a static method with generic type parameters, hovering over the implementation does not list the corresponding Interface and Interface's static abstract member being implemented:

interface ISomething<This, TNum> where This : ISomething<This, TNum> where TNum : unmanaged, INumber<TNum> {
  static abstract This CreateFromOtherNumber<TNumOther>(TNumOther a, TNumOther b) where TNumOther : unmanaged, INumber<TNumOther>;
}

struct Something : ISomething<Something, int> {
  // Hovering over CreateFromOtherNumber member does NOT show that it is an implementation of ISomething<This, TNum>.CreateFromOtherNumber
  public static Something CreateFromOtherNumber<TNumOther>(TNumOther a, TNumOther b) where TNumOther : unmanaged, INumber<TNumOther> => default;
}
wmjordan commented 3 weeks ago

@fitdev Your snippet has syntax error. Generic type named TNum is undefined. It is not possible to display implementation when the parameter is wrong.

fitdev commented 3 weeks ago

Sorry that was a typo, it should have been TNumOther there. Then it works. And the issue remains.

wmjordan commented 3 weeks ago

Sorry that was a typo, it should have been TNumOther there. Then it works. And the issue remains.

The code was still wrong. You should see the following error if you are running the most recent preview version of VS:

CS0425: The constraints for type parameter 'TNumOther' of method 'Something.CreateFromOtherNumber(TNumOther, TNumOther)' must match the constraints for type parameter 'TNumOther' of interface method 'ISomething<Something, int>.CreateFromOtherNumber(TNumOther, TNumOther)'. Consider using an explicit interface implementation instead.

image

fitdev commented 3 weeks ago

I have corrected the code above, I replaced TNum with TNumOther in 2 places:

interface ISomething<This, TNum> where This : ISomething<This, TNum> where TNum : unmanaged, INumber<TNum> {
  static abstract This CreateFromOtherNumber<TNumOther>(TNumOther a, TNumOther b) where TNumOther : unmanaged, INumber<TNumOther>;
}

struct Something : ISomething<Something, int> {
  // Hovering over CreateFromOtherNumber member does NOT show that it is an implementation of ISomething<This, TNum>.CreateFromOtherNumber
  public static Something CreateFromOtherNumber<TNumOther>(TNumOther a, TNumOther b) where TNumOther : unmanaged, INumber<TNumOther> => default;
}
wmjordan commented 3 weeks ago

@fitdev Please download and test the new beta.

tranbinhnghia commented 3 weeks ago

@fitdev Please download and test the new beta.

File not found new version Codist 10003 @wmjordan

wmjordan commented 3 weeks ago

@tranbinhnghia Weird! The download was just updated. Please try again.

tranbinhnghia commented 3 weeks ago

@tranbinhnghia Weird! The download was just updated. Please try again.

Thank you, I have downloaded the file.

fitdev commented 3 weeks ago

Thank you for a quick fix! Works great!

wmjordan commented 3 weeks ago

@fitdev Please help test it. I don't know whether this fix can break somewhere else (but limited to implementation Quick Info only).

wmjordan commented 2 weeks ago

There is a new beta version which supports highlighting the output window pane.

To make it work, please see the Wiki page.

fitdev commented 2 weeks ago

Please help test it.

The missing interface member implementation mention in the Super Quick Info now displays correctly. Thank you for the fix!

I will let you know if I encounter any issues.

fitdev commented 8 hours ago

Just wondering... Now that VS has released CodeLens API - any plans to use it in Codist?

wmjordan commented 4 hours ago

@fitdev The VisualStudio.Extensibility thing has been out for quite some years, but not yet officially released.

Once it is used, the support to previous VS version (2017 and 2019) will be probably broken. Since I still have VS 2017 installed on my computer and I have not yet find a must-have usage of the new API, I will keep an eye on it, but stick to the old one unless there is enough motivation for me to move to the new onw.