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
307 stars 28 forks source link

Codist 7.9 beta #316

Closed wmjordan closed 3 months ago

wmjordan commented 7 months ago

Download

Codist 9886

Codist 9884 Codist 9881 Codist 9869 Codist 9861 Codist 9859 Codist 9848 Codist 9846 Codist 9840 Codist 9838 Codist 9822 Codist 9808 Codist 9743 Codist 9635 Codist 9589 Codist 9584 Codist 9583 Codist 9573

What's New

laicasaane commented 7 months ago

I've just upgraded to VS 17.9 and observed that Codist interferes with the default colorization. Disabling Codist will bring back the behaviour. My temporary solution is enabling syntax highlight of Codist.

laicasaane commented 7 months ago

With Codist syntax highlight enabled these types lose their color. image

wmjordan commented 7 months ago

It is strange. I've been working with the 17.9 preview versions for quite a few months and things were fine after Codist 7.8. Does restarting your VS can make things work?

The following screenshot is taken after that I reset my Codist syntax highlight to default.

image

The following screenshot is taken after that I applied my Codist syntax highlight settings.

image

Could you post a sample solution and let me test it?

wmjordan commented 7 months ago

@fitdev There's a new beta version here which supports C# 12. Please help test it.

fitdev commented 7 months ago

Thank you for the new release! I will try it soon.

BTW, I have been using C# 12 for some time now, and have not noticed any issues with Codist C#-wise. Out of curiosity - what was added in this beta version then?

Also, regarding syntax highlights being messed up - it happened to me on and off for the last 2 or so years - almost every time I would update VS. I am still on an older VS 17.9 preview for the time being, so I don;t know if the issue would affect me were I to upgrade top their latest 17.10 preview released yesterday.

laicasaane commented 7 months ago

Weird, it works now, and I've done nothing.

wmjordan commented 7 months ago

what was added in this beta version then?

The new beta has supported highlight of collection expression, primary constructor of base type and the Quick Info of lambda expression return value. The recently uploaded beta has added more language types to Comment Tagger and fixed some bugs.

laicasaane commented 7 months ago

Hi, it's acting up again. You can try this solution. It's just a source generator solution and you don't need Unity. https://github.com/Zitga-Tech/ZBase.Foundation.Aliasing/tree/main/Packages/ZBase.Foundation.Aliasing/Source~

After opening the solution in VS, I open this file AliasDeclaration+WriteCode.cs then scroll up and down for a bit then colorization just disappears altogether.

wmjordan commented 7 months ago

@laicasaane Could you zip that solution files and upload it here?

laicasaane commented 7 months ago

Here is the solution: ZBase.Foundation.Aliasing.SourceGen.zip

And the recent screen recording: https://github.com/wmjordan/Codist/assets/1594982/b6fdc4ba-ff3a-4f0a-9d59-f3c9340043c5

laicasaane commented 7 months ago

For completeness, this is my Codist settings: Codist.json

wmjordan commented 7 months ago

@laicasaane With your configuration file, I managed to reproduce your issue. Some part of the advance syntax highlight procedure in Codist was ran despite of the disabled feature control. And a bug in VS's highlight was triggered after that procedure.

At this moment, you have to enable the Syntax Highlight feature in Codist and try your luck.

laicasaane commented 7 months ago

I'm OK with enabling Codist syntax highlight feature atm. However, this happens: https://github.com/wmjordan/Codist/issues/316#issuecomment-1942922465

wmjordan commented 7 months ago

@laicasaane You'd been bugged by the aforementioned VS highlight problem. Somehow the identifier takes higher precedence than interface name. Please re-enable the syntax highlight feature and clear the foreground color of the identifier in the Syntax Highlight Customization Window.

laicasaane commented 7 months ago

image Shouldn't => be categorized as operator instead of C#: Method? Is this the bug in VS highlight too?

wmjordan commented 7 months ago

Shouldn't => be categorized as operator instead of C#: Method? Is this the bug in VS highlight too?

I deliberately changed the style of => operators in member declarations to indicate the declaration type.

wmjordan commented 7 months ago

There's a new beta version for test.

The configuration window for syntax highlight has simplified the punctuation highlight options. image

fitdev commented 7 months ago

So does the new behavior extend the previous options to also apply to operators? Previously it was only for "Braces and Parentheses".

fitdev commented 7 months ago

In the latest beta operator overloading does not seem to work: Screenshot_20240229_220206

wmjordan commented 7 months ago

In the latest beta operator overloading does not seem to work

It is a bug in VS.

You can reproduce the problem with Codist disabled.

image
wmjordan commented 6 months ago

Hi, everybody.

There's a new beta which enhances highlight (three more syntax styles for customization) and editing of Markdown documents.

fitdev commented 6 months ago

three more syntax styles for customization

Which ones are those?

wmjordan commented 5 months ago

There is a new test version which addresses VS startup slowdown caused by Codist, reported from the Performance Manager.

wmjordan commented 5 months ago

The previous 9788 build could crash VS. Please download the newly uploaded 9798 build.

wmjordan commented 5 months ago

Oops, 9808 should fix the crash.

fitdev commented 4 months ago

I am not sure if has worked correctly in Codist before, and perhaps is no longer working now, but there seems to be an issue with "Find Referrers" command for implicit operators. They only seem to find the cases of direct casts, with implict casts not being returned:


struct Foo {
public static implicit operator Foo(int i) => new Foo();
}

class Usage {

void Test() {
  Foo foo1 = (Foo)25; //This is found
  Foo foo2 = 34; //This will not be found
}

}

Also there is a slight issue where implicit/explicit operators do not have super quick infos for them, they are only selectable using NaviBar.

wmjordan commented 4 months ago

They only seem to find the cases of direct casts, with implict casts not being returned

It is a known issue. It never works.

You can use the following snippet:

struct Foo
{
    public static implicit operator Foo(int i) => new Foo();
}

class Usage
{

    void Explicit() {
        Foo foo1 = (Foo)25; //This is found
    }

    void Implicit() {
        Foo foo2 = 34; //This will not be found
    }
}

Right click the Foo in the implicit operator declaration and execute the Find All References command in VS. Only the Explicit method will be in the result list.

fitdev commented 4 months ago

Oh I see - it is a Roslyn issue. Sorry for the comment then. Hopefully they will address it soon.

wmjordan commented 4 months ago

@fitdev You are welcome. It takes quite some considerable calculation to find out implicit conversion occurences.

In short, use implicit conversion sparingly and do not do expensive or complicate works within it.

fitdev commented 4 months ago

In short, use implicit conversion sparingly and do not do expensive or complicate works within it.

I find them extremely useful, especially for "smart" arguments, where the caller may use several different types depending on the need - like an int, or a string, or an enum (in this example for a user-defined TextEncoding type which can be initialized from a set of known encodings, a codepage, and encoding name for example) - all of which get auto-converted to the proper type though these implicit operators. So I wish Roslyn would fix it and allow one to see all instances of implicit conversion taking place.

wmjordan commented 4 months ago

for "smart" arguments

It is possible to detect this type of situations in the Find Parameter Assignment function though. Please try the new beta. It adds a type cast icon to the occurrence if the parameter is taken via implicit type conversion.

Please check whether the detection hurts the performance of that function.

fitdev commented 4 months ago

It is possible to detect this type of situations in the Find Parameter Assignment function though.

Thank you for the new beta! I am not sure though if it is of much help in finding implicit operator usages, since typically there would be 10s of methods - all accepting the same "Smart"-Struct-Typed argument with possibly 100s of usages across all these methods. But being able to see such implicit conversion in the Parameter Assignment list is very nice nonetheless, thank you!