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

An odd empty block in front of every color with css-lsp #4659

Open
3 tasks done
Hi-Angel opened this issue Dec 26, 2024 · 6 comments
Open
3 tasks done

An odd empty block in front of every color with css-lsp #4659

Hi-Angel opened this issue Dec 26, 2024 · 6 comments
Labels

Comments

@Hi-Angel
Copy link
Contributor

Thank you for the bug report

  • I am using the latest version of lsp-mode related packages.
  • I checked FAQ and Troubleshooting sections
  • You may also try reproduce the issue using clean environment using the following command: M-x lsp-start-plain

Bug description

As description says. Best shown with screenshot:

image

This is not a space char, i.e. the part : # is 3 chars long but looks like 4 chars.

Steps to reproduce

  1. Put this text to style.css:

    .my-colors {
        color: gray;
        background-color: #2e3a44;
    }
  2. Turn on M-x lsp

Expected behavior

There should be no "empty offset" in before # character

Which Language Server did you use?

css-ls (aka vscode-css-language-server)

OS

Linux

Error callstack

No response

Anything else?

I'd also appreciate a way to disable that highlight. css-mode highlights colors anyway, so the highlight that's done by the server besides being buggy is also useless.

@Hi-Angel Hi-Angel added the bug label Dec 26, 2024
@Hi-Angel
Copy link
Contributor Author

An interesting fact: if I disable font-lock (to see if there's any conflicts with highlight as done by the mode), the display shows that the "empty space" is in fact some square emoji:

image

@Hi-Angel
Copy link
Contributor Author

Found something on VSCode discussions.

@Hi-Angel
Copy link
Contributor Author

Okay, so, I have a question: I have set (setq lsp-print-io t), but when I enable lsp afterwards, I see no communication with the server in *lsp-log* buffer. Any ideas why?

Other than that, presumably an option css.colorDecorators.enable should control this thing, but so far I got no success making that option do anything at all. That's why I wanted to see communication with the server.

@Hi-Angel
Copy link
Contributor Author

Hi-Angel commented Dec 26, 2024

Okay, so, I have a question: I have set (setq lsp-print-io t), but when I enable lsp afterwards, I see no communication with the server in *lsp-log* buffer. Any ideas why?

Setting lsp-log-io worked, Idk what's up with lsp-print-io


I think I figured out the situation with these color blocks. Previously it was controlled by css.colorDecorators.enable, but nowadays there isn't such an option. It was obsoleted in preference of editor.colorDecorators, but it's not mentioned by the link and I couldn't get it to work. I suspect the option is not the server's one, but instead controls VSCode behavior to make it ignore requests from the server. FTR, it's defined here.

So I think the only solution here is making lsp-mode ignore the messages.

@Hi-Angel
Copy link
Contributor Author

Based on my previous comment, the way to disable it is by ignoring textDocument/documentColor, which in turn is done by setting lsp-enable-text-document-color to nil.

Now, the question is: how do you make lsp-mode ignore this feature for css-ls only?

@Hi-Angel
Copy link
Contributor Author

Summoning @yyoncho as fixing this bug may require some internals knowledge: how to disable textDocument/documentColor only for css-mode, so users would have to opt-in into it? (although I doubt anyone will need it, but anyway…)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant