Codist icon indicating copy to clipboard operation
Codist copied to clipboard

Codist 8.0 Beta

Open wmjordan opened this issue 1 year ago • 2 comments

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

Download

Codist 9988

Codist 9978 Codist 9961

What's New

  • Transform Markdown Document 🆕 This new feature can turn markdown document into an HTML document, or perform XSLT against the XHTML document generated from a markdown document
  • Syntax Highlight
    • [x] Possible to export all syntax styles (including default ones defined in VS) (#313) 🆕
    • [x] Custom syntax highlight (see Wiki page) 🆕 (9978)
    • [x] Fix an issue which caused C# tagger from quitting unexpectedly when "Copy rich text on copy/cut" option enabled (#333)
    • [x] Improve performance of markdown tagger and comment tagger
    • [x] Syntax highlight of parameters in primary constructor 🆕
  • Smart Bar
    • [x] New command to extract lines containing selection into a new document 🆕
    • [x] New option of capitalization (Ctrl: convert snail separated expressions to capitalized symbols) 🆕
  • Super Quick Info
    • [x] Display more info about selected single character 🆕
    • [x] Improve display of <code> and <hr> in C# XML Doc (#326)
  • Navigation Bar
    • [x] A new button to copy markdown titles 🆕
  • Scrollbar Marker
    • [x] Don't crash VS if marker rendition fails

wmjordan avatar Aug 30 '24 08:08 wmjordan

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 avatar Sep 25 '24 12:09 wmjordan

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

wmjordan avatar Oct 18 '24 01:10 wmjordan

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;
}

fitdev avatar Nov 01 '24 15:11 fitdev

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

wmjordan avatar Nov 01 '24 23:11 wmjordan

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

fitdev avatar Nov 02 '24 12:11 fitdev

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, TNumOther)' must match the constraints for type parameter 'TNumOther' of interface method 'ISomething<Something, int>.CreateFromOtherNumber<TNumOther>(TNumOther, TNumOther)'. Consider using an explicit interface implementation instead.

image

wmjordan avatar Nov 02 '24 13:11 wmjordan

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;
}

fitdev avatar Nov 02 '24 17:11 fitdev

@fitdev Please download and test the new beta.

wmjordan avatar Nov 04 '24 01:11 wmjordan

@fitdev Please download and test the new beta.

File not found new version Codist 10003 @wmjordan

tranbinhnghia avatar Nov 04 '24 06:11 tranbinhnghia

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

wmjordan avatar Nov 04 '24 07:11 wmjordan

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

Thank you, I have downloaded the file.

tranbinhnghia avatar Nov 04 '24 07:11 tranbinhnghia

Thank you for a quick fix! Works great!

fitdev avatar Nov 04 '24 09:11 fitdev

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

wmjordan avatar Nov 04 '24 11:11 wmjordan

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

To make it work, please see the Wiki page.

wmjordan avatar Nov 05 '24 08:11 wmjordan

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 avatar Nov 05 '24 13:11 fitdev

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

fitdev avatar Nov 25 '24 07:11 fitdev

@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.

wmjordan avatar Nov 25 '24 12:11 wmjordan

Thought I would report this just in case...

Syntax highlighting of indexers seems to not work correctly in VS 17.13 P1:

Screenshot_20241127_153134

In the first one, only the wrapped portion of a line gets proper highlighting. In the second one nothing is properly highlighted (note the braces, as well as member names).

Also in my style [Attribute]s should be rendered with a smaller font, and here the font is the same.

fitdev avatar Nov 27 '24 12:11 fitdev

Please download the new beta (10052) which has fixed the issue of index highlight introduced in the previous beta.

wmjordan avatar Nov 28 '24 01:11 wmjordan

Thank you! Yes the new beta has fixed it!

fitdev avatar Nov 28 '24 08:11 fitdev

BTW: Are there plans to support NaviBar in split document views (right now only one of the split document views is properly reflected in the NaviBar, when switching to another split view NaviBar rmeains unchanged even though the cursor there is in a different type/member)?

fitdev avatar Nov 29 '24 12:11 fitdev

Not sure if this is a bug of VS or Codist or something else entirely, but I thought I would mention it:

Screenshot_20241205_104656 Screenshot_20241205_104801

I want so that unreachable / unnecessary code is semi-transparent but retains all other colors. So I set the Codist style to have Opacity of 10. However this works only after I manually change Unnecessary Code Diagnostics in VS Fonts and Colors Options to either Default or Automatic and it persists until I restart VS.

The next time I restart VS, the unnecessary code will be plain gray (presumably VS's default). And to make it work again, I need to again go to VS Fonts and Colors and change Unnecessary Code Diagnostics to either Default or Automatic.

As long as I change it to either Default or Automatic after a restart it works again. So whether it is on Default or Automatic does not matter, but I have to change it after every restart to the "other" value: Default to Automatic, or Automatic to Default.

I would like this setting to persist, so that Codist's style is always applied - just opacity change without affecting colors.

fitdev avatar Dec 05 '24 07:12 fitdev

@fitdev

Are there plans to support NaviBar in split document views

I'd love to, but it is out of my capability.

the unnecessary code will be plain gray

It is a problem. I will look into it.

wmjordan avatar Dec 05 '24 08:12 wmjordan

@fitdev I have no idea why the unnecessary code being gray, which is really nasty. Fortunately I found a workaround. Please download the new beta. Thank you for sharing your thoughts.

wmjordan avatar Dec 05 '24 09:12 wmjordan

Thank you for a new beta. Unfortunately it did not fix it. Still had to change the color in VS Options:

After VS Restart: Screenshot_20241205_144844

After Changing Color in VS Options: Screenshot_20241205_144932

fitdev avatar Dec 05 '24 11:12 fitdev

@fitdev Sorry to see that. Please download the new beta and test it again.

wmjordan avatar Dec 06 '24 06:12 wmjordan

Seems to work now! Thank you for the quick fix!

fitdev avatar Dec 06 '24 07:12 fitdev

Found another bug. Codist erroneously claims a type implements interface member, but does not take into account ref returns:

Screenshot_20241207_002421 Screenshot_20241207_002442

fitdev avatar Dec 06 '24 21:12 fitdev

Thank you for reporting this. Please download the new beta 10086 and test it.

wmjordan avatar Dec 08 '24 12:12 wmjordan

Thank you for looking into this. New beta did not fix it unfortunately. And the other way around is also erroneous: Screenshot_20241208_171238 Screenshot_20241208_171248 Screenshot_20241208_171255

fitdev avatar Dec 08 '24 14:12 fitdev