-
Notifications
You must be signed in to change notification settings - Fork 153
Implement naming conventions in C and C++ grammars #351
base: master
Are you sure you want to change the base?
Conversation
Preview of the changes in C++ with Atom's default syntax themes:
Code snippet: using namespace hillvalley;
#include <plutonium>
// We don't need roads
class DeLorean: public Car {
private:
int speed;
public:
std::string plate;
template<typename T>
void drive(T mph, ...) {
this->speed = mph;
}
};
struct Travel {
int year, month, day;
};
int main() {
auto gigawatts = 1.21;
double *power = nullptr;
power = &gigawatts;
if (*power >= 1.21) {
say("Great", "Scott");
}
static_cast<int>(*power);
DeLorean car;
car.plate = "OUTATIME";
car.drive(88);
auto add = [](int i = 0) {
return ++i;
};
Travel to {1955, 11, 5};
const char *purple[2] = {
"Calvin", "Klein"
};
} |
I'm really glad to see some standardization, textmate scopes are an absolute mess (everywhere not just atom). I've been wanting them standardized for years. would you want to help create a standard guide for Atom Textmate scopes for anyone creating a grammar? It would probably be helpful for theme makers updating their themes as well. |
Also, Are the screenshots here including the other PR (the changes to the default themes)? |
Yeah standardization is really needed to resolve ambiguities and missing scopes. Creating grammars and themes should be easy. You can check out this PR for a guide on scope conventions. It's still a work in progress but pretty stable now. The template is also a good starting point for creating/updating themes. Regarding the screenshots, on the right are previews with all the PRs. On the left is the current state of Atom. |
Haven't looked at the whole thing yet but,
These are wonderful, exactly the same kind of changes I've been wanting to make. I'm looking forward to taking a deeper look into your proposed changes like having variable underneath entity. |
8b76da9
to
8276711
Compare
fb157a9
to
a9b1794
Compare
Description of the Change
This is a rewrite of the Tree-sitter grammar to implement naming conventions for syntax scopes.
Benefits
Possible Drawbacks
Some new scopes to be added to themes. The changes aim to facilitate theme development, filling the template is enough to ensure coherent highlighting across languages, instead of painfully creating styling rules for every language separately.
Applicable Issues
Related Pull Requests