Merge pull request #56 from rdnlsmith/escape_highlight
Escape highlighting
This commit is contained in:
1
language-examples/csharp.cs
Normal file
1
language-examples/csharp.cs
Normal file
@@ -0,0 +1 @@
|
|||||||
|
String stringEscapes = "a\nb";
|
||||||
21
language-examples/html.html
Normal file
21
language-examples/html.html
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Page title</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>First-level header</h1>
|
||||||
|
|
||||||
|
<h2>Second-level header</h2>
|
||||||
|
<ul>
|
||||||
|
<li>list</li>
|
||||||
|
<li>of</li>
|
||||||
|
<li>bullets</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h2>Another second-level header</h2>
|
||||||
|
<p>
|
||||||
|
This paragraph contains an escape—namely, the em dash.
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
1
language-examples/java.java
Normal file
1
language-examples/java.java
Normal file
@@ -0,0 +1 @@
|
|||||||
|
String stringEscapes = "a\nb";
|
||||||
@@ -6,6 +6,7 @@ function func(param) {
|
|||||||
}
|
}
|
||||||
var number = 0;
|
var number = 0;
|
||||||
var templateLiterals = `a ${text} b ${1 + 2} c`;
|
var templateLiterals = `a ${text} b ${1 + 2} c`;
|
||||||
|
var escapes = 'line 1\nline 2';
|
||||||
return {
|
return {
|
||||||
"text": text,
|
"text": text,
|
||||||
"boolean": false,
|
"boolean": false,
|
||||||
|
|||||||
1
language-examples/markdown.md
Normal file
1
language-examples/markdown.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
String escapes
|
||||||
@@ -6,6 +6,7 @@ function func(param: string): object {
|
|||||||
}
|
}
|
||||||
var number = 0;
|
var number = 0;
|
||||||
var templateLiterals = `a ${text} b ${1 + 2} c`;
|
var templateLiterals = `a ${text} b ${1 + 2} c`;
|
||||||
|
var escapes = 'line 1\nline 2';
|
||||||
return {
|
return {
|
||||||
"text": text,
|
"text": text,
|
||||||
"boolean": false,
|
"boolean": false,
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ export function generateFallbackColorSet(s: IBaseColorSet, type: 'light' | 'dark
|
|||||||
number: s.color4,
|
number: s.color4,
|
||||||
storage: s.color1,
|
storage: s.color1,
|
||||||
string: s.color2,
|
string: s.color2,
|
||||||
|
stringEscape: (type === 'light' ? darken : lighten)(s.color2, 0.5),
|
||||||
comment: (type === 'light' ? darken : lighten)(s.background, 2.0),
|
comment: (type === 'light' ? darken : lighten)(s.background, 2.0),
|
||||||
class: s.color3,
|
class: s.color3,
|
||||||
classMember: s.color3,
|
classMember: s.color3,
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ export interface IColorSet {
|
|||||||
number?: string;
|
number?: string;
|
||||||
storage?: string;
|
storage?: string;
|
||||||
string?: string;
|
string?: string;
|
||||||
|
stringEscape?: string;
|
||||||
comment?: string;
|
comment?: string;
|
||||||
class?: string;
|
class?: string;
|
||||||
classMember?: string;
|
classMember?: string;
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ export const tokenRules: IRuleGenerator[] = [
|
|||||||
// string: It's important that string is put first so that other scopes can override strings
|
// string: It's important that string is put first so that other scopes can override strings
|
||||||
// within template expressions
|
// within template expressions
|
||||||
{ color: s => s.syntax.string, generate: getSimpleColorGenerator('String', 'string') },
|
{ color: s => s.syntax.string, generate: getSimpleColorGenerator('String', 'string') },
|
||||||
|
{ color: s => s.syntax.stringEscape, generate: getSimpleColorGenerator('String Escape', 'constant.character.escape, text.html constant.character.entity.named, punctuation.definition.entity.html') },
|
||||||
{ color: s => s.syntax.boolean, generate: getSimpleColorGenerator('Boolean', 'constant.language.boolean') },
|
{ color: s => s.syntax.boolean, generate: getSimpleColorGenerator('Boolean', 'constant.language.boolean') },
|
||||||
{ color: s => s.syntax.number, generate: getSimpleColorGenerator('Number', 'constant.numeric') },
|
{ color: s => s.syntax.number, generate: getSimpleColorGenerator('Number', 'constant.numeric') },
|
||||||
{ color: s => s.syntax.identifier, generate: getSimpleColorGenerator('Identifier', 'variable, support.variable, support.class, support.constant, meta.definition.variable entity.name.function') },
|
{ color: s => s.syntax.identifier, generate: getSimpleColorGenerator('Identifier', 'variable, support.variable, support.class, support.constant, meta.definition.variable entity.name.function') },
|
||||||
|
|||||||
Reference in New Issue
Block a user