Sublime Forum

Syntax for own escaped syntax

#1

I have some code that has c style \ escaped strings containing code of the same syntax.
At the moment they are just highlighted as normal strings.
Is it possible to change the sublime-syntax to apply the same syntax to triple quoted strings, accounting for the \ characters?

Example apply scopes to the string:

string codeInString = """
string normalString = \"value\";
""";

To look like:

string normalString = "value";

It would be nicer not to have to duplicate the sublime-syntax to do it.

0 Likes

#2

It would be nicer not to have to duplicate the sublime-syntax to do it.

I’d suggest duplicating the syntax instead of overriding a built-in syntax, as updates will override any changes you’ve made.

0 Likes

#3

It is not a built in syntax. It is a custom syntax

0 Likes

#4

The same is true for syntaxes installed through package control. You’ll need to duplicate the syntax definition and make the changes you want there. There’s the OverrideAudit package which can help with this.

0 Likes