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

Vscode-like theme #2848

Open
HKalbasi opened this issue Apr 5, 2021 · 7 comments
Open

Vscode-like theme #2848

HKalbasi opened this issue Apr 5, 2021 · 7 comments

Comments

@HKalbasi
Copy link

HKalbasi commented Apr 5, 2021

Motivation
Vscode is a popular editor and it's syntax highlighting theme is familiar for many developers.
Description
A theme that follow vscode colors in syntax highlighting. Something like the one used here https://os.phil-opp.com/freestanding-rust-binary/

Maybe we can reuse theme data from vscode and generate a purism theme from each vscode theme mechanically.

Alternatives
Simply not to have it. It is completely unnecessary.

@joshgoebel
Copy link

Maybe we can reuse theme data from vscode and generate a purism theme from each vscode theme mechanically.

You mean programmatically? Very curious if that could be done. Textmate grammars have a ton of scopes, so you'd have to map those over to the much more limited set that Prism has... an interesting idea for sure.

@RunDevelopment
Copy link
Member

You might want to check out Prism themes. We offer a few additional themes over there.

Maybe we can reuse theme data from vscode and generate a purism theme from each vscode theme mechanically.

VSCode themes are a lot more granular than Prism themes.

An automatic tool would have to create a mapping from Textmate scopes to Prism token types to convert themes. This is going to be very difficult because:

  1. Textmate scopes and Prism token types are not equivalent. Textmate scopes are a lot more granular and offer a lot more information than Prism token types.
  2. Textmate scopes and Prism token types are language-specific. The tool would have to be able to create mappings for a lot of languages.

It's going to take a lot of effort to create and maintain an automatic tool. Frankly, I don't think it's worth it.

@joshgoebel
Copy link

It's going to take a lot of effort to create and maintain an automatic tool.

I don't know about the "maintain" part... aren't TM scopes mostly static these days? If someone covered the top 20-30 scopes and figured our reasonable mappings... :-) I'd personally certainly love to see someone try.

@RunDevelopment
Copy link
Member

I don't know about the "maintain" part... aren't TM scopes mostly static these days?

I suppose they are but the languages themselves also change which may introduce new scopes.

If someone covered the top 20-30 scopes and figured out reasonable mappings.

Maybe that's possible? I looked at a few VSCode themes and apart from basic stuff (e.g. comments, strings), all the scope (selectors?) looked pretty complex to me. A lot of them are also language-specific.

I'd personally certainly love to see someone try.

I'd also love to see someone try (but not me).

But before that, Prism should document its token types. Right now, token types are implementation details. We don't guarantee any specific token type for any language/language construct. I opened an issue for this.

We will probably also need more granular token types (e.g. types for dates, doc comments/strings, character literals).

@joshgoebel
Copy link

See "Naming Conventions" https://macromates.com/manual/en/language_grammars does this no longer hold at all? I thought the whole point of scopes was that they start general and get more precise... so you wouldn't have to worry if something was a comment.line.ruby.doctag if you didn't want to, you could focus just on comment.line.

A lot of them are also language-specific.

Oh? Now if all they are doing is ruby.comment.line.doctag then you could just strip the language and instantly be back to something workable...

I'd also love to see someone try (but not me).

Yeah, not me either, LOL. 😛 Although spending a little time thinking it thru might help with the larger "more granular token types"... I always got the impression a lot of thought has been put into the TextMate scopes...

@HKalbasi
Copy link
Author

HKalbasi commented Apr 6, 2021

You might want to check out Prism themes. We offer a few additional themes over there.

That is what I want. I was looking for VSCode dark+ theme in that link. Maybe those themes should also exists somewhere in the main site.

Seems you found idea of automatic transformation interesting. I would like to help, but I know literally nothing about purism token types and TextMate (even it's name, before this issue). So whenever you come to a conclusion, please close the issue because it is already somehow solved with two vscode default themes in that link.

@RunDevelopment
Copy link
Member

Maybe those themes should also exists somewhere in the main site.

@HKalbasi That's planned.

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

3 participants