Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement classification for UTF8 String Literals #60265

Merged

Conversation

AlekseyTs
Copy link
Contributor

@AlekseyTs AlekseyTs commented Mar 18, 2022

Test plan #58848

@JoeRobich
Copy link
Member

Is there a desire for these strings to be colored differently than other strings by default?

If not, then you could set their BaseDefinitinons to be the String and VerbatimString Classifications (Example).

Will need ClassificationFormatDefinitions added to the WPF ClassificationTypeFormatDefinitions. If they are inheriting their foreground color, then no need to set it in the constructor (Example).

@AlekseyTs
Copy link
Contributor Author

I will let @davidwengier and @CyrusNajmabadi to make the decision here and advise how we should proceed.

@AlekseyTs
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@davidwengier
Copy link
Contributor

I don't think we need to colour them differently. We don't colour interpolated or raw strings differently.

@CyrusNajmabadi
Copy link
Member

my read of things is teh same as David. Basically, i expect most (if not all) IDE features to basically behave uniformly for the u8 version of a given string literal type. It will almost be as if 'u8' is just an optional suffix we almost always ignore for most features. Only features that have a strong need to actually present things differently to the user are things we can update to do so later.

@AlekseyTs
Copy link
Contributor Author

@davidwengier, @CyrusNajmabadi Based on this discussion, do I need to make any changes to this PR? Otherwise, it would be good to get a sign-off.

@@ -27,6 +27,7 @@ public static class ClassificationTypeNames
public const string OperatorOverloaded = "operator - overloaded";
public const string PreprocessorKeyword = "preprocessor keyword";
public const string StringLiteral = "string";
public const string UTF8StringLiteral = "UTF8 string";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would remove thse and just use the existing classification names. e.g. we don't distinguish integer-classification versus double-classification. They're just 'numbers'. So here i think it's fine, absent some really strong user feedback, that we reuse the existing classifications.

@@ -36,6 +37,7 @@ public static class ClassificationTypeNames
public const string PreprocessorText = "preprocessor text";
public const string Punctuation = "punctuation";
public const string VerbatimStringLiteral = "string - verbatim";
public const string UTF8VerbatimStringLiteral = "UTF8 string - verbatim";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can remove as well.

@AlekseyTs AlekseyTs requested review from RikkiGibson and a team March 21, 2022 16:36
@AlekseyTs
Copy link
Contributor Author

@RikkiGibson, @dotnet/roslyn-compiler For the second review.

@RikkiGibson RikkiGibson self-assigned this Mar 21, 2022
@AlekseyTs AlekseyTs merged commit 9276c09 into dotnet:features/Utf8StringLiterals Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants