mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
Adopt vscode-textmate@6.0.0
This commit is contained in:
parent
67591b250b
commit
704ff15396
|
@ -83,7 +83,7 @@
|
||||||
"vscode-proxy-agent": "^0.11.0",
|
"vscode-proxy-agent": "^0.11.0",
|
||||||
"vscode-regexpp": "^3.1.0",
|
"vscode-regexpp": "^3.1.0",
|
||||||
"vscode-ripgrep": "^1.12.1",
|
"vscode-ripgrep": "^1.12.1",
|
||||||
"vscode-textmate": "5.5.0",
|
"vscode-textmate": "6.0.0",
|
||||||
"xterm": "4.16.0-beta.5",
|
"xterm": "4.16.0-beta.5",
|
||||||
"xterm-addon-search": "0.9.0-beta.6",
|
"xterm-addon-search": "0.9.0-beta.6",
|
||||||
"xterm-addon-serialize": "0.7.0-beta.3",
|
"xterm-addon-serialize": "0.7.0-beta.3",
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
"vscode-proxy-agent": "^0.11.0",
|
"vscode-proxy-agent": "^0.11.0",
|
||||||
"vscode-regexpp": "^3.1.0",
|
"vscode-regexpp": "^3.1.0",
|
||||||
"vscode-ripgrep": "^1.12.1",
|
"vscode-ripgrep": "^1.12.1",
|
||||||
"vscode-textmate": "5.5.0",
|
"vscode-textmate": "6.0.0",
|
||||||
"xterm": "4.16.0-beta.5",
|
"xterm": "4.16.0-beta.5",
|
||||||
"xterm-addon-search": "0.9.0-beta.6",
|
"xterm-addon-search": "0.9.0-beta.6",
|
||||||
"xterm-addon-serialize": "0.7.0-beta.3",
|
"xterm-addon-serialize": "0.7.0-beta.3",
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
"jschardet": "3.0.0",
|
"jschardet": "3.0.0",
|
||||||
"tas-client-umd": "0.1.4",
|
"tas-client-umd": "0.1.4",
|
||||||
"vscode-oniguruma": "1.6.1",
|
"vscode-oniguruma": "1.6.1",
|
||||||
"vscode-textmate": "5.5.0",
|
"vscode-textmate": "6.0.0",
|
||||||
"xterm": "4.16.0-beta.5",
|
"xterm": "4.16.0-beta.5",
|
||||||
"xterm-addon-search": "0.9.0-beta.6",
|
"xterm-addon-search": "0.9.0-beta.6",
|
||||||
"xterm-addon-unicode11": "0.4.0-beta.1",
|
"xterm-addon-unicode11": "0.4.0-beta.1",
|
||||||
|
|
|
@ -108,10 +108,10 @@ vscode-oniguruma@1.6.1:
|
||||||
resolved "https://registry.yarnpkg.com/vscode-oniguruma/-/vscode-oniguruma-1.6.1.tgz#2bf4dfcfe3dd2e56eb549a3068c8ee39e6c30ce5"
|
resolved "https://registry.yarnpkg.com/vscode-oniguruma/-/vscode-oniguruma-1.6.1.tgz#2bf4dfcfe3dd2e56eb549a3068c8ee39e6c30ce5"
|
||||||
integrity sha512-vc4WhSIaVpgJ0jJIejjYxPvURJavX6QG41vu0mGhqywMkQqulezEqEQ3cO3gc8GvcOpX6ycmKGqRoROEMBNXTQ==
|
integrity sha512-vc4WhSIaVpgJ0jJIejjYxPvURJavX6QG41vu0mGhqywMkQqulezEqEQ3cO3gc8GvcOpX6ycmKGqRoROEMBNXTQ==
|
||||||
|
|
||||||
vscode-textmate@5.5.0:
|
vscode-textmate@6.0.0:
|
||||||
version "5.5.0"
|
version "6.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-5.5.0.tgz#d83776562c07d1e3181c2c7f1b3d5f20afcab483"
|
resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-6.0.0.tgz#a3777197235036814ac9a92451492f2748589210"
|
||||||
integrity sha512-jToQkPGMNKn0eyKyitYeINJF0NoD240aYyKPIWJv5W2jfPt++jIRg0OSergubtGhbw6SoefkvBYEpX7TsfoSUQ==
|
integrity sha512-gu73tuZfJgu+mvCSy4UZwd2JXykjK9zAZsfmDeut5dx/1a7FeTk0XwJsSuqQn+cuMCGVbIBfl+s53X4T19DnzQ==
|
||||||
|
|
||||||
xterm-addon-search@0.9.0-beta.6:
|
xterm-addon-search@0.9.0-beta.6:
|
||||||
version "0.9.0-beta.6"
|
version "0.9.0-beta.6"
|
||||||
|
|
|
@ -555,10 +555,10 @@ vscode-ripgrep@^1.12.1:
|
||||||
https-proxy-agent "^4.0.0"
|
https-proxy-agent "^4.0.0"
|
||||||
proxy-from-env "^1.1.0"
|
proxy-from-env "^1.1.0"
|
||||||
|
|
||||||
vscode-textmate@5.5.0:
|
vscode-textmate@6.0.0:
|
||||||
version "5.5.0"
|
version "6.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-5.5.0.tgz#d83776562c07d1e3181c2c7f1b3d5f20afcab483"
|
resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-6.0.0.tgz#a3777197235036814ac9a92451492f2748589210"
|
||||||
integrity sha512-jToQkPGMNKn0eyKyitYeINJF0NoD240aYyKPIWJv5W2jfPt++jIRg0OSergubtGhbw6SoefkvBYEpX7TsfoSUQ==
|
integrity sha512-gu73tuZfJgu+mvCSy4UZwd2JXykjK9zAZsfmDeut5dx/1a7FeTk0XwJsSuqQn+cuMCGVbIBfl+s53X4T19DnzQ==
|
||||||
|
|
||||||
vscode-windows-ca-certs@^0.3.0:
|
vscode-windows-ca-certs@^0.3.0:
|
||||||
version "0.3.0"
|
version "0.3.0"
|
||||||
|
|
|
@ -38,7 +38,8 @@ export const enum FontStyle {
|
||||||
None = 0,
|
None = 0,
|
||||||
Italic = 1,
|
Italic = 1,
|
||||||
Bold = 2,
|
Bold = 2,
|
||||||
Underline = 4
|
Underline = 4,
|
||||||
|
Strikethrough = 8,
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -52,14 +53,14 @@ export const enum ColorId {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A standard token type. Values are 2^x such that a bit mask can be used.
|
* A standard token type.
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
export const enum StandardTokenType {
|
export const enum StandardTokenType {
|
||||||
Other = 0,
|
Other = 0,
|
||||||
Comment = 1,
|
Comment = 1,
|
||||||
String = 2,
|
String = 2,
|
||||||
RegEx = 4
|
RegEx = 3
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -74,11 +75,11 @@ export const enum StandardTokenType {
|
||||||
* 1098 7654 3210 9876 5432 1098 7654 3210
|
* 1098 7654 3210 9876 5432 1098 7654 3210
|
||||||
* - -------------------------------------------
|
* - -------------------------------------------
|
||||||
* xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
|
* xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
|
||||||
* bbbb bbbb bfff ffff ffFF FTTT LLLL LLLL
|
* bbbb bbbb bfff ffff ffFF FFTT LLLL LLLL
|
||||||
* - -------------------------------------------
|
* - -------------------------------------------
|
||||||
* - L = LanguageId (8 bits)
|
* - L = LanguageId (8 bits)
|
||||||
* - T = StandardTokenType (3 bits)
|
* - T = StandardTokenType (2 bits)
|
||||||
* - F = FontStyle (3 bits)
|
* - F = FontStyle (4 bits)
|
||||||
* - f = foreground color (9 bits)
|
* - f = foreground color (9 bits)
|
||||||
* - b = background color (9 bits)
|
* - b = background color (9 bits)
|
||||||
*
|
*
|
||||||
|
@ -86,14 +87,15 @@ export const enum StandardTokenType {
|
||||||
*/
|
*/
|
||||||
export const enum MetadataConsts {
|
export const enum MetadataConsts {
|
||||||
LANGUAGEID_MASK = 0b00000000000000000000000011111111,
|
LANGUAGEID_MASK = 0b00000000000000000000000011111111,
|
||||||
TOKEN_TYPE_MASK = 0b00000000000000000000011100000000,
|
TOKEN_TYPE_MASK = 0b00000000000000000000001100000000,
|
||||||
FONT_STYLE_MASK = 0b00000000000000000011100000000000,
|
FONT_STYLE_MASK = 0b00000000000000000011110000000000,
|
||||||
FOREGROUND_MASK = 0b00000000011111111100000000000000,
|
FOREGROUND_MASK = 0b00000000011111111100000000000000,
|
||||||
BACKGROUND_MASK = 0b11111111100000000000000000000000,
|
BACKGROUND_MASK = 0b11111111100000000000000000000000,
|
||||||
|
|
||||||
ITALIC_MASK = 0b00000000000000000000100000000000,
|
ITALIC_MASK = 0b00000000000000000000010000000000,
|
||||||
BOLD_MASK = 0b00000000000000000001000000000000,
|
BOLD_MASK = 0b00000000000000000000100000000000,
|
||||||
UNDERLINE_MASK = 0b00000000000000000010000000000000,
|
UNDERLINE_MASK = 0b00000000000000000001000000000000,
|
||||||
|
STRIKETHROUGH_MASK = 0b00000000000000000010000000000000,
|
||||||
|
|
||||||
SEMANTIC_USE_ITALIC = 0b00000000000000000000000000000001,
|
SEMANTIC_USE_ITALIC = 0b00000000000000000000000000000001,
|
||||||
SEMANTIC_USE_BOLD = 0b00000000000000000000000000000010,
|
SEMANTIC_USE_BOLD = 0b00000000000000000000000000000010,
|
||||||
|
@ -103,7 +105,7 @@ export const enum MetadataConsts {
|
||||||
|
|
||||||
LANGUAGEID_OFFSET = 0,
|
LANGUAGEID_OFFSET = 0,
|
||||||
TOKEN_TYPE_OFFSET = 8,
|
TOKEN_TYPE_OFFSET = 8,
|
||||||
FONT_STYLE_OFFSET = 11,
|
FONT_STYLE_OFFSET = 10,
|
||||||
FOREGROUND_OFFSET = 14,
|
FOREGROUND_OFFSET = 14,
|
||||||
BACKGROUND_OFFSET = 23
|
BACKGROUND_OFFSET = 23
|
||||||
}
|
}
|
||||||
|
|
|
@ -273,7 +273,9 @@ export class StandardAutoClosingPairConditional {
|
||||||
|
|
||||||
readonly open: string;
|
readonly open: string;
|
||||||
readonly close: string;
|
readonly close: string;
|
||||||
private readonly _standardTokenMask: number;
|
private readonly _inString: boolean;
|
||||||
|
private readonly _inComment: boolean;
|
||||||
|
private readonly _inRegEx: boolean;
|
||||||
private _neutralCharacter: string | null = null;
|
private _neutralCharacter: string | null = null;
|
||||||
private _neutralCharacterSearched: boolean = false;
|
private _neutralCharacterSearched: boolean = false;
|
||||||
|
|
||||||
|
@ -282,20 +284,22 @@ export class StandardAutoClosingPairConditional {
|
||||||
this.close = source.close;
|
this.close = source.close;
|
||||||
|
|
||||||
// initially allowed in all tokens
|
// initially allowed in all tokens
|
||||||
this._standardTokenMask = 0;
|
this._inString = true;
|
||||||
|
this._inComment = true;
|
||||||
|
this._inRegEx = true;
|
||||||
|
|
||||||
if (Array.isArray(source.notIn)) {
|
if (Array.isArray(source.notIn)) {
|
||||||
for (let i = 0, len = source.notIn.length; i < len; i++) {
|
for (let i = 0, len = source.notIn.length; i < len; i++) {
|
||||||
const notIn: string = source.notIn[i];
|
const notIn: string = source.notIn[i];
|
||||||
switch (notIn) {
|
switch (notIn) {
|
||||||
case 'string':
|
case 'string':
|
||||||
this._standardTokenMask |= StandardTokenType.String;
|
this._inString = false;
|
||||||
break;
|
break;
|
||||||
case 'comment':
|
case 'comment':
|
||||||
this._standardTokenMask |= StandardTokenType.Comment;
|
this._inComment = false;
|
||||||
break;
|
break;
|
||||||
case 'regex':
|
case 'regex':
|
||||||
this._standardTokenMask |= StandardTokenType.RegEx;
|
this._inRegEx = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -303,7 +307,16 @@ export class StandardAutoClosingPairConditional {
|
||||||
}
|
}
|
||||||
|
|
||||||
public isOK(standardToken: StandardTokenType): boolean {
|
public isOK(standardToken: StandardTokenType): boolean {
|
||||||
return (this._standardTokenMask & <number>standardToken) === 0;
|
switch (standardToken) {
|
||||||
|
case StandardTokenType.Other:
|
||||||
|
return true;
|
||||||
|
case StandardTokenType.Comment:
|
||||||
|
return this._inComment;
|
||||||
|
case StandardTokenType.String:
|
||||||
|
return this._inString;
|
||||||
|
case StandardTokenType.RegEx:
|
||||||
|
return this._inRegEx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public shouldAutoClose(context: ScopedLineTokens, column: number): boolean {
|
public shouldAutoClose(context: ScopedLineTokens, column: number): boolean {
|
||||||
|
|
|
@ -3310,7 +3310,7 @@ export enum StandardTokenType {
|
||||||
Other = 0,
|
Other = 0,
|
||||||
Comment = 1,
|
Comment = 1,
|
||||||
String = 2,
|
String = 2,
|
||||||
RegEx = 4
|
RegEx = 3
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -18,14 +18,8 @@ export interface ITextMateService {
|
||||||
startDebugMode(printFn: (str: string) => void, onStop: () => void): void;
|
startDebugMode(printFn: (str: string) => void, onStop: () => void): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------- Types "liberated" from vscode-textmate due to usage in /common/
|
// -------------- Types copied from vscode-textmate due to usage in /common/
|
||||||
|
|
||||||
export const enum StandardTokenType {
|
|
||||||
Other = 0,
|
|
||||||
Comment = 1,
|
|
||||||
String = 2,
|
|
||||||
RegEx = 4,
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* A grammar
|
* A grammar
|
||||||
*/
|
*/
|
||||||
|
@ -57,38 +51,6 @@ export interface ITokenizeLineResult {
|
||||||
*/
|
*/
|
||||||
readonly stoppedEarly: boolean;
|
readonly stoppedEarly: boolean;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Helpers to manage the "collapsed" metadata of an entire StackElement stack.
|
|
||||||
* The following assumptions have been made:
|
|
||||||
* - languageId < 256 => needs 8 bits
|
|
||||||
* - unique color count < 512 => needs 9 bits
|
|
||||||
*
|
|
||||||
* The binary format is:
|
|
||||||
* - -------------------------------------------
|
|
||||||
* 3322 2222 2222 1111 1111 1100 0000 0000
|
|
||||||
* 1098 7654 3210 9876 5432 1098 7654 3210
|
|
||||||
* - -------------------------------------------
|
|
||||||
* xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
|
|
||||||
* bbbb bbbb bfff ffff ffFF FTTT LLLL LLLL
|
|
||||||
* - -------------------------------------------
|
|
||||||
* - L = LanguageId (8 bits)
|
|
||||||
* - T = StandardTokenType (3 bits)
|
|
||||||
* - F = FontStyle (3 bits)
|
|
||||||
* - f = foreground color (9 bits)
|
|
||||||
* - b = background color (9 bits)
|
|
||||||
*/
|
|
||||||
export const enum MetadataConsts {
|
|
||||||
LANGUAGEID_MASK = 255,
|
|
||||||
TOKEN_TYPE_MASK = 1792,
|
|
||||||
FONT_STYLE_MASK = 14336,
|
|
||||||
FOREGROUND_MASK = 8372224,
|
|
||||||
BACKGROUND_MASK = 4286578688,
|
|
||||||
LANGUAGEID_OFFSET = 0,
|
|
||||||
TOKEN_TYPE_OFFSET = 8,
|
|
||||||
FONT_STYLE_OFFSET = 11,
|
|
||||||
FOREGROUND_OFFSET = 14,
|
|
||||||
BACKGROUND_OFFSET = 23,
|
|
||||||
}
|
|
||||||
export interface ITokenizeLineResult2 {
|
export interface ITokenizeLineResult2 {
|
||||||
/**
|
/**
|
||||||
* The tokens in binary format. Each token occupies two array indices. For token i:
|
* The tokens in binary format. Each token occupies two array indices. For token i:
|
||||||
|
|
|
@ -11,7 +11,7 @@ declare module 'vscode' {
|
||||||
Other = 0,
|
Other = 0,
|
||||||
Comment = 1,
|
Comment = 1,
|
||||||
String = 2,
|
String = 2,
|
||||||
RegEx = 4
|
RegEx = 3
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TokenInformation {
|
export interface TokenInformation {
|
||||||
|
|
|
@ -10443,10 +10443,10 @@ vscode-telemetry-extractor@^1.9.5:
|
||||||
ts-morph "^12.2.0"
|
ts-morph "^12.2.0"
|
||||||
vscode-ripgrep "^1.12.1"
|
vscode-ripgrep "^1.12.1"
|
||||||
|
|
||||||
vscode-textmate@5.5.0:
|
vscode-textmate@6.0.0:
|
||||||
version "5.5.0"
|
version "6.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-5.5.0.tgz#d83776562c07d1e3181c2c7f1b3d5f20afcab483"
|
resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-6.0.0.tgz#a3777197235036814ac9a92451492f2748589210"
|
||||||
integrity sha512-jToQkPGMNKn0eyKyitYeINJF0NoD240aYyKPIWJv5W2jfPt++jIRg0OSergubtGhbw6SoefkvBYEpX7TsfoSUQ==
|
integrity sha512-gu73tuZfJgu+mvCSy4UZwd2JXykjK9zAZsfmDeut5dx/1a7FeTk0XwJsSuqQn+cuMCGVbIBfl+s53X4T19DnzQ==
|
||||||
|
|
||||||
vscode-windows-ca-certs@^0.3.0:
|
vscode-windows-ca-certs@^0.3.0:
|
||||||
version "0.3.0"
|
version "0.3.0"
|
||||||
|
|
Loading…
Reference in a new issue