Closed wmjordan closed 3 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.
With Codist syntax highlight enabled these types lose their color.
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.
The following screenshot is taken after that I applied my Codist syntax highlight settings.
Could you post a sample solution and let me test it?
@fitdev There's a new beta version here which supports C# 12. Please help test it.
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.
Weird, it works now, and I've done nothing.
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.
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.
@laicasaane Could you zip that solution files and upload it here?
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
For completeness, this is my Codist settings: Codist.json
@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.
I'm OK with enabling Codist syntax highlight feature atm. However, this happens: https://github.com/wmjordan/Codist/issues/316#issuecomment-1942922465
@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.
Shouldn't =>
be categorized as operator instead of C#: Method
? Is this the bug in VS highlight too?
Shouldn't
=>
be categorized as operator instead ofC#: Method
? Is this the bug in VS highlight too?
I deliberately changed the style of =>
operators in member declarations to indicate the declaration type.
There's a new beta version for test.
The configuration window for syntax highlight has simplified the punctuation highlight options.
So does the new behavior extend the previous options to also apply to operators? Previously it was only for "Braces and Parentheses".
In the latest beta operator overloading does not seem to work:
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.
Hi, everybody.
There's a new beta which enhances highlight (three more syntax styles for customization) and editing of Markdown documents.
three more syntax styles for customization
Which ones are those?
There is a new test version which addresses VS startup slowdown caused by Codist, reported from the Performance Manager.
The previous 9788 build could crash VS. Please download the newly uploaded 9798 build.
Oops, 9808 should fix the crash.
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.
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.
Oh I see - it is a Roslyn issue. Sorry for the comment then. Hopefully they will address it soon.
@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.
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.
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.
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!
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
<see>
and<seealso>
elements in C# XML Documentations (#327)