Skip to content
This repository has been archived by the owner on Nov 4, 2023. It is now read-only.

Interaction with native feature #486

Merged
merged 2 commits into from
Mar 24, 2022

Conversation

hediet
Copy link
Contributor

@hediet hediet commented Feb 7, 2022

As a follow up to #485, this PR improves interaction with the native bracket pair colorization feature:

  • Adds a button to the deprecation notification to enable the native feature. This automatically uninstalls the extension.
    • This makes it easier for users to migrate to the native feature
  • Disables colorization by this extension if native colorization is enabled.
    • To reduce CPU power consumption, if both this extension is installed and native colorization is enabled, this extension should do nothing but to prompt that it is deprecated.

What do you think of this feature?

…feature.

* Disables colorization by this extension if native colorization is enabled.
@CoenraadS CoenraadS merged commit 7c305dc into CoenraadS:master Mar 24, 2022
@CoenraadS
Copy link
Owner

CoenraadS commented Mar 25, 2022

@hediet

I want to add the default color/opacity to migration settings

 workspace
  .getConfiguration()
  .update(
      "editor.guides.colorCustomizations",
      {
          // Bracket colors
          "editorBracketHighlight.foreground1": "#FFD700",
          "editorBracketHighlight.foreground2": "#DA70D6",
          "editorBracketHighlight.foreground3": "#179fff",
          // Inactive guide colors
          "editorBracketPairGuide.background1": "#ffd90080",
          "editorBracketPairGuide.background2": "#CC66CC80",
          "editorBracketPairGuide.background3": "#87CEFA80",
          // Active guide colors
          "editorBracketPairGuide.activeBackground1": "#ffd90080",
          "editorBracketPairGuide.activeBackground2": "#CC66CC80",
          "editorBracketPairGuide.activeBackground3": "#87CEFA80",
      },
      ConfigurationTarget.Global
  );

But doing it like this didn't seem to work, do you know how I can do it? (Nothing was written to settings)

@hediet
Copy link
Contributor Author

hediet commented Mar 25, 2022

This works for me (note the key workbench.colorCustomizations):

await vscode.workspace
				.getConfiguration()
				.update(
					"workbench.colorCustomizations",
					{
						// Bracket colors
						"editorBracketHighlight.foreground1": "#FFD700",
						"editorBracketHighlight.foreground2": "#DA70D6",
						"editorBracketHighlight.foreground3": "#179fff",
						// Inactive guide colors
						"editorBracketPairGuide.background1": "#ffd90080",
						"editorBracketPairGuide.background2": "#CC66CC80",
						"editorBracketPairGuide.background3": "#87CEFA80",
						// Active guide colors
						"editorBracketPairGuide.activeBackground1": "#ffd90080",
						"editorBracketPairGuide.activeBackground2": "#CC66CC80",
						"editorBracketPairGuide.activeBackground3": "#87CEFA80",
					},
					vscode.ConfigurationTarget.Global
				);

@CoenraadS
Copy link
Owner

Feel silly for overlooking that, thanks for your patience

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 this pull request may close these issues.

2 participants