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

Coloring fails to recognize escaping backslash characters from escaping other special characters #159

Closed
asilverman opened this issue May 7, 2024 · 4 comments · Fixed by #162
Labels
bug Something isn't working good first issue Good for newcomers help wanted Contribution requested

Comments

@asilverman
Copy link

Consider the following query:

let scannerId = "9d632724-5c18-43e9-9314-555e9587b30c";
cluster("foo").database("bar").table("baz")
| extend ScannerName = tostring(todynamic(Properties).scannerConfigurationName)
| where Name matches regex "Skipping comment creation for file" and Name matches regex "as the scanner rule is in silent mode"
| extend FullFileName = extract("Skipping comment creation for file (. + ) as the scanner rule is in silent mode", 1, Name)
| extend FileNameParts = split(FullFileName, "Modified\\")
| extend FileName = iff(isempty(FileNameParts[1]), FullFileName, strcat("\\", FileNameParts[1])) //FullFileName was added on 2/2/24
| extend FileName = trim("'", FileName)

Notice how the github highlighting recognizes the line | extend FileNameParts = split(FullFileName, "Modified\\") to be escaping the backslash characted being escaped. However, the kuskus extension doesn't (as shown below)
image

Version Information:

image

@rosshamish
Copy link
Owner

Good bug, thanks for the report.

If you (or anyone reading) is willing to put a fix together, I'd be happy to facilitate. There's some good test coverage for the syntax highlighting, so it would be "as simple" as adding a new test case to cover this scenario, then updating the syntax highlighting regex to make the new test pass.

@rosshamish rosshamish added bug Something isn't working good first issue Good for newcomers help wanted Contribution requested labels May 11, 2024
rosshamish added a commit that referenced this issue May 13, 2024
@rosshamish
Copy link
Owner

Found some time to look at this - fixed in #162 , published as v2.0.2 in https://github.com/rosshamish/kuskus/actions/runs/9056796653/job/24879823341

@rosshamish
Copy link
Owner

@asilverman please take a look and see if you can verify the fix. Thanks!

@asilverman
Copy link
Author

@rosshamish Im out in vacation, I'll try to take a look at it by May 28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Contribution requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants