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

Allow 'Developer: Generate Color Theme From Current Settings' > 'workbench.action.generateColorTheme' from within extensions #168190

Closed
jeremymwells opened this issue Dec 6, 2022 · 5 comments
Assignees

Comments

@jeremymwells
Copy link

Extension authoring doesn't expose many texteditor display behaviors (ie rows vs columns and so on).

In order to implement custom text editor-like interactions, authors must implement behaviors in a webview panel, and to preserve the feeling of an in-app editor experience, its reasonable to use an instance of the monaco editor.

Look and feel become an issue, as there is no way to ensure seamless style without painstakingly enumerating all the --vscode-* css vars and translating those styles through to the embedded monaco editor within the web-panel.

A user can run the Developer: Generate Color Theme From Current Settings command, which spits out all the requisite styles needed; however, when running that command from within the context of an extension, programmatically, the result is null/undefined.

If this command worked, those styles could be translated more easily.

@aeschli
Copy link
Contributor

aeschli commented Dec 7, 2022

The Developer: Generate Color Theme From Current Settings command is intended for theme authors. Using it programmatically to enumerate all workspace colors is a workaround for a problem that should be solved properly.
Maybe an vscode.d.ts API to query all color identifiers?

@mjbvz Is this a known problem?

@aeschli
Copy link
Contributor

aeschli commented Dec 9, 2022

Closing as we have no plans to change the Developer: Generate Color Theme From Current Settings command to be used programmatically

@aeschli aeschli closed this as completed Dec 9, 2022
@jeremymwells
Copy link
Author

What of the color API you mention? Is that on roadmap, or is there anything like it that will allow extension authors to get active colors from the editor and recreate them in an embedded monaco editor?

@aeschli
Copy link
Contributor

aeschli commented Dec 12, 2022

I don't know what's the recommended way to embed a Monaco editor in a web view (or whether this is a good idea at all). Maybe @mjbvz or can give some insights.
If enumerating all colors is a needed part of it, we can investigate into a new API like getThemeColors(). We don't have such an API yet (and also no request for it), wo we would need an issue for it.

@jeremymwells
Copy link
Author

That's what my feature request is asking for. I assumed since the 'generate color theme` command was already available, making it available programmatically would be the lowest hanging fruit, but ultimately, I'd like to be able to ask vscode what its current theme is, or more specifically, what the texteditor colors are.

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

No branches or pull requests

4 participants