Revert "Update coffee grammar tests"

This reverts commit c1906c79af.
This commit is contained in:
Matt Bierner 2017-06-20 18:24:53 -07:00
parent 691fbe1615
commit 4c1a6f1e41
6 changed files with 48 additions and 73 deletions

View file

@ -399,33 +399,33 @@
"c": "#{",
"t": "source.coffee string.regexp.coffee source.coffee.embedded.source punctuation.section.embedded.coffee",
"r": {
"dark_plus": "punctuation.section.embedded.coffee: #569CD6",
"light_plus": "punctuation.section.embedded.coffee: #0000FF",
"dark_vs": "punctuation.section.embedded.coffee: #569CD6",
"light_vs": "punctuation.section.embedded.coffee: #0000FF",
"hc_black": "punctuation.section.embedded.coffee: #569CD6"
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
}
},
{
"c": "name",
"t": "source.coffee string.regexp.coffee source.coffee.embedded.source",
"r": {
"dark_plus": "source.coffee.embedded: #9CDCFE",
"light_plus": "source.coffee.embedded: #FF0000",
"dark_vs": "source.coffee.embedded: #9CDCFE",
"light_vs": "source.coffee.embedded: #FF0000",
"hc_black": "source.coffee.embedded: #D4D4D4"
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
}
},
{
"c": "}",
"t": "source.coffee string.regexp.coffee source.coffee.embedded.source punctuation.section.embedded.coffee",
"r": {
"dark_plus": "punctuation.section.embedded.coffee: #569CD6",
"light_plus": "punctuation.section.embedded.coffee: #0000FF",
"dark_vs": "punctuation.section.embedded.coffee: #569CD6",
"light_vs": "punctuation.section.embedded.coffee: #0000FF",
"hc_black": "punctuation.section.embedded.coffee: #569CD6"
"dark_plus": "string.regexp: #D16969",
"light_plus": "string.regexp: #811F3F",
"dark_vs": "string.regexp: #D16969",
"light_vs": "string.regexp: #811F3F",
"hc_black": "string.regexp: #D16969"
}
},
{

View file

@ -278,11 +278,11 @@
"c": "#{",
"t": "source.coffee string.quoted.double.coffee source.coffee.embedded.source punctuation.section.embedded.coffee",
"r": {
"dark_plus": "punctuation.section.embedded.coffee: #569CD6",
"light_plus": "punctuation.section.embedded.coffee: #0000FF",
"dark_vs": "punctuation.section.embedded.coffee: #569CD6",
"light_vs": "punctuation.section.embedded.coffee: #0000FF",
"hc_black": "punctuation.section.embedded.coffee: #569CD6"
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "string: #CE9178"
}
},
{
@ -291,8 +291,8 @@
"r": {
"dark_plus": "variable: #9CDCFE",
"light_plus": "variable: #001080",
"dark_vs": "source.coffee.embedded: #9CDCFE",
"light_vs": "source.coffee.embedded: #FF0000",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "variable: #9CDCFE"
}
},
@ -300,11 +300,11 @@
"c": "}",
"t": "source.coffee string.quoted.double.coffee source.coffee.embedded.source punctuation.section.embedded.coffee",
"r": {
"dark_plus": "punctuation.section.embedded.coffee: #569CD6",
"light_plus": "punctuation.section.embedded.coffee: #0000FF",
"dark_vs": "punctuation.section.embedded.coffee: #569CD6",
"light_vs": "punctuation.section.embedded.coffee: #0000FF",
"hc_black": "punctuation.section.embedded.coffee: #569CD6"
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "string: #CE9178"
}
},
{
@ -531,11 +531,11 @@
"c": "#{",
"t": "source.coffee string.quoted.double.coffee source.coffee.embedded.source punctuation.section.embedded.coffee",
"r": {
"dark_plus": "punctuation.section.embedded.coffee: #569CD6",
"light_plus": "punctuation.section.embedded.coffee: #0000FF",
"dark_vs": "punctuation.section.embedded.coffee: #569CD6",
"light_vs": "punctuation.section.embedded.coffee: #0000FF",
"hc_black": "punctuation.section.embedded.coffee: #569CD6"
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "string: #CE9178"
}
},
{
@ -544,8 +544,8 @@
"r": {
"dark_plus": "variable: #9CDCFE",
"light_plus": "variable: #001080",
"dark_vs": "source.coffee.embedded: #9CDCFE",
"light_vs": "source.coffee.embedded: #FF0000",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "variable: #9CDCFE"
}
},
@ -553,11 +553,11 @@
"c": "}",
"t": "source.coffee string.quoted.double.coffee source.coffee.embedded.source punctuation.section.embedded.coffee",
"r": {
"dark_plus": "punctuation.section.embedded.coffee: #569CD6",
"light_plus": "punctuation.section.embedded.coffee: #0000FF",
"dark_vs": "punctuation.section.embedded.coffee: #569CD6",
"light_vs": "punctuation.section.embedded.coffee: #0000FF",
"hc_black": "punctuation.section.embedded.coffee: #569CD6"
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "string: #CE9178"
}
},
{

View file

@ -10,7 +10,7 @@ import { CommandsRegistry } from 'vs/platform/commands/common/commands';
import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
import { Position as EditorPosition } from 'vs/platform/editor/common/editor';
import { HtmlInput, HtmlInputOptions } from '../common/htmlInput';
import { HtmlInput } from '../common/htmlInput';
import { HtmlPreviewPart } from 'vs/workbench/parts/html/browser/htmlPreviewPart';
import { Registry } from 'vs/platform/registry/common/platform';
import { EditorDescriptor } from 'vs/workbench/browser/parts/editor/baseEditor';
@ -38,7 +38,7 @@ interface HtmlZoneParams {
let warn = true;
CommandsRegistry.registerCommand('_workbench.htmlZone', (accessor: ServicesAccessor, params: HtmlZoneParams) => {
CommandsRegistry.registerCommand('_workbench.htmlZone', function (accessor: ServicesAccessor, params: HtmlZoneParams) {
if (warn) {
console.warn(`'_workbench.htmlZone' is an EXPERIMENTAL feature and therefore subject to CHANGE and REMOVAL without notice.`);
@ -69,13 +69,10 @@ CommandsRegistry.registerCommand('_workbench.htmlZone', (accessor: ServicesAcces
HtmlZoneController.getInstance(codeEditor).addZone(params.lineNumber, contents);
});
});
const defaultOptions: HtmlInputOptions = {
enableJavaScript: true
};
CommandsRegistry.registerCommand('_workbench.previewHtml', (accessor: ServicesAccessor, resource: URI | string, position?: EditorPosition, label?: string, options: HtmlInputOptions = defaultOptions) => {
CommandsRegistry.registerCommand('_workbench.previewHtml', function (accessor: ServicesAccessor, resource: URI | string, position?: EditorPosition, label?: string) {
const uri = resource instanceof URI ? resource : URI.parse(resource);
label = label || uri.fsPath;
@ -94,7 +91,7 @@ CommandsRegistry.registerCommand('_workbench.previewHtml', (accessor: ServicesAc
// Otherwise, create new input and open it
if (!input) {
input = accessor.get(IInstantiationService).createInstance(HtmlInput, label, '', uri, options);
input = accessor.get(IInstantiationService).createInstance(HtmlInput, label, '', uri);
} else {
input.setName(label); // make sure to use passed in label
}

View file

@ -208,11 +208,8 @@ export class HtmlPreviewPart extends WebviewEditor {
}
this._modelChangeSubscription = this.model.onDidChangeContent(() => {
if (this.model && input instanceof HtmlInput) {
if (this.model) {
this.scrollYPercentage = 0;
this.webview.options = {
enableJavascript: input.options.enableJavaScript
};
this.webview.contents = this.model.getLinesContent();
}
});

View file

@ -60,7 +60,7 @@ export default class Webview {
constructor(
private parent: HTMLElement,
private _styleElement: Element,
private _options: WebviewOptions = {}
private options: WebviewOptions = {}
) {
this._webview = <any>document.createElement('webview');
@ -162,14 +162,10 @@ export default class Webview {
this._send('initial-scroll-position', value);
}
set options(options: WebviewOptions) {
this._options = options;
}
set contents(value: string[]) {
this._send('content', {
contents: value,
options: this._options
options: this.options
});
}

View file

@ -5,22 +5,7 @@
'use strict';
import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput';
import URI from 'vs/base/common/uri';
import { ITextModelService } from 'vs/editor/common/services/resolverService';
export interface HtmlInputOptions {
enableJavaScript?: boolean;
}
export class HtmlInput extends ResourceEditorInput {
constructor(
name: string,
description: string,
resource: URI,
public readonly options: HtmlInputOptions,
@ITextModelService textModelResolverService: ITextModelService
) {
super(name, description, resource, textModelResolverService);
}
// marker class
}