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

Large wavy underline after update #3809

Closed
gbatagian opened this issue Nov 19, 2024 · 7 comments · Fixed by #3817
Closed

Large wavy underline after update #3809

gbatagian opened this issue Nov 19, 2024 · 7 comments · Fixed by #3817

Comments

@gbatagian
Copy link

Hello vscode-spell-checker,

Congrats on your amazing extension!

I have an issue after updating to the latest version, the wavy underline highlighting for spelling mistakes has become significantly larger than before.
It’s a bit more distracting than the previous style, which had a more subtle, less intrusive wave.

E.g. now:

Screenshot from 2024-11-19 13-44-36

Previous style example:

Screenshot from 2024-11-19 13-51-51

Is there a way to revert to the previous, smaller wave style?

I’m using:

Code Spell Checker Version: 4.0.19
System: Ubuntu 24.04.1 LTS

Thanks for your time, and keep up with the good work!

@Jason3S
Copy link
Collaborator

Jason3S commented Nov 19, 2024

I guess it varies from OS to OS:
image

Please try changing cSpell.textDecorationThickness. The default is auto, maybe from-font is better.

image

If you find a good value, please let me know.

@gbatagian
Copy link
Author

Thank you for pointing me to the Appearance settings of the extension - I wasn't aware of these options.
While cSpell.textDecorationThickness did not resolve the larger waves issue with any value that I tried, I found an affective workaround through the cSpell.textDecorationStyle parameter.
By setting it to:

"cSpell.textDecorationStyle": "dotted",

the highlighting is much less distracting for my environment. I appreciate the help!

Screenshot from 2024-11-19 16-44-43

Screenshot from 2024-11-19 16-45-22

@geekley
Copy link

geekley commented Nov 19, 2024

Interesting. I have the same issue on Kubuntu (Codium snap). Thickness really controls only the stroke thickness, not the wave amplitude.

Using the dev tools inspector to understand why it's different, turns out VSCode diagnostics squiggles are not done via wavy underline CSS decorations, but through a background SVG image CSS (presumably a dynamically generated one).

To see it, you have to inspect the line with e.g. a warning squiggle. But instead of looking at div.view-lines, go to the equivalent line in div.view-overlays. In there, I see a div class="squiggly-warning", with this CSS:

.monaco-editor .squiggly-warning {
  background: url(data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%206%203'%20enable-background%3D'new%200%200%206%203'%20height%3D'3'%20width%3D'6'%3E%3Cg%20fill%3D'%23cca700'%3E%3Cpolygon%20points%3D'5.5%2C0%202.5%2C3%201.1%2C3%204.1%2C0'%2F%3E%3Cpolygon%20points%3D'4%2C0%206%2C2%206%2C0.6%205.4%2C0'%2F%3E%3Cpolygon%20points%3D'0%2C2%201%2C3%202.4%2C3%200%2C0.6'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E
    ) repeat-x bottom left;
}

The data URL SVG is a yellow ~ image (on my machine). So I guess VSCode dynamically generates a ~ image using the color theme and font size, and sets it as a repeated background image so it shows like ~~~~~~.

Sadly, that means an extension is probably unable to replicate this (I don't think it can set a CSS class to decorations?), unless there's some workaround involving font-size maybe?

I think it would be best to just set the default value to either dotted or dashed, to avoid this issue.

@geekley
Copy link

geekley commented Nov 19, 2024

It might be valid to also report this upstream as a VSCode bug. The fact they used this SVG solution could mean they had to use a workaround (Ubuntu-specific?) for this exact issue. If so, maybe they should apply such workaround to extension decorations as well?

@Jason3S
Copy link
Collaborator

Jason3S commented Nov 19, 2024

@geekley,

It is probably an issue they saw with Electron rendering and they went with the .svg approach because it was more predictable.

It is possible to go back to the old behavior by setting cSpell.useCustomDecorations to false.

@Jason3S
Copy link
Collaborator

Jason3S commented Nov 19, 2024

I might set the default of cSpell.useCustomDecorations to false. Since this issue has created a bunch of issues.

@Jason3S Jason3S linked a pull request Nov 19, 2024 that will close this issue
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants