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

In-string highlighting for C# has bug in regex #289

Open
ozra opened this issue Nov 14, 2024 · 3 comments
Open

In-string highlighting for C# has bug in regex #289

ozra opened this issue Nov 14, 2024 · 3 comments
Assignees

Comments

@ozra
Copy link

ozra commented Nov 14, 2024

At the company I'm working C# is the only option for coding.

In the VSCode extension description I see: "...syntax highlighting embedded in other languages, namely Markdown, Java, Python, Javascriopt, .NET and Go.". Granted .net != C#, but I expected it to be supported.
It works fine if I write a typescript file, so it is installed and working properly otherwise.

I've tried all variants I can think of but there is no highlighting of cypher queries anyway:

Example of variations:
bild

@stefanak-michal
Copy link

Why don't add setting where we can set file extensions where this highlighting will be applied. I would like if php has support too.

@ozra ozra changed the title No in-string highlighting for C# In-string highlighting for C# has bug in regex Feb 11, 2025
@ozra
Copy link
Author

ozra commented Feb 11, 2025

The issue is a bug in the regex that matches string start and end, it uses Java-syntax instead of C#.

@ncordon
Copy link
Collaborator

ncordon commented Feb 28, 2025

We'll look into this, sorry for the delay answering.

The issue is a bug in the regex that matches string start and end, it uses Java-syntax instead of C#.

The syntax supported is the triple """: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/tokens/raw-string.

So this would work:

var a = """//cypher
    // This is a comment
    MATCH (n:Label) RETURN function(n.property)
""";

I will look into adding the @ syntax for strings as well.

Why don't add setting where we can set file extensions where this highlighting will be applied. I would like if php has support too.

Unless my understanding is wrong, you need a configuration for every language you want to enable this for in a VSCode plugin: https://github.com/neo4j/cypher-language-support/tree/main/packages/vscode-extension/syntaxes, so making this dynamic is not an option

@ncordon ncordon self-assigned this Feb 28, 2025
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

No branches or pull requests

3 participants