Giter Club home page Giter Club logo

Comments (32)

wmjordan avatar wmjordan commented on June 22, 2024 1

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.

from codist.

wmjordan avatar wmjordan commented on June 22, 2024 1

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

from codist.

wmjordan avatar wmjordan commented on June 22, 2024 1

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.

from codist.

wmjordan avatar wmjordan commented on June 22, 2024 1

There's a new beta version for test.

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

from codist.

wmjordan avatar wmjordan commented on June 22, 2024 1

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

from codist.

wmjordan avatar wmjordan commented on June 22, 2024 1

Hi, everybody.

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

from codist.

wmjordan avatar wmjordan commented on June 22, 2024 1

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

from codist.

wmjordan avatar wmjordan commented on June 22, 2024 1

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

from codist.

wmjordan avatar wmjordan commented on June 22, 2024 1

Oops, 9808 should fix the crash.

from codist.

wmjordan avatar wmjordan commented on June 22, 2024 1

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.

from codist.

wmjordan avatar wmjordan commented on June 22, 2024 1

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

from codist.

wmjordan avatar wmjordan commented on June 22, 2024 1

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.

from codist.

laicasaane avatar laicasaane commented on June 22, 2024

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.

from codist.

laicasaane avatar laicasaane commented on June 22, 2024

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

  • non-nested types are correctly categorized by Codist syntax selector. But their color is wrong, as in the screenshot.
  • nested types are incorrectly categorized. Being either interface, struct or class they're all listed as "C#: Nested type member".
  • tested with both 7.8 release and 7.9 beta versions.

from codist.

wmjordan avatar wmjordan commented on June 22, 2024

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?

from codist.

wmjordan avatar wmjordan commented on June 22, 2024

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

from codist.

fitdev avatar fitdev commented on June 22, 2024

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.

from codist.

laicasaane avatar laicasaane commented on June 22, 2024

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

from codist.

laicasaane avatar laicasaane commented on June 22, 2024

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.

from codist.

wmjordan avatar wmjordan commented on June 22, 2024

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

from codist.

laicasaane avatar laicasaane commented on June 22, 2024

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

from codist.

laicasaane avatar laicasaane commented on June 22, 2024

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

from codist.

wmjordan avatar wmjordan commented on June 22, 2024

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

from codist.

laicasaane avatar laicasaane commented on June 22, 2024

I'm OK with enabling Codist syntax highlight feature atm. However, this happens: #316 (comment)

from codist.

laicasaane avatar laicasaane commented on June 22, 2024

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

from codist.

fitdev avatar fitdev commented on June 22, 2024

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

from codist.

fitdev avatar fitdev commented on June 22, 2024

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

from codist.

fitdev avatar fitdev commented on June 22, 2024

three more syntax styles for customization

Which ones are those?

from codist.

fitdev avatar fitdev commented on June 22, 2024

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.

from codist.

fitdev avatar fitdev commented on June 22, 2024

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

from codist.

fitdev avatar fitdev commented on June 22, 2024

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.

from codist.

fitdev avatar fitdev commented on June 22, 2024

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!

from codist.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.