mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
This reverts commit 5d44b6a6a7.
This commit is contained in:
@@ -60,18 +60,6 @@ interface PreviewStyleLoadErrorMessage extends WebviewMessage {
|
||||
};
|
||||
}
|
||||
|
||||
export class PreviewDocumentVersion {
|
||||
public constructor(
|
||||
public readonly resource: vscode.Uri,
|
||||
public readonly version: number,
|
||||
) { }
|
||||
|
||||
public equals(other: PreviewDocumentVersion): boolean {
|
||||
return this.resource.fsPath === other.resource.fsPath
|
||||
&& this.version === other.version;
|
||||
}
|
||||
}
|
||||
|
||||
export class MarkdownPreview extends Disposable {
|
||||
|
||||
public static viewType = 'markdown.preview';
|
||||
@@ -83,7 +71,7 @@ export class MarkdownPreview extends Disposable {
|
||||
private throttleTimer: any;
|
||||
private line: number | undefined = undefined;
|
||||
private firstUpdate = true;
|
||||
private currentVersion?: PreviewDocumentVersion;
|
||||
private currentVersion?: { resource: vscode.Uri, version: number };
|
||||
private forceUpdate = false;
|
||||
private isScrolling = false;
|
||||
private _disposed: boolean = false;
|
||||
@@ -401,8 +389,7 @@ export class MarkdownPreview extends Disposable {
|
||||
return;
|
||||
}
|
||||
|
||||
const pendingVersion = new PreviewDocumentVersion(resource, document.version);
|
||||
if (!this.forceUpdate && this.currentVersion && this.currentVersion.equals(pendingVersion)) {
|
||||
if (!this.forceUpdate && this.currentVersion && this.currentVersion.resource.fsPath === resource.fsPath && this.currentVersion.version === document.version) {
|
||||
if (this.line) {
|
||||
this.updateForView(resource, this.line);
|
||||
}
|
||||
@@ -410,14 +397,10 @@ export class MarkdownPreview extends Disposable {
|
||||
}
|
||||
this.forceUpdate = false;
|
||||
|
||||
this.currentVersion = pendingVersion;
|
||||
this.currentVersion = { resource, version: document.version };
|
||||
if (this._resource === resource) {
|
||||
const content = await this._contentProvider.provideTextDocumentContent(document, this._previewConfigurations, this.line, this.state);
|
||||
// Another call to `doUpdate` may have happened.
|
||||
// Make sure we are still updating for the correct document
|
||||
if (this.currentVersion && this.currentVersion.equals(pendingVersion)) {
|
||||
this.setContent(content);
|
||||
}
|
||||
this.setContent(content);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
"version": "0.0.1",
|
||||
"description": "Dependencies shared by all extensions",
|
||||
"dependencies": {
|
||||
"typescript": "3.5.0-dev.20190517"
|
||||
"typescript": "3.4.5"
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "node ./postinstall"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
|
||||
"Once accepted there, we are happy to receive an update request."
|
||||
],
|
||||
"version": "https://github.com/PowerShell/EditorSyntax/commit/44eac8702f3cbe55a4ec70c1fdb163d42b4162fc",
|
||||
"version": "https://github.com/PowerShell/EditorSyntax/commit/12b7d7257eb493e45a9af0af9094ec0c2a996712",
|
||||
"name": "PowerShell",
|
||||
"scopeName": "source.powershell",
|
||||
"patterns": [
|
||||
@@ -252,7 +252,7 @@
|
||||
]
|
||||
},
|
||||
"attribute": {
|
||||
"begin": "(\\[)\\s*\\b(?i)(cmdletbinding|alias|outputtype|parameter|validatenotnull|validatenotnullorempty|validatecount|validateset|allownull|allowemptycollection|allowemptystring|validatescript|validaterange|validatepattern|validatelength|supportswildcards)\\b",
|
||||
"begin": "(\\[)\\s*\\b(?i)(cmdletbinding|alias|outputtype|parameter|validatenotnull|validatenotnullorempty|validatecount|validateset|allownull|allowemptycollection|allowemptystring|validatescript|validaterange|validatepattern|validatelength)\\b",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.bracket.begin.powershell"
|
||||
@@ -283,6 +283,33 @@
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#variable"
|
||||
},
|
||||
{
|
||||
"include": "#variableNoProperty"
|
||||
},
|
||||
{
|
||||
"include": "#hashtable"
|
||||
},
|
||||
{
|
||||
"include": "#scriptblock"
|
||||
},
|
||||
{
|
||||
"include": "#doubleQuotedStringEscapes"
|
||||
},
|
||||
{
|
||||
"include": "#doubleQuotedString"
|
||||
},
|
||||
{
|
||||
"include": "#type"
|
||||
},
|
||||
{
|
||||
"include": "#numericConstant"
|
||||
},
|
||||
{
|
||||
"include": "#doubleQuotedString"
|
||||
},
|
||||
{
|
||||
"include": "$self"
|
||||
},
|
||||
@@ -296,6 +323,17 @@
|
||||
"name": "keyword.operator.assignment.powershell"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"begin": "(?<!')'",
|
||||
"end": "'(?!')",
|
||||
"name": "string.quoted.single.powershell",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "''",
|
||||
"name": "constant.character.escape.powershell"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -364,31 +402,15 @@
|
||||
"doubleQuotedStringEscapes": {
|
||||
"patterns": [
|
||||
{
|
||||
"match": "`[`0abefnrtv\"'$]",
|
||||
"match": "`[0abnfrvt\"'$`]",
|
||||
"name": "constant.character.escape.powershell"
|
||||
},
|
||||
{
|
||||
"include": "#unicodeEscape"
|
||||
},
|
||||
{
|
||||
"match": "\"\"",
|
||||
"name": "constant.character.escape.powershell"
|
||||
}
|
||||
]
|
||||
},
|
||||
"unicodeEscape": {
|
||||
"comment": "`u{xxxx} added in PowerShell 6.0",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "`u\\{(?:(?:10)?([0-9a-fA-F]){1,4}|0?\\g<1>{1,5})}",
|
||||
"name": "constant.character.escape.powershell"
|
||||
},
|
||||
{
|
||||
"match": "`u(?:\\{[0-9a-fA-F]{,6}.)?",
|
||||
"name": "invalid.character.escape.powershell"
|
||||
}
|
||||
]
|
||||
},
|
||||
"function": {
|
||||
"begin": "^(?:\\s*+)(?i)(function|filter|configuration|workflow)\\s+(?:(global|local|script|private):)?((?:\\p{L}|\\d|_|-|\\.)+)",
|
||||
"beginCaptures": {
|
||||
@@ -622,9 +644,6 @@
|
||||
},
|
||||
{
|
||||
"captures": {
|
||||
"0": {
|
||||
"name": "support.variable.automatic.powershell"
|
||||
},
|
||||
"1": {
|
||||
"name": "keyword.other.variable.definition.powershell"
|
||||
},
|
||||
@@ -636,7 +655,7 @@
|
||||
}
|
||||
},
|
||||
"comment": "Automatic variables are not constants, but they are read-only. In monokai (default) color schema support.variable doesn't have color, so we use constant.",
|
||||
"match": "(\\$)((?:[$^?])|(?i:_|Args|ConsoleFileName|Event|EventArgs|EventSubscriber|ForEach|Input|LastExitCode|Matches|MyInvocation|NestedPromptLevel|Profile|PSBoundParameters|PsCmdlet|PsCulture|PSDebugContext|PSItem|PSCommandPath|PSScriptRoot|PsUICulture|Pwd|Sender|SourceArgs|SourceEventArgs|StackTrace|Switch|This)\\b)((?:\\.(?:\\p{L}|\\d|_)+)*\\b)?"
|
||||
"match": "(\\$)(?i:(\\$|\\^|\\?|_|Args|ConsoleFileName|Event|EventArgs|EventSubscriber|ForEach|Input|LastExitCode|Matches|MyInvocation|NestedPromptLevel|Profile|PSBoundParameters|PsCmdlet|PsCulture|PSDebugContext|PSItem|PSCommandPath|PSScriptRoot|PsUICulture|Pwd|Sender|SourceArgs|SourceEventArgs|StackTrace|Switch|This))((?:\\.(?:\\p{L}|\\d|_)+)*\\b)?\\b"
|
||||
},
|
||||
{
|
||||
"captures": {
|
||||
@@ -814,7 +833,7 @@
|
||||
}
|
||||
},
|
||||
"comment": "Automatic variables are not constants, but they are read-only...",
|
||||
"match": "(\\$)((?:[$^?])|(?i:_|Args|ConsoleFileName|Event|EventArgs|EventSubscriber|ForEach|Input|LastExitCode|Matches|MyInvocation|NestedPromptLevel|Profile|PSBoundParameters|PsCmdlet|PsCulture|PSDebugContext|PSItem|PSCommandPath|PSScriptRoot|PsUICulture|Pwd|Sender|SourceArgs|SourceEventArgs|StackTrace|Switch|This)\\b)"
|
||||
"match": "(\\$)(?i:(\\$|\\^|\\?|_|Args|ConsoleFileName|Event|EventArgs|EventSubscriber|ForEach|Input|LastExitCode|Matches|MyInvocation|NestedPromptLevel|Profile|PSBoundParameters|PsCmdlet|PsCulture|PSDebugContext|PSItem|PSCommandPath|PSScriptRoot|PsUICulture|Pwd|Sender|SourceArgs|SourceEventArgs|StackTrace|Switch|This))\\b"
|
||||
},
|
||||
{
|
||||
"captures": {
|
||||
@@ -846,7 +865,7 @@
|
||||
"name": "entity.name.function.invocation.powershell"
|
||||
}
|
||||
},
|
||||
"match": "(?i:(\\$)(global|local|private|script|using|workflow):((?:\\p{L}|\\d|_)+))"
|
||||
"match": "(?i:(\\$|@)(global|local|private|script|using|workflow):((?:\\p{L}|\\d|_)+))"
|
||||
},
|
||||
{
|
||||
"captures": {
|
||||
@@ -962,6 +981,9 @@
|
||||
{
|
||||
"include": "#variableNoProperty"
|
||||
},
|
||||
{
|
||||
"include": "#variable"
|
||||
},
|
||||
{
|
||||
"include": "#doubleQuotedStringEscapes"
|
||||
},
|
||||
|
||||
@@ -694,24 +694,24 @@
|
||||
},
|
||||
{
|
||||
"c": "$",
|
||||
"t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell support.variable.automatic.powershell punctuation.definition.variable.powershell",
|
||||
"t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell keyword.other.variable.definition.powershell",
|
||||
"r": {
|
||||
"dark_plus": "support.variable: #9CDCFE",
|
||||
"light_plus": "support.variable: #001080",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "support.variable: #9CDCFE"
|
||||
"dark_plus": null,
|
||||
"light_plus": null,
|
||||
"dark_vs": null,
|
||||
"light_vs": null,
|
||||
"hc_black": "keyword: #569CD6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "_",
|
||||
"t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell support.variable.automatic.powershell",
|
||||
"t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell support.constant.automatic.powershell",
|
||||
"r": {
|
||||
"dark_plus": "support.variable: #9CDCFE",
|
||||
"light_plus": "support.variable: #001080",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "support.variable: #9CDCFE"
|
||||
"dark_plus": null,
|
||||
"light_plus": null,
|
||||
"dark_vs": null,
|
||||
"light_vs": null,
|
||||
"hc_black": "default: #FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -1068,24 +1068,24 @@
|
||||
},
|
||||
{
|
||||
"c": "$",
|
||||
"t": "source.powershell meta.scriptblock.powershell interpolated.simple.source.powershell support.variable.automatic.powershell punctuation.definition.variable.powershell",
|
||||
"t": "source.powershell meta.scriptblock.powershell interpolated.simple.source.powershell keyword.other.variable.definition.powershell",
|
||||
"r": {
|
||||
"dark_plus": "support.variable: #9CDCFE",
|
||||
"light_plus": "support.variable: #001080",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "support.variable: #9CDCFE"
|
||||
"dark_plus": null,
|
||||
"light_plus": null,
|
||||
"dark_vs": null,
|
||||
"light_vs": null,
|
||||
"hc_black": "keyword: #569CD6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "_",
|
||||
"t": "source.powershell meta.scriptblock.powershell interpolated.simple.source.powershell support.variable.automatic.powershell",
|
||||
"t": "source.powershell meta.scriptblock.powershell interpolated.simple.source.powershell support.constant.automatic.powershell",
|
||||
"r": {
|
||||
"dark_plus": "support.variable: #9CDCFE",
|
||||
"light_plus": "support.variable: #001080",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "support.variable: #9CDCFE"
|
||||
"dark_plus": null,
|
||||
"light_plus": null,
|
||||
"dark_vs": null,
|
||||
"light_vs": null,
|
||||
"hc_black": "default: #FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -1266,24 +1266,24 @@
|
||||
},
|
||||
{
|
||||
"c": "$",
|
||||
"t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell interpolated.simple.source.powershell support.variable.automatic.powershell punctuation.definition.variable.powershell",
|
||||
"t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell interpolated.simple.source.powershell keyword.other.variable.definition.powershell",
|
||||
"r": {
|
||||
"dark_plus": "support.variable: #9CDCFE",
|
||||
"light_plus": "support.variable: #001080",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "support.variable: #9CDCFE"
|
||||
"dark_plus": null,
|
||||
"light_plus": null,
|
||||
"dark_vs": null,
|
||||
"light_vs": null,
|
||||
"hc_black": "keyword: #569CD6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "_",
|
||||
"t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell interpolated.simple.source.powershell support.variable.automatic.powershell",
|
||||
"t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell interpolated.simple.source.powershell support.constant.automatic.powershell",
|
||||
"r": {
|
||||
"dark_plus": "support.variable: #9CDCFE",
|
||||
"light_plus": "support.variable: #001080",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "support.variable: #9CDCFE"
|
||||
"dark_plus": null,
|
||||
"light_plus": null,
|
||||
"dark_vs": null,
|
||||
"light_vs": null,
|
||||
"hc_black": "default: #FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -1431,24 +1431,24 @@
|
||||
},
|
||||
{
|
||||
"c": "$",
|
||||
"t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell meta.scriptblock.powershell interpolated.simple.source.powershell support.variable.automatic.powershell punctuation.definition.variable.powershell",
|
||||
"t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell meta.scriptblock.powershell interpolated.simple.source.powershell keyword.other.variable.definition.powershell",
|
||||
"r": {
|
||||
"dark_plus": "support.variable: #9CDCFE",
|
||||
"light_plus": "support.variable: #001080",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "support.variable: #9CDCFE"
|
||||
"dark_plus": null,
|
||||
"light_plus": null,
|
||||
"dark_vs": null,
|
||||
"light_vs": null,
|
||||
"hc_black": "keyword: #569CD6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "matches",
|
||||
"t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell meta.scriptblock.powershell interpolated.simple.source.powershell support.variable.automatic.powershell",
|
||||
"t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell meta.scriptblock.powershell interpolated.simple.source.powershell support.constant.automatic.powershell",
|
||||
"r": {
|
||||
"dark_plus": "support.variable: #9CDCFE",
|
||||
"light_plus": "support.variable: #001080",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "support.variable: #9CDCFE"
|
||||
"dark_plus": null,
|
||||
"light_plus": null,
|
||||
"dark_vs": null,
|
||||
"light_vs": null,
|
||||
"hc_black": "default: #FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -1508,24 +1508,24 @@
|
||||
},
|
||||
{
|
||||
"c": "$",
|
||||
"t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell meta.scriptblock.powershell interpolated.simple.source.powershell support.variable.automatic.powershell punctuation.definition.variable.powershell",
|
||||
"t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell meta.scriptblock.powershell interpolated.simple.source.powershell keyword.other.variable.definition.powershell",
|
||||
"r": {
|
||||
"dark_plus": "support.variable: #9CDCFE",
|
||||
"light_plus": "support.variable: #001080",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "support.variable: #9CDCFE"
|
||||
"dark_plus": null,
|
||||
"light_plus": null,
|
||||
"dark_vs": null,
|
||||
"light_vs": null,
|
||||
"hc_black": "keyword: #569CD6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "matches",
|
||||
"t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell meta.scriptblock.powershell interpolated.simple.source.powershell support.variable.automatic.powershell",
|
||||
"t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell meta.scriptblock.powershell interpolated.simple.source.powershell support.constant.automatic.powershell",
|
||||
"r": {
|
||||
"dark_plus": "support.variable: #9CDCFE",
|
||||
"light_plus": "support.variable: #001080",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "support.variable: #9CDCFE"
|
||||
"dark_plus": null,
|
||||
"light_plus": null,
|
||||
"dark_vs": null,
|
||||
"light_vs": null,
|
||||
"hc_black": "default: #FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
"vscode": "*"
|
||||
},
|
||||
"scripts": {
|
||||
"vscode:prepublish": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:vscode-colorize-tests ./tsconfig.json"
|
||||
"vscode:prepublish": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:vscode-colorize-tests ./tsconfig.json",
|
||||
"postinstall": "node ./node_modules/vscode/bin/install"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^10.12.21",
|
||||
|
||||
@@ -4,4 +4,3 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
/// <reference types='@types/node'/>
|
||||
/// <reference path='../../../../src/vs/vscode.d.ts'/>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
typescript@3.5.0-dev.20190517:
|
||||
version "3.5.0-dev.20190517"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.0-dev.20190517.tgz#5a85f1091cf33fde39b04f898c5730e30edd3e39"
|
||||
integrity sha512-KoBHq6ytEApXKTDtmTu4Sp/tC5SPe4FpvwutLEANhwdMPblqZdh7APuH7I/ceMlgfHSa7B00JgF7NokUJQi0/g==
|
||||
typescript@3.4.5:
|
||||
version "3.4.5"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.4.5.tgz#2d2618d10bb566572b8d7aad5180d84257d70a99"
|
||||
integrity sha512-YycBxUb49UUhdNMU5aJ7z5Ej2XGmaIBL0x34vZ82fn3hGvD+bgrMrVDpatgz2f7YxUMJxMkbWxJZeAvDxVe7Vw==
|
||||
|
||||
Reference in New Issue
Block a user