Skip to content

Conversation

@dkearns
Copy link
Collaborator

@dkearns dkearns commented May 31, 2022

This is incomplete but probably does a decent job highlighting correct code.

TODO:

  • Single-line and multi-line raw strings should be handled separately and more strictly.
  • Invalid delimiter sequences should be highlighted as errors.
  • Normal strings shouldn't obscure errors by matching in invalid raw string literal syntax.
  • Should raw strings be coloured distinctly?

@nickspoons
Copy link
Owner

Thanks @dkearns. To answer your question, in my opinion no, raw strings shouldn't be highlighted differently to other strings. Despite the new semantics they are just strings at the end of the day, and people have expectations of those basic highlight colours. People who want them coloured differently can always link csRawString to something else in their personal config if they choose.

@dkearns dkearns mentioned this pull request Oct 14, 2022
16 tasks
@dkearns dkearns force-pushed the highlight-raw-string-literals branch from 467724f to ad374a3 Compare November 15, 2022 11:59
@nickspoons
Copy link
Owner

@dkearns I would quite like to merge this. How important do you feel your "TODO"s are? As you mentioned, it works well as it is

@dkearns dkearns force-pushed the highlight-raw-string-literals branch 3 times, most recently from efbfeca to 5394fca Compare March 13, 2025 12:45
@dkearns dkearns force-pushed the highlight-raw-string-literals branch from 5394fca to 89c78dd Compare March 13, 2025 12:46
@dkearns
Copy link
Collaborator Author

dkearns commented Mar 13, 2025

Hi Nick,

Three years...sorry.

I have lost context but I had a quick look and I think it's fine to merge. At least, it appears to handle all the examples on https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/tokens/raw-string.

I'll take a look at my other outstanding PRs soon and see what else has been added to C# while I blinked.

@dkearns dkearns marked this pull request as ready for review March 13, 2025 12:55
@nickspoons nickspoons merged commit 85989f9 into nickspoons:master Mar 13, 2025
2 checks passed
@nickspoons
Copy link
Owner

Thanks very much @dkearns!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants