-
Notifications
You must be signed in to change notification settings - Fork 149
Tokenize punctuation #107
Tokenize punctuation #107
Conversation
grammars/c.cson
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
language-javascript uses punctuation.terminator.statement for this.
|
What do you think about the differences between this new matching and the one used by language-javascript/other languages? |
["a", "b", "c" ] // separator
["a", "b", "c",] // delimiter
|
This will unfortunately break standardization with other packages. Might not be that big of a deal though depending on how quickly the others are updated and how many themes are using those. @simurai? I do agree with moving away from |
|
From the core themes only Solarized seems to style Then probably some forks and people's |
|
Only JS, Coffescript, Less tokeize brackets as |
|
Changes in 0d8b634: before: after: Fixes #100 #define ABC XYZ(1)
struct MY_STRUCT {
/* code */
};Fixes #31 #define EOFCHECK() \
if(is.eof()) \
throw std::runtime_error(((std::string) "Setting '") + name + "' not found");
Foo foo(getSomeString() + " (" + otherString + ')');Fixes #75 #define a >b()
int c;
int d;Fixes #80 {
::printf("Error: MongoDB Invalid Query %s!\n", query ? query->toString().c_str() : "{}");
}Fixes #82 int connect (const char *address,
void (*data_recevied)(const char *, const int len)
void (*on_connect)(),
void (*on_disconnect)());Fixes #111 #define LOG1(sev) \
LOG2(sev) << "#" << " smth "
// everything further is highlighted as string literal
int f(void) {
// smth
}
|
grammars/c++.cson
Outdated
| } | ||
| ] | ||
| 'block': | ||
| 'begin': '\\{' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we're improving punctuation, let's remove the unnecessary backslashes on curly brackets as well.
e.g. Solarized styles it
Allows to style all brackets with `.bracket` selector
| 'endCaptures': | ||
| '0': | ||
| 'name': 'punctuation.definition.arguments.end.c' | ||
| 'name': 'meta.arguments.c' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this be better suited as a
contentName? Same for below.
It can be. This allows to style parens inside arguments though:
.meta.arguments {
& > .punctuation.definition {...}
// .variable.argument {...}, etc
}
// instead of
.punctuation.definition.arguments {...}
//.variable.argument {...}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, let's keep it as is then.
grammars/c.cson
Outdated
| 'begin': '\\(' | ||
| 'beginCaptures': | ||
| '0': | ||
| 'name': 'punctuation.definition.arguments.begin.c' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing .bracket.round on these two
|
Regarding We should agree on a common scope for this before continuing. |
|
I think that regression is fine for now. Languages don't have to also be full-blown linters (though it's definitely nice when we can tokenize something as invalid) :P. |
| 'name': 'entity.name.type.cpp' | ||
| 'captures': | ||
| '1': | ||
| 'name': 'keyword.control.namespace.$2' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't fix this in this PR, but this capture is missing a .cpp at the end.
| 'include': '#parens' | ||
| } | ||
| { | ||
| 'match': '\\b(const|override|final)\\b' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just making sure...these three will still be matched by function_params, right?

Fixes #103