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

Consider adopting a new Groovy grammar #175329

Closed
varnk opened this issue Feb 24, 2023 · 9 comments
Closed

Consider adopting a new Groovy grammar #175329

varnk opened this issue Feb 24, 2023 · 9 comments
Assignees
Labels
feature-request Request for new features or functionality grammar Syntax highlighting grammar
Milestone

Comments

@varnk
Copy link

varnk commented Feb 24, 2023

Type: Bug

If I have Groovy script that has a slashy string that contains backslashes, the code editor colorizes the backslashes as escaped characters. I am assuming that this is because slashy strings are being assumed to be regex expressions? However, I am using slashy strings for windows filenames, which use backslashes and it gets a little confusing when the editor shows the character following a backslash in a different color, which I am assuming it thinks is an as an escaped character.

VS Code version: Code 1.75.1 (441438a, 2023-02-08T21:32:34.589Z)
OS version: Windows_NT x64 10.0.19045
Modes:
Sandboxed: Yes

System Info
Item Value
CPUs Intel(R) Core(TM) i7-10850H CPU @ 2.70GHz (2 x 2712)
GPU Status 2d_canvas: unavailable_software
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: disabled_software
multiple_raster_threads: disabled_off
opengl: disabled_off
rasterization: disabled_software
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: disabled_software
video_encode: disabled_software
vulkan: disabled_off
webgl: unavailable_software
webgl2: unavailable_software
webgpu: disabled_off
Load (avg) undefined
Memory (System) 6.06GB (1.21GB free)
Process Argv --crash-reporter-id e98ffc5f-fa12-4a99-b5c3-44bae2bcdf58
Screen Reader no
VM 100%
Extensions (58)
Extension Author (truncated) Version
Bookmarks ale 13.3.1
doxdocgen csc 1.4.0
arm dan 1.7.4
xslt-xpath del 1.5.7
githistory don 0.6.19
groovy-guru Don 0.6.0
jenkins-extension-pack Don 0.1.1
xml Dot 2.5.1
vscode-html-css ecm 1.13.1
git-extensions-for-vs-code for 1.1.3
jenkinsfile-support ivo 1.1.0
jenkins-pipeline-linter-connector jan 1.2.0
plantuml jeb 2.17.5
better-cpp-syntax jef 1.17.2
vscode-ext-import-export jos 0.0.9
git-lfs-file-locking kin 0.0.3
jenkins-doc Maa 1.7.0
git-graph mhu 1.30.0
vscode-dotnet-runtime ms- 1.6.0
isort ms- 2022.8.0
python ms- 2023.2.0
vscode-pylance ms- 2023.2.40
jupyter ms- 2023.1.2010391206
jupyter-keymap ms- 1.0.0
jupyter-renderers ms- 1.0.14
vscode-jupyter-cell-tags ms- 0.1.6
vscode-jupyter-slideshow ms- 0.1.5
remote-containers ms- 0.275.1
remote-ssh ms- 0.96.0
remote-ssh-edit ms- 0.84.0
remote-wsl ms- 0.75.3
cmake-tools ms- 1.13.45
cpptools ms- 1.14.3
cpptools-extension-pack ms- 1.3.0
hexeditor ms- 1.9.11
makefile-tools ms- 0.6.0
powershell ms- 2023.2.1
remote-explorer ms- 0.2.0
vs-keybindings ms- 0.2.1
vsliveshare ms- 1.0.5832
stash-tabs paz 0.0.9
java red 1.15.0
vscode-yaml red 1.11.0
vscode-xml-complete rog 0.3.0
online-help sal 0.2.8
vscode-hexdump sle 1.8.1
code-spell-checker str 2.17.1
jenkins-jack tab 1.2.1
cmake twx 0.0.17
vscode-counter uct 3.2.0
intellicode-api-usage-examples Vis 0.2.7
vscodeintellicode Vis 1.2.30
vscode-java-debug vsc 0.48.0
vscode-java-dependency vsc 0.21.1
vscode-java-pack vsc 0.25.7
vscode-java-test vsc 0.37.1
vscode-maven vsc 0.40.4
gitblame wad 10.1.0

(1 theme extensions excluded)

A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492cf:30256860
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593cf:30376535
pythonvs932:30410667
cppdebug:30492333
vsclangdc:30486549
c4g48928:30535728
dsvsc012:30540252
azure-dev_surveyone:30548225
pyindex848:30662994
nodejswelcome1:30587005
3biah626:30602489
pyind779:30671433
89544117:30613380
pythonsymbol12:30671437
vsctsb:30662444
pythonb192cf:30669361

@varnk varnk changed the title Jenkins pipeline script colorzation issue on slashy strings Jenkins/Groovy pipeline script colorization issue on slashy strings Feb 24, 2023
@gjsjohnmurray
Copy link
Contributor

Which language is being used for these files? If it is contributed by an extension I suggest you log the issue with the extension authors.

@varnk
Copy link
Author

varnk commented Feb 24, 2023

I'm actually not sure if/which extension is coming into play. I think VS Code automatically downloaded a Groovy syntax processing extension. I tried to run with all extensions disabled and had the same issue, which seems odd because I would think there would be no syntax highlighting at that point, but there still was.

@gjsjohnmurray
Copy link
Contributor

What does the Language Mode panel on the left end of your status bar show?

@varnk
Copy link
Author

varnk commented Feb 24, 2023

What does the Language Mode panel on the left end of your status bar show?

It shows "Groovy"

@alexr00
Copy link
Member

alexr00 commented Mar 6, 2023

@varnk can you share a code snippet to repro the issue with and a screenshot of the bad behavior you're seeing?

@alexr00 alexr00 added the info-needed Issue requires more information from poster label Mar 6, 2023
@varnk
Copy link
Author

varnk commented Mar 6, 2023

@varnk can you share a code snippet to repro the issue with and a screenshot of the bad behavior you're seeing?

Requested screen capture attached of a sample Jenkinsfile. I placed yellow arrows in the captured image to point out that the Language Mode is set to Groovy and also to point out the slashy string where the backslashes are showing as an escaped character color (in yellow). I am wondering if VS Code is assuming the string is a regex no matter the content.
Snap1

@alexr00
Copy link
Member

alexr00 commented Mar 7, 2023

Thanks @varnk. This is the upstream issue textmate/groovy.tmbundle#15.

https://github.com/textmate/groovy.tmbundle hasn't been updated in a long time. I'll repurpose this issue for finding a new groovy grammar.

@alexr00 alexr00 changed the title Jenkins/Groovy pipeline script colorization issue on slashy strings Consider adopting a new Groovy grammar Mar 7, 2023
@alexr00 alexr00 added feature-request Request for new features or functionality grammar Syntax highlighting grammar and removed info-needed Issue requires more information from poster labels Mar 7, 2023
@alexr00 alexr00 added this to the Backlog milestone Mar 7, 2023
@alexr00
Copy link
Member

alexr00 commented Mar 7, 2023

https://github.com/marlon407/code-groovy might be a good candidate.

@alexr00
Copy link
Member

alexr00 commented Mar 7, 2023

Looks like I was already tracking this in #145097

@alexr00 alexr00 closed this as completed Mar 7, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality grammar Syntax highlighting grammar
Projects
None yet
Development

No branches or pull requests

6 participants
@gjsjohnmurray @varnk @andreamah @alexr00 @vscodenpa and others