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

Add refresh support for documentColor #7515

Open
etvorun opened this issue Sep 5, 2024 · 1 comment
Open

Add refresh support for documentColor #7515

etvorun opened this issue Sep 5, 2024 · 1 comment

Comments

@etvorun
Copy link
Contributor

etvorun commented Sep 5, 2024

Implementing color swatch support for XAML in VS Code runs into some limitations. VS Code does not seem to support streaming progress for the documentColor request.

  • Colors in XAML documents are based on syntax (i.e. #AARRGGBB) as well as semantic information (e.g. {StaticResource MyColor}).
  • The second issue is quite a big problem for us since there is no refresh support in the LSP spec for when color information needs to be refreshed (for when the semantic information becomes available or when the MyColor value in a different document gets updated for example).

Similar to recently added refresh support for folding ranges in the proposed 3.18 spec we would like to add refresh support for document colors. The support needs to take into consideration following scenarios:

  • VS Code startup scenario. Refreshing active XAML document after LSP server gets fully initialized and XAML file is associated with a project (as opposite to being a loose XAML file). For example, if MainPage.xaml is active document when starting VS Code then it takes few seconds for LSP to recognize that it is part of MyApp.csproj and initialize Microsoft.CodeAnalysis.Compilation. In this case we need to refresh active document.
  • Editing ResourceDictionaries. Editing color values in App.xaml or Colors.xaml - (e.g. <Color x:Key='MyColor'>#123455</Color>) will affect color swatches in MainPage.xaml (e.g. <Button BackgroundColor='{StaticResource MyColor}'/>). In this case we need to refresh all but current document. More specifically, we want to avoid refreshing current document because it already gets refreshed as user types
@dibarbet
Copy link
Member

dibarbet commented Sep 5, 2024

blocked pending microsoft/vscode#227697

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

No branches or pull requests

2 participants