Sublime Forum

Add string as storage.type in C++ syntax definition

#1

Is it possible? Because it looks weird when color scheme (material theme for example) can highlight int as purple color but the string is white.

0 Likes

#2

Are you using std::string ? (as opposed to C string ?) Am assuming so as you say C++. Neither are native types (where as int, char are), as i’m sure you know std::string is part of the STLibrary.

Having said all that there probably is away to include it, by changing the language syntax the ST3 uses (after all it recognises uin8_t).

I’ve just grabbed some code I was working on

ColourST

none of the containers are coloured, but I’ve got a lot of colour going on already, I’m not even sure what colour I’ve have them (std::vector, std::unique_ptr, std::string) Would you want extra colour ? (probably not of my colour scheme !)

To be honest a better mind will have to dive in, because I don’t know how to make that change, all I’m doing is offering a suggestion as to why, and not giving you a solution, so totally useless ! :crazy_face:

I’ll have a nose about later, (if no-one else dives in) really got to go and do some work !

ATB

I tried this, but no joy. Maybe you’ll have more success

0 Likes

#3

Unfortunately, I know how to make color scheme, but it is hard to understand the syntax definition ( which can add string as storage.type). So, maybe it will be helpfull add string as storage.type in C++ syntax definition ( also C).

0 Likes

#4

It’s not a primitive type so it doesn’t make sense to assign that scope to that identifier. What if your codebase uses QString from Qt as the basic string type? Or CString from MFC? Or CsString from CopperSpice?

2 Likes

#5

Oh, now I understand why string is not in the syntax definition.

0 Likes