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

Color swatch preview is shown even if commented out #2167

Closed
lukepighetti opened this issue Dec 11, 2019 · 6 comments
Closed

Color swatch preview is shown even if commented out #2167

lukepighetti opened this issue Dec 11, 2019 · 6 comments
Labels
in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server is bug
Milestone

Comments

@lukepighetti
Copy link

Screen Shot 2019-12-11 at 8 47 31 AM

@DanTup DanTup added this to the Backlog milestone Dec 11, 2019
@DanTup DanTup added in editor Relates to code editing or language features is bug labels Dec 11, 2019
@DanTup
Copy link
Member

DanTup commented Dec 11, 2019

Yeah, I noticed this too. It's because the colour detection we do is pretty naive and just regex's the file. We don't really know (in the editor) what's a comment and what's not.

I think the best fix for this would be to move this to the server (probably as an LSP custom message once we've moved the editor fully over to LSP).

@DanTup DanTup added the in lsp/analysis server Something to be fixed in the Dart analysis server label Jun 1, 2020
@DanTup
Copy link
Member

DanTup commented Jun 1, 2020

This might not need to be a custom message, as LSP may have support for it already:

https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_documentColor

@DanTup DanTup modified the milestones: Backlog, On Deck Jun 1, 2020
@lukepighetti
Copy link
Author

This is definitely a nit. I wouldn't mind at all if you closed it.

@DanTup
Copy link
Member

DanTup commented Jun 1, 2020

I'll keep this issue open as a reminder that I need to implement this in LSP anyway (and can use the API above), whether or not it ends up with the same quirk :-)

@DanTup
Copy link
Member

DanTup commented Oct 8, 2020

If/when moving this to LSP, we should try to make it pick the Colors class more reliably too (see #2857).

@DanTup DanTup modified the milestones: v3.16.0, v3.17.0 Oct 21, 2020
@DanTup DanTup modified the milestones: v3.17.0, v3.18.0 Nov 30, 2020
@DanTup DanTup modified the milestones: v3.18.0, v3.19.0 Dec 17, 2020
@DanTup DanTup removed this from the v3.19.0 milestone Jan 20, 2021
@DanTup DanTup added this to the On Deck milestone Jan 20, 2021
@DanTup DanTup modified the milestones: On Deck, v3.24.0 May 24, 2021
@DanTup DanTup modified the milestones: v3.24.0, On Deck Jun 21, 2021
@DanTup DanTup modified the milestones: On Deck, v3.25.0 Jun 28, 2021
@DanTup DanTup modified the milestones: v3.25.0, On Deck Jul 19, 2021
@DanTup DanTup modified the milestones: On Deck, v3.29.0 Nov 2, 2021
@DanTup
Copy link
Member

DanTup commented Nov 16, 2021

The built-in color picker is now supported via the LSP server. It's a change in the SDK so will show up in a future SDK release rather than Dart-Code release. When the SDK you're using supports this, the legacy color previews will be disabled, so this problem will go away (since the server-generated are more reliable and not using regex).

dart-lang/sdk@3238b2c

@DanTup DanTup closed this as completed Nov 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server is bug
Projects
None yet
Development

No branches or pull requests

2 participants