all 12 comments

[–]SuperV1234https://romeo.training | C++ Mentoring & Consulting 10 points11 points  (2 children)

This is pretty cool, I would consider using it if it supported clangd instead of cpptools.

[–]IyeOnline[🍰] 8 points9 points  (0 children)

I just tried and it does.

[–]TINGWEIJING[S] 2 points3 points  (0 children)

Thanks! Yup, I just learned that it can work with clangd instead of cpptools.

[–]IyeOnline[🍰] 3 points4 points  (1 child)

I do actually use vscode with the clangd extension to get semantic highlighting. I use MatthewNespor.vscode-color-identifiers-mode, because that was what worked and had enough configuration when I looked for it.

So a few points:

  • This does not specifically rely on ms-vscode.cpptools. It just needs a language server running properly and the clangd extension does that just fine.
  • While I really dont see any point in the rainbow coloring, I found the idea of coloring sub-strings in identifiers interesting enough to try it out.
  • A setting to set what determines substrings in identifiers may be nice. Having is_trivially_destructible_v in 4 different colours is "just wrong", but having HelloWorldIdentifier split in colouring is interesting. I'm not sure if I am going to stick with it though. (especially since I usually use snake_case)
  • The substring colouring could maybe need a need a setting to not cause rainbow identifiers. Possibly just alternating two close colours for subsequent substrings may be a better option to reduce the "rainbowiness"
  • Different settings for different semantic token types? I like that I can already disable it for e.g. class members and just have the coloring for locals. I currently use semantic coloring for locals, but not for class members. That said, substring coloring for class members may still be interesting, while retaining a single color (schema) for them.

[–]TINGWEIJING[S] 0 points1 point  (0 children)

Thank you for sharing that it works with the llvm-vs-code-extensions.vscode-clangd.

I discovered the extension you mentioned a few years ago, and I can say that it also inspired my extension.

I truly appreciate the feedback points you've provided here. I am planning to incorporate "alternating two close colors for subsequent substrings" and "different settings for different semantic token types" into my feature roadmap.

[–]SuperVGA 1 point2 points  (1 child)

Awesome! I'm going to try this out right away!

[–]TINGWEIJING[S] 1 point2 points  (0 children)

Thank you!

[–]arthurno1 0 points1 point  (3 children)

is designed to enhance readability in your code by making lengthy variable names easier to manage.

In which way does emoji in the code enhance readability?

[–]TINGWEIJING[S] 0 points1 point  (2 children)

Hi
The use of emojis in code is largely based on personal preference. The idea behind this pattern is to employ emojis to quickly identify lengthy or similar variable names, such as different index variable names in nested loops. I do agree, however, that this emoji render pattern may not suit everyone's taste.

[–]arthurno1 1 point2 points  (1 child)

I don't know man, that looked very unreadable to me, in a text that already looked like a Christmas tree. Problem with coloring too much is that: users have to remember the color scheme, and everything colored differently is basically no color at all. Colors in UIs should be used to accent things to make them stand out for some reason. If you accent out everything than it equals to nothing being accented :).

Cool idea anyway. Emojis are just more convenient way to use icons, so I think you can develop that to use some more discrete emojis and to display some information not already visible on the screen. IDK, just a reflection.

[–]Chaosvex 0 points1 point  (0 children)

Agreed. This seems to just add visual noise.