Move html extension: setup & scanner

This commit is contained in:
Martin Aeschlimann 2016-08-17 11:37:22 +02:00
parent 2ed511ea28
commit cb5a6e77db
25 changed files with 2428 additions and 862 deletions

29
extensions/html/.vscode/launch.json vendored Normal file
View file

@ -0,0 +1,29 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}"
],
"stopOnEntry": false,
"sourceMaps": true,
"outDir": "${workspaceRoot}/client/out",
"preLaunchTask": "npm"
},
{
"name": "Launch Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/client/out/test" ],
"stopOnEntry": false,
"sourceMaps": true,
"outDir": "${workspaceRoot}/client/out/test",
"preLaunchTask": "npm"
}
]
}

30
extensions/html/.vscode/tasks.json vendored Normal file
View file

@ -0,0 +1,30 @@
// Available variables which can be used inside of strings.
// ${workspaceRoot}: the root folder of the team
// ${file}: the current opened file
// ${fileBasename}: the current opened file's basename
// ${fileDirname}: the current opened file's dirname
// ${fileExtname}: the current opened file's extension
// ${cwd}: the current working directory of the spawned process
// A task runner that calls a custom npm script that compiles the extension.
{
"version": "0.1.0",
// we want to run npm
"command": "npm",
// the command is a shell script
"isShellCommand": true,
// show the output window only if unrecognized errors occur.
"showOutput": "silent",
// we run the custom script "compile" as defined in package.json
"args": ["run", "compile"],
// The tsc compiler is started in watching mode
"isWatching": true,
// use the standard tsc in watch mode problem matcher to find compile problems in the output.
"problemMatcher": "$tsc-watch"
}

View file

@ -19,4 +19,92 @@
"to the base-name name of the original file, and an extension of txt, html, or similar. For example",
"\"tidy\" is accompanied by \"tidy-license.txt\"."
]
}]
},
{
"name": "HTML 5.1 W3C Working Draft",
"version": "08 October 2015",
"license": "W3C Document License",
"repositoryURL": "http://www.w3.org/TR/2015/WD-html51-20151008/",
"licenseDetail": [
"Copyright © 2015 W3C® (MIT, ERCIM, Keio, Beihang). This software or document includes material copied ",
"from or derived from HTML 5.1 W3C Working Draft (http://www.w3.org/TR/2015/WD-html51-20151008/.)",
"",
"THIS DOCUMENT IS PROVIDED \"AS IS,\" AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT ",
"NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS OF ",
"THE DOCUMENT ARE SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY ",
"PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.",
"",
"COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE ",
"DOCUMENT OR THE PERFORMANCE OR IMPLEMENTATION OF THE CONTENTS THEREOF.",
"",
"The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to this document or its contents",
"without specific, written prior permission. Title to copyright in this document will at all times remain with copyright holders."
]
},
{
"name": "Ionic documentation",
"version": "1.2.4",
"license": "Apache2",
"repositoryURL": "https://github.com/driftyco/ionic-site",
"licenseDetail": [
"Copyright Drifty Co. http://drifty.com/.",
"",
"Apache License",
"",
"Version 2.0, January 2004",
"",
"http://www.apache.org/licenses/",
"",
"TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION",
"",
"1. Definitions.",
"",
"\"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.",
"",
"\"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.",
"",
"\"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.",
"",
"\"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.",
"",
"\"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.",
"",
"\"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.",
"",
"\"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).",
"",
"\"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.",
"",
"\"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"",
"",
"\"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.",
"",
"2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.",
"",
"3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.",
"",
"4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:",
"",
"You must give any other recipients of the Work or Derivative Works a copy of this License; and",
"",
"You must cause any modified files to carry prominent notices stating that You changed the files; and",
"",
"You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and",
"",
"If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.",
"",
"5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.",
"",
"6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.",
"",
"7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.",
"",
"8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.",
"",
"9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.",
"",
"END OF TERMS AND CONDITIONS"
]
}
]

View file

@ -0,0 +1,6 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
export const EMPTY_ELEMENTS:string[] = ['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'menuitem', 'meta', 'param', 'source', 'track', 'wbr'];

View file

@ -0,0 +1,65 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as path from 'path';
import {languages, ExtensionContext, IndentAction} from 'vscode';
import {LanguageClient, LanguageClientOptions, ServerOptions, TransportKind} from 'vscode-languageclient';
import {EMPTY_ELEMENTS} from './htmlEmptyTagsShared';
import * as nls from 'vscode-nls';
let localize = nls.loadMessageBundle();
export function activate(context: ExtensionContext) {
// The server is implemented in node
let serverModule = context.asAbsolutePath(path.join('server', 'out', 'htmlServerMain.js'));
// The debug options for the server
let debugOptions = { execArgv: ['--nolazy', '--debug=6004'] };
// If the extension is launch in debug mode the debug server options are use
// Otherwise the run options are used
let serverOptions: ServerOptions = {
run: { module: serverModule, transport: TransportKind.ipc },
debug: { module: serverModule, transport: TransportKind.ipc, options: debugOptions }
};
// Options to control the language client
let clientOptions: LanguageClientOptions = {
// Register the server for json documents
documentSelector: ['html'],
synchronize: {
// Synchronize the setting section 'html' to the server
configurationSection: ['html'],
},
initializationOptions: {
}
};
// Create the language client and start the client.
let client = new LanguageClient('html', localize('htmlserver.name', 'HTML Language Server'), serverOptions, clientOptions);
let disposable = client.start();
// Push the disposable to the context's subscriptions so that the
// client can be deactivated on extension deactivation
context.subscriptions.push(disposable);
languages.setLanguageConfiguration('html', {
wordPattern: /("(?:[^\\\"]*(?:\\.)?)*"?)|('(?:[^\\\']*(?:\\.)?)*'?)|[^\s<>={}\[\],]+/,
onEnterRules:[
{
beforeText: new RegExp(`<(?!(?:${EMPTY_ELEMENTS.join('|')}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`, 'i'),
afterText: /^<\/([_:\w][_:\w-.\d]*)\s*>$/i,
action: { indentAction: IndentAction.IndentOutdent }
},
{
beforeText: new RegExp(`<(?!(?:${EMPTY_ELEMENTS.join('|')}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`, 'i'),
action: { indentAction: IndentAction.Indent }
}
],
});
}

View file

@ -0,0 +1,11 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference path='../../../../../src/vs/vscode.d.ts'/>
/// <reference path='../../../../../src/typings/mocha.d.ts'/>
/// <reference path='../../../../../extensions/node.d.ts'/>
/// <reference path='../../../../../extensions/lib.core.d.ts'/>
/// <reference path='../../../../../extensions/declares.d.ts'/>
/// <reference path='../../../node_modules/vscode-languageclient/lib/main.d.ts'/>

View file

@ -0,0 +1,11 @@
{
"compilerOptions": {
"noLib": true,
"target": "es5",
"module": "commonjs",
"outDir": "./out"
},
"exclude": [
"node_modules"
]
}

View file

@ -0,0 +1,21 @@
{
"comments": {
"blockComment": [ "<!--", "-->" ]
},
"brackets": [
["<!--", "-->"],
["<", ">"]
],
"autoClosingPairs": [
{ "open": "{", "close": "}"},
{ "open": "[", "close": "]"},
{ "open": "(", "close": ")" },
{ "open": "'", "close": "'" },
{ "open": "\"", "close": "\"" },
{ "open": "<", "close": ">" }
],
"surroundingPairs": [
{ "open": "'", "close": "'" },
{ "open": "\"", "close": "\"" }
]
}

View file

@ -2,7 +2,20 @@
"name": "html",
"version": "0.1.0",
"publisher": "vscode",
"engines": { "vscode": "*" },
"engines": {
"vscode": "0.10.x"
},
"activationEvents": [
"onLanguage:html"
],
"main": "./client/out/htmlMain",
"scripts": {
"compile": "gulp compile-extension:html-client && gulp compile-extension:html-server",
"postinstall": "cd server && npm install",
"update-grammar": "node ../../build/npm/update-grammar.js textmate/html.tmbundle Syntaxes/HTML.plist ./syntaxes/html.json",
"install-client-next": "npm install vscode-languageclient@next -f -S",
"install-client-local": "npm install ../../../vscode-languageserver-node/client -f -S"
},
"contributes": {
"languages": [{
"id": "html",
@ -11,10 +24,71 @@
"mimetypes": ["text/html", "text/x-jshtm", "text/template", "text/ng-template", "application/xhtml+xml"]
}],
"grammars": [{
/* "language": "html", not yet enabled*/
"language": "html",
"scopeName": "text.html.basic",
"path": "./syntaxes/HTML.plist"
}]
"path": "./syntaxes/html.json"
}],
"configuration": {
"id": "html",
"order": 20,
"type": "object",
"title": "HTML",
"properties": {
"html.format.wrapLineLength": {
"type": "integer",
"default": 120,
"description": "Maximum amount of characters per line (0 = disable)."
},
"html.format.unformatted": {
"type": [
"string",
"null"
],
"default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, script, select, small, span, strong, sub, sup, textarea, tt, var",
"description": "List of tags, comma separated, that shouldn't be reformatted. 'null' defaults to all tags listed at https://www.w3.org/TR/html5/dom.html#phrasing-content."
},
"html.format.indentInnerHtml": {
"type": "boolean",
"default": false,
"description": "Indent <head> and <body> sections."
},
"html.format.preserveNewLines": {
"type": "boolean",
"default": true,
"description": "Whether existing line breaks before elements should be preserved. Only works before elements, not inside tags or for text."
},
"html.format.maxPreserveNewLines": {
"type": [
"number",
"null"
],
"default": null,
"description": "Maximum number of line breaks to be preserved in one chunk. Use 'null' for unlimited."
},
"html.format.indentHandlebars": {
"type": "boolean",
"default": false,
"description": "Format and indent {{#foo}} and {{/foo}}."
},
"html.format.endWithNewline": {
"type": "boolean",
"default": false,
"description": "End with a newline."
},
"html.format.extraLiners": {
"type": [
"string",
"null"
],
"default": "head, body, /html",
"description": "List of tags, comma separated, that should have an extra newline before them. 'null' defaults to \"head, body, /html\"."
}
}
}
},
"dependencies": {
"vscode-languageclient": "^2.4.2-next.3",
"vscode-nls": "^1.0.7"
}
}
}

View file

@ -0,0 +1,32 @@
{
"version": "0.1.0",
// List of configurations. Add new configurations or edit existing ones.
"configurations": [
{
"name": "Attach",
"type": "node",
"request": "attach",
"port": 6004,
"sourceMaps": true,
"outDir": "${workspaceRoot}/out"
},
{
"name": "Unit Tests",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/../../../node_modules/mocha/bin/_mocha",
"stopOnEntry": false,
"args": [
"--timeout",
"999999",
"--colors"
],
"cwd": "${workspaceRoot}",
"runtimeExecutable": null,
"runtimeArgs": [],
"env": {},
"sourceMaps": true,
"outDir": "${workspaceRoot}/out"
}
]
}

View file

@ -0,0 +1,9 @@
{
"version": "0.1.0",
"command": "npm",
"isShellCommand": true,
"showOutput": "silent",
"args": ["run", "watch"],
"isWatching": true,
"problemMatcher": "$tsc-watch"
}

View file

@ -0,0 +1,20 @@
{
"name": "vscode-html-languageserver",
"description": "HTML language server",
"version": "1.0.0",
"author": "Microsoft Corporation",
"license": "MIT",
"engines": {
"node": "*"
},
"dependencies": {
"vscode-languageserver": "^2.4.0-next.4",
"vscode-nls": "^1.0.4"
},
"scripts": {
"compile": "gulp compile-extension:json-server",
"watch": "gulp watch-extension:json-server",
"install-server-next": "npm install vscode-languageserver@next -f -S",
"install-server-local": "npm install ../../../../vscode-languageserver-node/server -f -S"
}
}

View file

@ -0,0 +1,152 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import {
createConnection, IConnection,
TextDocuments, TextDocument, InitializeParams, InitializeResult
} from 'vscode-languageserver';
import {HTMLDocument, LanguageSettings, getLanguageService} from './service/htmlLanguageService';
import * as nls from 'vscode-nls';
nls.config(process.env['VSCODE_NLS_CONFIG']);
// Create a connection for the server
let connection: IConnection = createConnection();
console.log = connection.console.log.bind(connection.console);
console.error = connection.console.error.bind(connection.console);
// Create a simple text document manager. The text document manager
// supports full document sync only
let documents: TextDocuments = new TextDocuments();
// Make the text document manager listen on the connection
// for open, change and close text document events
documents.listen(connection);
// After the server has started the client sends an initilize request. The server receives
// in the passed params the rootPath of the workspace plus the client capabilites
connection.onInitialize((params: InitializeParams): InitializeResult => {
return {
capabilities: {
// Tell the client that the server works in FULL text document sync mode
textDocumentSync: documents.syncKind,
completionProvider: { resolveProvider: true, triggerCharacters: ['"', ':'] },
hoverProvider: true,
documentSymbolProvider: true,
documentRangeFormattingProvider: true,
documentFormattingProvider: true
}
};
});
// create the JSON language service
var languageService = getLanguageService();
// The settings interface describes the server relevant settings part
interface Settings {
html: LanguageSettings;
}
let languageSettings: LanguageSettings;
// The settings have changed. Is send on server activation as well.
connection.onDidChangeConfiguration((change) => {
var settings = <Settings>change.settings;
languageSettings = settings.html;
updateConfiguration();
});
function updateConfiguration() {
languageService.configure(languageSettings);
// Revalidate any open text documents
documents.all().forEach(triggerValidation);
}
// The content of a text document has changed. This event is emitted
// when the text document first opened or when its content has changed.
documents.onDidChangeContent((change) => {
triggerValidation(change.document);
});
// a document has closed: clear all diagnostics
documents.onDidClose(event => {
cleanPendingValidation(event.document);
connection.sendDiagnostics({ uri: event.document.uri, diagnostics: [] });
});
let pendingValidationRequests : {[uri:string]:number} = {};
const validationDelayMs = 200;
function cleanPendingValidation(textDocument: TextDocument): void {
let request = pendingValidationRequests[textDocument.uri];
if (request) {
clearTimeout(request);
delete pendingValidationRequests[textDocument.uri];
}
}
function triggerValidation(textDocument: TextDocument): void {
cleanPendingValidation(textDocument);
pendingValidationRequests[textDocument.uri] = setTimeout(() => {
delete pendingValidationRequests[textDocument.uri];
validateTextDocument(textDocument);
}, validationDelayMs);
}
function validateTextDocument(textDocument: TextDocument): void {
if (textDocument.getText().length === 0) {
// ignore empty documents
connection.sendDiagnostics({ uri: textDocument.uri, diagnostics: [] });
return;
}
let htmlDocument = getHTMLDocument(textDocument);
let diagnostics = languageService.doValidation(textDocument, htmlDocument);
// Send the computed diagnostics to VSCode.
connection.sendDiagnostics({ uri: textDocument.uri, diagnostics });
}
function getHTMLDocument(document: TextDocument): HTMLDocument {
return languageService.parseHTMLDocument(document);
}
connection.onCompletion(textDocumentPosition => {
let document = documents.get(textDocumentPosition.textDocument.uri);
let htmlDocument = getHTMLDocument(document);
return languageService.doComplete(document, textDocumentPosition.position, htmlDocument);
});
connection.onCompletionResolve(completionItem => {
return languageService.doResolve(completionItem);
});
connection.onHover(textDocumentPositionParams => {
let document = documents.get(textDocumentPositionParams.textDocument.uri);
let htmlDocument = getHTMLDocument(document);
return languageService.doHover(document, textDocumentPositionParams.position, htmlDocument);
});
connection.onDocumentSymbol(documentSymbolParams => {
let document = documents.get(documentSymbolParams.textDocument.uri);
let htmlDocument = getHTMLDocument(document);
return languageService.findDocumentSymbols(document, htmlDocument);
});
connection.onDocumentFormatting(formatParams => {
let document = documents.get(formatParams.textDocument.uri);
return languageService.format(document, null, formatParams.options);
});
connection.onDocumentRangeFormatting(formatParams => {
let document = documents.get(formatParams.textDocument.uri);
return languageService.format(document, formatParams.range, formatParams.options);
});
// Listen on the connection
connection.listen();

View file

@ -0,0 +1,43 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { TextDocument, Position, CompletionItem, CompletionList, Hover, Range, SymbolInformation, Diagnostic, TextEdit, FormattingOptions, MarkedString } from 'vscode-languageserver-types';
export { TextDocument, Position, CompletionItem, CompletionList, Hover, Range, SymbolInformation, Diagnostic, TextEdit, FormattingOptions, MarkedString };
export interface HTMLFormatConfiguration {
wrapLineLength: number;
unformatted: string;
indentInnerHtml: boolean;
preserveNewLines: boolean;
maxPreserveNewLines: number;
indentHandlebars: boolean;
endWithNewline: boolean;
extraLiners: string;
}
export interface LanguageSettings {
validate: boolean;
format: HTMLFormatConfiguration;
}
export declare type HTMLDocument = {};
export interface LanguageService {
configure(settings: LanguageSettings): void;
doValidation(document: TextDocument, htmlDocument: HTMLDocument): Diagnostic[];
parseHTMLDocument(document: TextDocument): HTMLDocument;
doResolve(item: CompletionItem): CompletionItem;
doComplete(document: TextDocument, position: Position, doc: HTMLDocument): CompletionList;
findDocumentSymbols(document: TextDocument, doc: HTMLDocument): SymbolInformation[];
doHover(document: TextDocument, position: Position, doc: HTMLDocument): Hover;
format(document: TextDocument, range: Range, options: FormattingOptions): TextEdit[];
}
export function getLanguageService() : LanguageService {
return null;
}

View file

@ -0,0 +1,408 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
export enum TokenType {
CommentStart,
Comment,
CommentEnd,
TagStart,
Tag,
TagEnd,
DelimiterAssign,
AttributeName,
AttributeValue,
DoctypeStart,
Doctype,
DoctypeEnd,
Content,
Whitespace,
Unknown,
Script,
Styles,
EOS
}
export interface IToken {
type: TokenType;
offset: number;
len: number;
}
class MultiLineStream {
private source: string;
private len: number;
private position: number;
constructor(source: string) {
this.source = source;
this.len = source.length;
this.position = 0;
}
public eos(): boolean {
return this.len <= this.position;
}
public pos(): number {
return this.position;
}
public goBackTo(pos: number): void {
this.position = pos;
}
public goBack(n: number): void {
this.position -= n;
}
public advance(n: number): void {
this.position += n;
}
public goToEnd(): void {
this.position = this.source.length;
}
public nextChar(): number {
return this.source.charCodeAt(this.position++) || 0;
}
public peekChar(n: number = 0): number {
return this.source.charCodeAt(this.position + n) || 0;
}
public advanceIfChar(ch: number): boolean {
if (ch === this.source.charCodeAt(this.position)) {
this.position++;
return true;
}
return false;
}
public advanceIfChars(ch: number[]): boolean {
let i: number;
if (this.position + ch.length > this.source.length) {
return false;
}
for (i = 0; i < ch.length; i++) {
if (this.source.charCodeAt(this.position + i) !== ch[i]) {
return false;
}
}
this.advance(i);
return true;
}
public advanceIfRegExp(regex: RegExp): string {
let str = this.source.substr(this.position);
let match = str.match(regex);
if (match) {
this.position = this.position + match.index + match[0].length;
return match[0];
}
return '';
}
public advanceUntilRegExp(regex: RegExp): string {
let str = this.source.substr(this.position);
let match = str.match(regex);
if (match) {
this.position = this.position + match.index;
return match[0];
}
return '';
}
public advanceUntilChar(ch: number): boolean {
while (this.position < this.source.length) {
if (this.source.charCodeAt(this.position) === ch) {
return true;
}
this.advance(1);
}
return false;
}
public advanceUntilChars(ch: number[]): boolean {
while (this.position + ch.length < this.source.length) {
for (let i = 0; i < ch.length; i++) {
if (this.source.charCodeAt(this.position + i) !== ch[i]) {
break;
}
return true;
}
this.advance(1);
}
return false;
}
public skipWhitespace(): boolean {
let n = this.advanceWhileChar(ch => {
return ch === _WSP || ch === _TAB || ch === _NWL || ch === _LFD || ch === _CAR;
});
return n > 0;
}
public advanceWhileChar(condition: (ch: number) => boolean): number {
let posNow = this.position;
while (this.position < this.len && condition(this.source.charCodeAt(this.position))) {
this.position++;
}
return this.position - posNow;
}
}
const _BNG = '!'.charCodeAt(0);
const _MIN = '-'.charCodeAt(0);
const _LAN = '<'.charCodeAt(0);
const _RAN = '>'.charCodeAt(0);
const _FSL = '/'.charCodeAt(0);
const _EQS = '='.charCodeAt(0);
const _DQO = '"'.charCodeAt(0);
const _SQO = '\''.charCodeAt(0);
const _NWL = '\n'.charCodeAt(0);
const _CAR = '\r'.charCodeAt(0);
const _LFD = '\f'.charCodeAt(0);
const _WSP = ' '.charCodeAt(0);
const _TAB = '\t'.charCodeAt(0);
export enum ScannerState {
Content,
OpeningStartTag,
OpeningEndTag,
WithinDoctype,
WithinTag,
WithinComment,
WithinScriptContent,
WithinStyleContent,
AttributeName,
AttributeValue
}
export class Scanner {
private _stream: MultiLineStream;
private _state: ScannerState;
private _tokenType: TokenType;
private _tokenOffset: number;
private _hasSpaceAfterTag: boolean;
private _lastTag: string;
public setSource(input: string, initialState: ScannerState = ScannerState.Content): void {
this._stream = new MultiLineStream(input);
this._state = initialState;
}
public get position(): number {
return this._stream.pos();
}
public get scannerState(): number {
return this._state;
}
public get tokenType(): number {
return this._tokenType;
}
public get tokenOffset(): number {
return this._tokenOffset;
}
public get tokenLength(): number {
return this._stream.pos() - this._tokenOffset;
}
private nextElementName(): string {
return this._stream.advanceIfRegExp(/^[_:\w][_:\w-.\d]*/).toLowerCase();
}
private nextAttributeName(): string {
return this._stream.advanceIfRegExp(/^[^\s"'>/=\x00-\x0F\x7F\x80-\x9F]*/).toLowerCase();
}
private finishToken(offset: number, type: TokenType): IToken {
this._tokenType = type;
this._tokenOffset = offset;
return {
offset: offset,
len: this._stream.pos() - offset,
type: type
};
}
public scan(): IToken {
let offset = this._stream.pos();
if (this._stream.eos()) {
return this.finishToken(offset, TokenType.EOS);
}
switch (this._state) {
case ScannerState.WithinComment:
if (this._stream.advanceIfChars([_MIN, _MIN, _RAN])) { // -->
this._state = ScannerState.Content;
return this.finishToken(offset, TokenType.CommentEnd);
}
this._stream.advanceUntilChars([_MIN, _MIN, _RAN]); // -->
return this.finishToken(offset, TokenType.Comment);
case ScannerState.WithinDoctype:
if (this._stream.advanceIfChar(_RAN)) {
this._state = ScannerState.Content;
return this.finishToken(offset, TokenType.DoctypeEnd);
}
this._stream.advanceUntilChar(_RAN); // >
return this.finishToken(offset, TokenType.Doctype);
case ScannerState.Content:
if (this._stream.advanceIfChar(_LAN)) { // <
if (!this._stream.eos() && this._stream.peekChar() === _BNG) { // !
if (this._stream.advanceIfChars([_BNG, _MIN, _MIN])) { // <!--
this._state = ScannerState.WithinComment;
return this.finishToken(offset, TokenType.CommentStart);
}
if (this._stream.advanceIfRegExp(/^!doctype/i)) {
this._state = ScannerState.WithinDoctype;
return this.finishToken(offset, TokenType.DoctypeStart);
}
}
if (this._stream.advanceIfChar(_FSL)) { // /
this._state = ScannerState.OpeningEndTag;
return this.finishToken(offset, TokenType.TagEnd);
}
this._state = ScannerState.OpeningStartTag;
return this.finishToken(offset, TokenType.TagStart);
}
this._stream.advanceUntilChar(_LAN);
return this.finishToken(offset, TokenType.Content);
case ScannerState.OpeningEndTag:
let tagName = this.nextElementName();
if (tagName.length > 0) {
return this.finishToken(offset, TokenType.Tag);
} else if (this._stream.advanceIfChar(_RAN)) { // >
this._state = ScannerState.Content;
return this.finishToken(offset, TokenType.TagEnd);
}
this._stream.advanceUntilChar(_RAN);
return this.finishToken(offset, TokenType.Whitespace);
case ScannerState.OpeningStartTag:
this._lastTag = this.nextElementName();
if (this._lastTag.length > 0) {
this._hasSpaceAfterTag = false;
this._state = ScannerState.WithinTag;
return this.finishToken(offset, TokenType.Tag);
}
break;
case ScannerState.WithinTag:
if (this._stream.skipWhitespace()) {
this._hasSpaceAfterTag = true; // remember that we have seen a whitespace
return this.finishToken(offset, TokenType.Whitespace);
}
if (this._hasSpaceAfterTag) {
let name = this.nextAttributeName();
if (name.length > 0) {
this._state = ScannerState.AttributeName;
this._hasSpaceAfterTag = false;
return this.finishToken(offset, TokenType.AttributeName);
}
}
if (this._stream.advanceIfChars([_FSL, _RAN])) { // />
this._state = ScannerState.Content;
return this.finishToken(offset, TokenType.TagStart);
}
if (this._stream.advanceIfChar(_RAN)) { // >
if (this._lastTag === 'script') {
this._state = ScannerState.WithinScriptContent;
} else if (this._lastTag === 'style') {
this._state = ScannerState.WithinStyleContent;
} else {
this._state = ScannerState.Content;
}
return this.finishToken(offset, TokenType.TagStart);
}
this._stream.advance(1);
return this.finishToken(offset, TokenType.Unknown);
case ScannerState.AttributeName:
if (this._stream.skipWhitespace()) {
this._hasSpaceAfterTag = true;
return this.finishToken(offset, TokenType.Whitespace);
}
if (this._stream.advanceIfChar(_EQS)) {
this._state = ScannerState.AttributeValue;
return this.finishToken(offset, TokenType.DelimiterAssign);
}
this._state = ScannerState.WithinTag;
return this.scan(); // no advance yet - jump to WithinTag
case ScannerState.AttributeValue:
if (this._stream.skipWhitespace()) {
return this.finishToken(offset, TokenType.Whitespace);
}
let attributeValue = this._stream.advanceIfRegExp(/^[^\s"'`=<>]+/);
if (attributeValue.length > 0) {
this._state = ScannerState.WithinTag;
this._hasSpaceAfterTag = false;
return this.finishToken(offset, TokenType.AttributeValue);
}
let ch = this._stream.peekChar();
if (ch === _SQO || ch === _DQO) {
this._stream.advance(1); // consume quote
if (this._stream.advanceUntilChar(ch)) {
this._stream.advance(1); // consume quote
}
this._state = ScannerState.WithinTag;
this._hasSpaceAfterTag = false;
return this.finishToken(offset, TokenType.AttributeValue);
}
this._state = ScannerState.WithinTag;
this._hasSpaceAfterTag = false;
return this.scan(); // no advance yet - jump to WithinTag
case ScannerState.WithinScriptContent:
// see http://stackoverflow.com/questions/14574471/how-do-browsers-parse-a-script-tag-exactly
let state = 1;
while (!this._stream.eos()) {
let match = this._stream.advanceIfRegExp(/<!--|-->|<\/?script\s*\/?>?/i);
if (match.length === 0) {
this._stream.goToEnd();
return this.finishToken(offset, TokenType.Script);
} else if (match === '<!--') {
if (state === 1) {
state = 2;
}
} else if (match === '-->') {
state = 1;
} else if (match[1] !== '/') { // <script
if (state === 2) {
state = 3;
}
} else { // </script
if (state === 3) {
state = 2;
} else {
this._stream.goBack(match.length); // to the beginning of the closing tag
break;
}
}
}
this._state = ScannerState.Content;
if (offset < this._stream.pos()) {
return this.finishToken(offset, TokenType.Script);
}
return this.scan(); // no advance yet - jump to content
case ScannerState.WithinScriptContent:
this._stream.advanceUntilRegExp(/<\/style/i);
this._state = ScannerState.Content;
if (offset < this._stream.pos()) {
return this.finishToken(offset, TokenType.Styles);
}
return this.scan(); // no advance yet - jump to content
}
this._stream.advance(1);
this._state = ScannerState.Content;
return this.finishToken(offset, TokenType.Unknown);
}
}

View file

@ -0,0 +1,696 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as assert from 'assert';
import {Scanner, TokenType, ScannerState} from '../parser/htmlScanner';
suite('HTML Scanner', () => {
interface Token {
offset:number;
type:TokenType;
content?: string;
}
function assertTokens(tests: {input: string; tokens: Token[]; }[]) {
let scanner = new Scanner();
let scannerState = ScannerState.Content;
for (let t of tests) {
scanner.setSource(t.input, scannerState);
let token = scanner.scan();
let actual : Token[] = [];
while (token.type !== TokenType.EOS) {
let actualToken : Token= {offset: token.offset, type: token.type};
if (token.type == TokenType.Tag) {
actualToken.content = t.input.substr(token.offset, token.len);
}
actual.push(actualToken);
token = scanner.scan();
}
assert.deepEqual(actual, t.tokens);
scannerState = scanner.scannerState;
}
}
test('Open Start Tag #1', () => {
assertTokens([{
input: '<abc',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Tag, content: 'abc' }
]}
]);
});
test('Open Start Tag #2', () => {
assertTokens([{
input: '<input',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Tag, content: 'input' }
]}
]);
});
test('Open Start Tag with Invalid Tag', () => {
assertTokens([{
input: '< abc',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Unknown },
{ offset:2, type: TokenType.Content }
]}
]);
});
test('Open Start Tag #3', () => {
assertTokens([{
input: '< abc>',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Unknown },
{ offset:2, type: TokenType.Content }
]}
]);
});
test('Open Start Tag #4', () => {
assertTokens([{
input: 'i <len;',
tokens: [
{ offset:0, type: TokenType.Content },
{ offset:2, type: TokenType.TagStart },
{ offset:3, type: TokenType.Tag, content: 'len' },
{ offset:6, type: TokenType.Unknown }
]}
]);
});
test('Open Start Tag #5', () => {
assertTokens([{
input: '<',
tokens: [
{ offset:0, type: TokenType.TagStart }
]}
]);
});
test('Open End Tag', () => {
assertTokens([{
input: '</a',
tokens: [
{ offset:0, type: TokenType.TagEnd },
{ offset:2, type: TokenType.Tag, content: 'a' }
]}
]);
});
test('Complete Start Tag', () => {
assertTokens([{
input: '<abc>',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Tag, content: 'abc' },
{ offset:4, type: TokenType.TagStart }
]}
]);
});
test('Complete Start Tag with Whitespace', () => {
assertTokens([{
input: '<abc >',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Tag, content: 'abc' },
{ offset:4, type: TokenType.Whitespace },
{ offset:5, type: TokenType.TagStart }
]}
]);
});
test('bug 9809 - Complete Start Tag with Namespaceprefix', () => {
assertTokens([{
input: '<foo:bar>',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Tag, content: 'foo:bar' },
{ offset:8, type: TokenType.TagStart }
]}
]);
});
test('Complete End Tag', () => {
assertTokens([{
input: '</abc>',
tokens: [
{ offset:0, type: TokenType.TagEnd },
{ offset:2, type: TokenType.Tag, content: 'abc' },
{ offset:5, type: TokenType.TagEnd }
]}
]);
});
test('Complete End Tag with Whitespace', () => {
assertTokens([{
input: '</abc >',
tokens: [
{ offset:0, type: TokenType.TagEnd },
{ offset:2, type: TokenType.Tag, content: 'abc' },
{ offset:5, type: TokenType.Whitespace },
{ offset:7, type: TokenType.TagEnd }
]}
]);
});
test('Empty Tag', () => {
assertTokens([{
input: '<abc />',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Tag, content: 'abc' },
{ offset:4, type: TokenType.Whitespace },
{ offset:5, type: TokenType.TagStart }
]}
]);
});
test('Embedded Content #1', () => {
assertTokens([{
input: '<script type="text/javascript">var i= 10;</script>',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Tag, content: 'script' },
{ offset:7, type: TokenType.Whitespace },
{ offset:8, type: TokenType.AttributeName },
{ offset:12, type: TokenType.DelimiterAssign },
{ offset:13, type: TokenType.AttributeValue },
{ offset:30, type: TokenType.TagStart },
{ offset:31, type: TokenType.Script },
{ offset:41, type: TokenType.TagEnd },
{ offset:43, type: TokenType.Tag, content: 'script' },
{ offset:49, type: TokenType.TagEnd }
]}
]);
});
test('Embedded Content #2', () => {
assertTokens([{
input: '<script type="text/javascript">',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Tag, content: 'script' },
{ offset:7, type: TokenType.Whitespace },
{ offset:8, type: TokenType.AttributeName },
{ offset:12, type: TokenType.DelimiterAssign },
{ offset:13, type: TokenType.AttributeValue },
{ offset:30, type: TokenType.TagStart }
]}, {
input: 'var i= 10;',
tokens: [
{ offset:0, type: TokenType.Script }
]}, {
input: '</script>',
tokens: [
{ offset:0, type: TokenType.TagEnd },
{ offset:2, type: TokenType.Tag, content: 'script' },
{ offset:8, type: TokenType.TagEnd }
]}
]);
});
test('Embedded Content #3', () => {
assertTokens([{
input: '<script type="text/javascript">var i= 10;',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Tag, content: 'script' },
{ offset:7, type: TokenType.Whitespace },
{ offset:8, type: TokenType.AttributeName },
{ offset:12, type: TokenType.DelimiterAssign },
{ offset:13, type: TokenType.AttributeValue },
{ offset:30, type: TokenType.TagStart },
{ offset:31, type: TokenType.Script }
]}, {
input: '</script>',
tokens: [
{ offset:0, type: TokenType.TagEnd },
{ offset:2, type: TokenType.Tag, content: 'script' },
{ offset:8, type: TokenType.TagEnd }
]}
]);
});
test('Embedded Content #4', () => {
assertTokens([{
input: '<script type="text/javascript">',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Tag, content: 'script' },
{ offset:7, type: TokenType.Whitespace },
{ offset:8, type: TokenType.AttributeName },
{ offset:12, type: TokenType.DelimiterAssign },
{ offset:13, type: TokenType.AttributeValue },
{ offset:30, type: TokenType.TagStart }
]}, {
input: 'var i= 10;</script>',
tokens: [
{ offset:0, type: TokenType.Script },
{ offset:10, type: TokenType.TagEnd },
{ offset:12, type: TokenType.Tag, content: 'script' },
{ offset:18, type: TokenType.TagEnd }
]}
]);
});
test('Embedded Content #5', () => {
assertTokens([{
input: '<script type="text/plain">a\n<a</script>',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Tag, content: 'script' },
{ offset:7, type: TokenType.Whitespace },
{ offset:8, type: TokenType.AttributeName },
{ offset:12, type: TokenType.DelimiterAssign },
{ offset:13, type: TokenType.AttributeValue },
{ offset:25, type: TokenType.TagStart },
{ offset:26, type: TokenType.Script },
{ offset:30, type: TokenType.TagEnd },
{ offset:32, type: TokenType.Tag, content: 'script' },
{ offset:38, type: TokenType.TagEnd }
]}
]);
});
test('Embedded Content #6', () => {
assertTokens([{
input: '<script>a</script><script>b</script>',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Tag, content: 'script' },
{ offset:7, type: TokenType.TagStart },
{ offset:8, type: TokenType.Script },
{ offset:9, type: TokenType.TagEnd },
{ offset:11, type: TokenType.Tag, content: 'script' },
{ offset:17, type: TokenType.TagEnd },
{ offset:18, type: TokenType.TagStart },
{ offset:19, type: TokenType.Tag, content: 'script' },
{ offset:25, type: TokenType.TagStart },
{ offset:26, type: TokenType.Script },
{ offset:27, type: TokenType.TagEnd },
{ offset:29, type: TokenType.Tag, content: 'script' },
{ offset:35, type: TokenType.TagEnd }
]}
]);
});
test('Embedded Content #7', () => {
assertTokens([{
input: '<script type="text/javascript"></script>',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Tag, content: 'script' },
{ offset:7, type: TokenType.Whitespace },
{ offset:8, type: TokenType.AttributeName },
{ offset:12, type: TokenType.DelimiterAssign },
{ offset:13, type: TokenType.AttributeValue },
{ offset:30, type: TokenType.TagStart },
{ offset:31, type: TokenType.TagEnd },
{ offset:33, type: TokenType.Tag, content: 'script' },
{ offset:39, type: TokenType.TagEnd }
]}
]);
});
test('Embedded Content #8', () => {
assertTokens([{
input: '<script>var i= 10;</script>',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Tag, content: 'script' },
{ offset:7, type: TokenType.TagStart },
{ offset:8, type: TokenType.Script },
{ offset:18, type: TokenType.TagEnd },
{ offset:20, type: TokenType.Tag, content: 'script' },
{ offset:26, type: TokenType.TagEnd }
]}
]);
});
test('Embedded Content #9', () => {
assertTokens([{
input: '<script type="text/javascript" src="main.js"></script>',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Tag, content: 'script' },
{ offset:7, type: TokenType.Whitespace },
{ offset:8, type: TokenType.AttributeName },
{ offset:12, type: TokenType.DelimiterAssign },
{ offset:13, type: TokenType.AttributeValue },
{ offset:30, type: TokenType.Whitespace },
{ offset:31, type: TokenType.AttributeName },
{ offset:34, type: TokenType.DelimiterAssign },
{ offset:35, type: TokenType.AttributeValue },
{ offset:44, type: TokenType.TagStart },
{ offset:45, type: TokenType.TagEnd },
{ offset:47, type: TokenType.Tag, content: 'script' },
{ offset:53, type: TokenType.TagEnd }
]}
]);
});
test('Embedded Content #10', () => {
assertTokens([{
input: '<script><!-- alert("<script></script>"); --></script>',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Tag, content: 'script' },
{ offset:7, type: TokenType.TagStart },
{ offset:8, type: TokenType.Script },
{ offset:44, type: TokenType.TagEnd },
{ offset:46, type: TokenType.Tag, content: 'script' },
{ offset:52, type: TokenType.TagEnd }
]}
]);
});
test('Embedded Content #11', () => {
assertTokens([{
input: '<script><!-- alert("<script></script>"); </script>',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Tag, content: 'script' },
{ offset:7, type: TokenType.TagStart },
{ offset:8, type: TokenType.Script },
{ offset:41, type: TokenType.TagEnd },
{ offset:43, type: TokenType.Tag, content: 'script' },
{ offset:49, type: TokenType.TagEnd }
]}
]);
});
test('Embedded Content #12', () => {
assertTokens([{
input: '<script><!-- alert("</script>"); </script>',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Tag, content: 'script' },
{ offset:7, type: TokenType.TagStart },
{ offset:8, type: TokenType.Script },
{ offset:20, type: TokenType.TagEnd },
{ offset:22, type: TokenType.Tag, content: 'script' },
{ offset:28, type: TokenType.TagEnd },
{ offset:29, type: TokenType.Content },
{ offset:33, type: TokenType.TagEnd },
{ offset:35, type: TokenType.Tag, content: 'script' },
{ offset:41, type: TokenType.TagEnd }
]}
]);
});
test('Embedded Content #13', () => {
assertTokens([{
input: '<script> alert("<script></script>"); </script>',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Tag, content: 'script' },
{ offset:7, type: TokenType.TagStart },
{ offset:8, type: TokenType.Script },
{ offset:24, type: TokenType.TagEnd },
{ offset:26, type: TokenType.Tag, content: 'script' },
{ offset:32, type: TokenType.TagEnd },
{ offset:33, type: TokenType.Content },
{ offset:37, type: TokenType.TagEnd },
{ offset:39, type: TokenType.Tag, content: 'script' },
{ offset:45, type: TokenType.TagEnd }
]}
]);
});
test('Tag with Attribute', () => {
assertTokens([{
input: '<abc foo="bar">',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Tag, content: 'abc' },
{ offset:4, type: TokenType.Whitespace },
{ offset:5, type: TokenType.AttributeName },
{ offset:8, type: TokenType.DelimiterAssign },
{ offset:9, type: TokenType.AttributeValue },
{ offset:14, type: TokenType.TagStart }
]}
]);
});
test('Tag with Empty Attribute Value', () => {
assertTokens([{
input: '<abc foo=\'bar\'>',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Tag, content: 'abc' },
{ offset:4, type: TokenType.Whitespace },
{ offset:5, type: TokenType.AttributeName },
{ offset:8, type: TokenType.DelimiterAssign },
{ offset:9, type: TokenType.AttributeValue },
{ offset:14, type: TokenType.TagStart }
]}
]);
});
test('Tag with empty attributes', () => {
assertTokens([{
input: '<abc foo="">',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Tag, content: 'abc' },
{ offset:4, type: TokenType.Whitespace },
{ offset:5, type: TokenType.AttributeName },
{ offset:8, type: TokenType.DelimiterAssign },
{ offset:9, type: TokenType.AttributeValue },
{ offset:11, type: TokenType.TagStart }
]}
]);
});
test('Tag with Attributes', () => {
assertTokens([{
input: '<abc foo="bar" bar=\'foo\'>',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Tag, content: 'abc' },
{ offset:4, type: TokenType.Whitespace },
{ offset:5, type: TokenType.AttributeName },
{ offset:8, type: TokenType.DelimiterAssign },
{ offset:9, type: TokenType.AttributeValue },
{ offset:14, type: TokenType.Whitespace },
{ offset:15, type: TokenType.AttributeName },
{ offset:18, type: TokenType.DelimiterAssign },
{ offset:19, type: TokenType.AttributeValue },
{ offset:24, type: TokenType.TagStart }
]}
]);
});
test('Tag with Attributes, no quotes', () => {
assertTokens([{
input: '<abc foo=bar bar=help-me>',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Tag, content: 'abc' },
{ offset:4, type: TokenType.Whitespace },
{ offset:5, type: TokenType.AttributeName },
{ offset:8, type: TokenType.DelimiterAssign },
{ offset:9, type: TokenType.AttributeValue },
{ offset:12, type: TokenType.Whitespace },
{ offset:13, type: TokenType.AttributeName },
{ offset:16, type: TokenType.DelimiterAssign },
{ offset:17, type: TokenType.AttributeValue },
{ offset:24, type: TokenType.TagStart }
]}
]);
});
test('Tag with Attribute And Whitespace', () => {
assertTokens([{
input: '<abc foo= "bar">',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Tag, content: 'abc' },
{ offset:4, type: TokenType.Whitespace },
{ offset:5, type: TokenType.AttributeName },
{ offset:8, type: TokenType.DelimiterAssign },
{ offset:9, type: TokenType.Whitespace },
{ offset:11, type: TokenType.AttributeValue },
{ offset:16, type: TokenType.TagStart }
]}
]);
});
test('Tag with Attribute And Whitespace #2', () => {
assertTokens([{
input: '<abc foo = "bar">',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Tag, content: 'abc' },
{ offset:4, type: TokenType.Whitespace },
{ offset:5, type: TokenType.AttributeName },
{ offset:8, type: TokenType.Whitespace },
{ offset:9, type: TokenType.DelimiterAssign },
{ offset:10, type: TokenType.Whitespace },
{ offset:11, type: TokenType.AttributeValue },
{ offset:16, type: TokenType.TagStart }
]}
]);
});
test('Tag with Name-Only-Attribute #1', () => {
assertTokens([{
input: '<abc foo>',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Tag, content: 'abc' },
{ offset:4, type: TokenType.Whitespace },
{ offset:5, type: TokenType.AttributeName },
{ offset:8, type: TokenType.TagStart }
]}
]);
});
test('Tag with Name-Only-Attribute #2', () => {
assertTokens([{
input: '<abc foo bar>',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Tag, content: 'abc' },
{ offset:4, type: TokenType.Whitespace },
{ offset:5, type: TokenType.AttributeName },
{ offset:8, type: TokenType.Whitespace },
{ offset:9, type: TokenType.AttributeName },
{ offset:12, type: TokenType.TagStart }
]}
]);
});
test('Tag with Interesting Attribute Name', () => {
assertTokens([{
input: '<abc foo!@#="bar">',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Tag, content: 'abc' },
{ offset:4, type: TokenType.Whitespace },
{ offset:5, type: TokenType.AttributeName },
{ offset:11, type: TokenType.DelimiterAssign },
{ offset:12, type: TokenType.AttributeValue },
{ offset:17, type: TokenType.TagStart }
]}
]);
});
test('Tag with Angular Attribute Name', () => {
assertTokens([{
input: '<abc #myinput (click)="bar" [value]="someProperty" *ngIf="someCondition">',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Tag, content: 'abc' },
{ offset:4, type: TokenType.Whitespace },
{ offset:5, type: TokenType.AttributeName },
{ offset:13, type: TokenType.Whitespace },
{ offset:14, type: TokenType.AttributeName },
{ offset:21, type: TokenType.DelimiterAssign },
{ offset:22, type: TokenType.AttributeValue },
{ offset:27, type: TokenType.Whitespace },
{ offset:28, type: TokenType.AttributeName },
{ offset:35, type: TokenType.DelimiterAssign },
{ offset:36, type: TokenType.AttributeValue },
{ offset:50, type: TokenType.Whitespace },
{ offset:51, type: TokenType.AttributeName },
{ offset:56, type: TokenType.DelimiterAssign },
{ offset:57, type: TokenType.AttributeValue },
{ offset:72, type: TokenType.TagStart }
]}
]);
});
test('Tag with Invalid Attribute Value', () => {
assertTokens([{
input: '<abc foo=">',
tokens: [
{ offset:0, type: TokenType.TagStart },
{ offset:1, type: TokenType.Tag, content: 'abc' },
{ offset:4, type: TokenType.Whitespace },
{ offset:5, type: TokenType.AttributeName },
{ offset:8, type: TokenType.DelimiterAssign },
{ offset:9, type: TokenType.AttributeValue }
]}
]);
});
test('Simple Comment 1', () => {
assertTokens([{
input: '<!--a-->',
tokens: [
{ offset:0, type: TokenType.CommentStart },
{ offset:4, type: TokenType.Comment },
{ offset:5, type: TokenType.CommentEnd }
]}
]);
});
test('Simple Comment 2', () => {
assertTokens([{
input: '<!--a>foo bar</a -->',
tokens: [
{ offset:0, type: TokenType.CommentStart },
{ offset:4, type: TokenType.Comment },
{ offset:17, type: TokenType.CommentEnd }
]}
]);
});
test('Multiline Comment', () => {
assertTokens([{
input: '<!--a>\nfoo \nbar</a -->',
tokens: [
{ offset:0, type: TokenType.CommentStart },
{ offset:4, type: TokenType.Comment },
{ offset:19, type: TokenType.CommentEnd }
]}
]);
});
test('Simple Doctype', () => {
assertTokens([{
input: '<!Doctype a>',
tokens: [
{ offset:0, type: TokenType.DoctypeStart },
{ offset:9, type: TokenType.Doctype },
{ offset:11, type: TokenType.DoctypeEnd }
]}
]);
});
test('Simple Doctype #2', () => {
assertTokens([{
input: '<!doctype a>',
tokens: [
{ offset:0, type: TokenType.DoctypeStart },
{ offset:9, type: TokenType.Doctype },
{ offset:11, type: TokenType.DoctypeEnd }
]}
]);
});
test('Simple Doctype #4', () => {
assertTokens([{
input: '<!DOCTYPE a\n"foo" \'bar\'>',
tokens: [
{ offset:0, type: TokenType.DoctypeStart },
{ offset:9, type: TokenType.Doctype },
{ offset:23, type: TokenType.DoctypeEnd }
]}
]);
});
});

View file

@ -0,0 +1,112 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/**
* The Thenable (E.g. PromiseLike) and Promise declarions are taken from TypeScript's
* lib.core.es6.d.ts file. See above Copyright notice.
*/
/**
* Thenable is a common denominator between ES6 promises, Q, jquery.Deferred, WinJS.Promise,
* and others. This API makes no assumption about what promise libary is being used which
* enables reusing existing code without migrating to a specific promise implementation. Still,
* we recommand the use of native promises which are available in VS Code.
*/
interface Thenable<R> {
/**
* Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved.
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of which ever callback is executed.
*/
then<TResult>(onfulfilled?: (value: R) => TResult | Thenable<TResult>, onrejected?: (reason: any) => TResult | Thenable<TResult>): Thenable<TResult>;
then<TResult>(onfulfilled?: (value: R) => TResult | Thenable<TResult>, onrejected?: (reason: any) => void): Thenable<TResult>;
}
/**
* Represents the completion of an asynchronous operation
*/
interface Promise<T> extends Thenable<T> {
/**
* Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved.
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of which ever callback is executed.
*/
then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => TResult | Thenable<TResult>): Promise<TResult>;
then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => void): Promise<TResult>;
/**
* Attaches a callback for only the rejection of the Promise.
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of the callback.
*/
catch(onrejected?: (reason: any) => T | Thenable<T>): Promise<T>;
}
interface PromiseConstructor {
/**
* Creates a new Promise.
* @param executor A callback used to initialize the promise. This callback is passed two arguments:
* a resolve callback used resolve the promise with a value or the result of another promise,
* and a reject callback used to reject the promise with a provided reason or error.
*/
new <T>(executor: (resolve: (value?: T | Thenable<T>) => void, reject: (reason?: any) => void) => void): Promise<T>;
/**
* Creates a Promise that is resolved with an array of results when all of the provided Promises
* resolve, or rejected when any Promise is rejected.
* @param values An array of Promises.
* @returns A new Promise.
*/
all<T>(values: Array<T | Thenable<T>>): Promise<T[]>;
/**
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
* or rejected.
* @param values An array of Promises.
* @returns A new Promise.
*/
race<T>(values: Array<T | Thenable<T>>): Promise<T>;
/**
* Creates a new rejected promise for the provided reason.
* @param reason The reason the promise was rejected.
* @returns A new rejected Promise.
*/
reject(reason: any): Promise<void>;
/**
* Creates a new rejected promise for the provided reason.
* @param reason The reason the promise was rejected.
* @returns A new rejected Promise.
*/
reject<T>(reason: any): Promise<T>;
/**
* Creates a new resolved promise for the provided value.
* @param value A promise.
* @returns A promise whose internal state matches the provided promise.
*/
resolve<T>(value: T | Thenable<T>): Promise<T>;
/**
* Creates a new resolved promise .
* @returns A resolved promise.
*/
resolve(): Promise<void>;
}
declare var Promise: PromiseConstructor;

View file

@ -0,0 +1,8 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference path='../../../../../src/typings/mocha.d.ts'/>
/// <reference path='../../../../../extensions/node.d.ts'/>
/// <reference path='../../../../../extensions/lib.core.d.ts'/>
/// <reference path='../../../../../extensions/declares.d.ts'/>

View file

@ -0,0 +1,37 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
export function startsWith(haystack: string, needle: string): boolean {
if (haystack.length < needle.length) {
return false;
}
for (let i = 0; i < needle.length; i++) {
if (haystack[i] !== needle[i]) {
return false;
}
}
return true;
}
/**
* Determines if haystack ends with needle.
*/
export function endsWith(haystack: string, needle: string): boolean {
let diff = haystack.length - needle.length;
if (diff > 0) {
return haystack.lastIndexOf(needle) === diff;
} else if (diff === 0) {
return haystack === needle;
} else {
return false;
}
}
export function convertSimple2RegExpPattern(pattern: string): string {
return pattern.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g, '\\$&').replace(/[\*]/g, '.*');
}

View file

@ -0,0 +1,3 @@
--ui tdd
--useColors true
./out/service/test

View file

@ -0,0 +1,13 @@
{
"compilerOptions": {
"noLib": true,
"target": "es5",
"module": "commonjs",
"sourceMap": true,
"sourceRoot": "../src",
"outDir": "./out"
},
"exclude": [
"node_modules"
]
}

View file

@ -1,855 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>html</string>
<string>htm</string>
<string>shtml</string>
<string>xhtml</string>
<string>inc</string>
<string>tmpl</string>
<string>tpl</string>
</array>
<key>firstLineMatch</key>
<string>&lt;(?i:(!DOCTYPE\s*)?html)</string>
<key>injections</key>
<dict>
<key>R:text.html - comment.block</key>
<dict>
<key>comment</key>
<string>Use R: to ensure this matches after any other injections.</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>&lt;</string>
<key>name</key>
<string>invalid.illegal.bad-angle-bracket.html</string>
</dict>
</array>
</dict>
</dict>
<key>keyEquivalent</key>
<string>^~H</string>
<key>name</key>
<string>HTML</string>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>(&lt;)([a-zA-Z0-9:]++)(?=[^&gt;]*&gt;&lt;/\2&gt;)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.tag.html</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>entity.name.tag.html</string>
</dict>
</dict>
<key>end</key>
<string>(&gt;(&lt;)/)(\2)(&gt;)</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.tag.html</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>meta.scope.between-tag-pair.html</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>entity.name.tag.html</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>punctuation.definition.tag.html</string>
</dict>
</dict>
<key>name</key>
<string>meta.tag.any.html</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#tag-stuff</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>(&lt;\?)(xml)</string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.tag.html</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>entity.name.tag.xml.html</string>
</dict>
</dict>
<key>end</key>
<string>(\?&gt;)</string>
<key>name</key>
<string>meta.tag.preprocessor.xml.html</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#tag-generic-attribute</string>
</dict>
<dict>
<key>include</key>
<string>#string-double-quoted</string>
</dict>
<dict>
<key>include</key>
<string>#string-single-quoted</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>&lt;!--</string>
<key>captures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.html</string>
</dict>
</dict>
<key>end</key>
<string>--\s*&gt;</string>
<key>name</key>
<string>comment.block.html</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>--</string>
<key>name</key>
<string>invalid.illegal.bad-comments-or-CDATA.html</string>
</dict>
<dict>
<key>include</key>
<string>#embedded-code</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>&lt;!</string>
<key>captures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.tag.html</string>
</dict>
</dict>
<key>end</key>
<string>&gt;</string>
<key>name</key>
<string>meta.tag.sgml.html</string>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>(?i:DOCTYPE)</string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>entity.name.tag.doctype.html</string>
</dict>
</dict>
<key>end</key>
<string>(?=&gt;)</string>
<key>name</key>
<string>meta.tag.sgml.doctype.html</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>"[^"&gt;]*"</string>
<key>name</key>
<string>string.quoted.double.doctype.identifiers-and-DTDs.html</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>\[CDATA\[</string>
<key>end</key>
<string>]](?=&gt;)</string>
<key>name</key>
<string>constant.other.inline-data.html</string>
</dict>
<dict>
<key>match</key>
<string>(\s*)(?!--|&gt;)\S(\s*)</string>
<key>name</key>
<string>invalid.illegal.bad-comments-or-CDATA.html</string>
</dict>
</array>
</dict>
<dict>
<key>include</key>
<string>#embedded-code</string>
</dict>
<dict>
<key>begin</key>
<string>(?:^\s+)?(&lt;)((?i:style))\b(?![^&gt;]*/&gt;)</string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.tag.html</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>entity.name.tag.style.html</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>punctuation.definition.tag.html</string>
</dict>
</dict>
<key>end</key>
<string>(&lt;/)((?i:style))(&gt;)(?:\s*\n)?</string>
<key>name</key>
<string>source.css.embedded.html</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#tag-stuff</string>
</dict>
<dict>
<key>begin</key>
<string>(&gt;)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.tag.html</string>
</dict>
</dict>
<key>end</key>
<string>(?=&lt;/(?i:style))</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#embedded-code</string>
</dict>
<dict>
<key>include</key>
<string>source.css</string>
</dict>
</array>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>(?:^\s+)?(&lt;)((?i:script))\b(?![^&gt;]*/&gt;)(?![^&gt;]*(?i:type.?=.?text/((?!javascript).*)))</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.tag.html</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>entity.name.tag.script.html</string>
</dict>
</dict>
<key>end</key>
<string>(?&lt;=&lt;/(script|SCRIPT))(&gt;)(?:\s*\n)?</string>
<key>endCaptures</key>
<dict>
<key>2</key>
<dict>
<key>name</key>
<string>punctuation.definition.tag.html</string>
</dict>
</dict>
<key>name</key>
<string>source.js.embedded.html</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#tag-stuff</string>
</dict>
<dict>
<key>begin</key>
<string>(?&lt;!&lt;/(?:script|SCRIPT))(&gt;)</string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.tag.html</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>entity.name.tag.script.html</string>
</dict>
</dict>
<key>end</key>
<string>(&lt;/)((?i:script))</string>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.js</string>
</dict>
</dict>
<key>match</key>
<string>(//).*?((?=&lt;/script)|$\n?)</string>
<key>name</key>
<string>comment.line.double-slash.js</string>
</dict>
<dict>
<key>begin</key>
<string>/\*</string>
<key>captures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.js</string>
</dict>
</dict>
<key>end</key>
<string>\*/|(?=&lt;/script)</string>
<key>name</key>
<string>comment.block.js</string>
</dict>
<dict>
<key>include</key>
<string>source.js</string>
</dict>
</array>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>(&lt;/?)((?i:body|head|html)\b)</string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.tag.html</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>entity.name.tag.structure.any.html</string>
</dict>
</dict>
<key>end</key>
<string>(&gt;)</string>
<key>name</key>
<string>meta.tag.structure.any.html</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#tag-stuff</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>(&lt;/?)((?i:address|blockquote|dd|div|section|article|aside|header|footer|nav|menu|dl|dt|fieldset|form|frame|frameset|h1|h2|h3|h4|h5|h6|iframe|noframes|object|ol|p|ul|applet|center|dir|hr|pre)\b)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.tag.begin.html</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>entity.name.tag.block.any.html</string>
</dict>
</dict>
<key>end</key>
<string>(&gt;)</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.tag.end.html</string>
</dict>
</dict>
<key>name</key>
<string>meta.tag.block.any.html</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#tag-stuff</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>(&lt;/?)((?i:a|abbr|acronym|area|b|base|basefont|bdo|big|br|button|caption|cite|code|col|colgroup|del|dfn|em|font|head|html|i|img|input|ins|isindex|kbd|label|legend|li|link|map|meta|noscript|optgroup|option|param|q|s|samp|script|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|title|tr|tt|u|var)\b)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.tag.begin.html</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>entity.name.tag.inline.any.html</string>
</dict>
</dict>
<key>end</key>
<string>((?: ?/)?&gt;)</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.tag.end.html</string>
</dict>
</dict>
<key>name</key>
<string>meta.tag.inline.any.html</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#tag-stuff</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>(&lt;/?)([a-zA-Z0-9:]+)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.tag.begin.html</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>entity.name.tag.other.html</string>
</dict>
</dict>
<key>end</key>
<string>(&gt;)</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.tag.end.html</string>
</dict>
</dict>
<key>name</key>
<string>meta.tag.other.html</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#tag-stuff</string>
</dict>
</array>
</dict>
<dict>
<key>include</key>
<string>#entities</string>
</dict>
<dict>
<key>match</key>
<string>&lt;&gt;</string>
<key>name</key>
<string>invalid.illegal.incomplete.html</string>
</dict>
</array>
<key>repository</key>
<dict>
<key>embedded-code</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#smarty</string>
</dict>
<dict>
<key>include</key>
<string>#python</string>
</dict>
</array>
</dict>
<key>entities</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.entity.html</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>punctuation.definition.entity.html</string>
</dict>
</dict>
<key>match</key>
<string>(&amp;)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)</string>
<key>name</key>
<string>constant.character.entity.html</string>
</dict>
<dict>
<key>match</key>
<string>&amp;</string>
<key>name</key>
<string>invalid.illegal.bad-ampersand.html</string>
</dict>
</array>
</dict>
<key>python</key>
<dict>
<key>begin</key>
<string>(?:^\s*)&lt;\?python(?!.*\?&gt;)</string>
<key>end</key>
<string>\?&gt;(?:\s*$\n)?</string>
<key>name</key>
<string>source.python.embedded.html</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>source.python</string>
</dict>
</array>
</dict>
<key>smarty</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>(\{(literal)\})</string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>source.smarty.embedded.html</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>support.function.built-in.smarty</string>
</dict>
</dict>
<key>end</key>
<string>(\{/(literal)\})</string>
</dict>
<dict>
<key>begin</key>
<string>{{|{</string>
<key>disabled</key>
<integer>1</integer>
<key>end</key>
<string>}}|}</string>
<key>name</key>
<string>source.smarty.embedded.html</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>source.smarty</string>
</dict>
</array>
</dict>
</array>
</dict>
<key>string-double-quoted</key>
<dict>
<key>begin</key>
<string>"</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.html</string>
</dict>
</dict>
<key>end</key>
<string>"</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.html</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.double.html</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#embedded-code</string>
</dict>
<dict>
<key>include</key>
<string>#entities</string>
</dict>
</array>
</dict>
<key>string-single-quoted</key>
<dict>
<key>begin</key>
<string>'</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.html</string>
</dict>
</dict>
<key>end</key>
<string>'</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.html</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.single.html</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#embedded-code</string>
</dict>
<dict>
<key>include</key>
<string>#entities</string>
</dict>
</array>
</dict>
<key>tag-generic-attribute</key>
<dict>
<key>match</key>
<string>(?&lt;=[^=])\b([a-zA-Z0-9:-]+)</string>
<key>name</key>
<string>entity.other.attribute-name.html</string>
</dict>
<key>tag-id-attribute</key>
<dict>
<key>begin</key>
<string>\b(id)\b\s*(=)</string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>entity.other.attribute-name.id.html</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>punctuation.separator.key-value.html</string>
</dict>
</dict>
<key>end</key>
<string>(?!\G)(?&lt;='|"|[^\s&lt;&gt;/])</string>
<key>name</key>
<string>meta.attribute-with-value.id.html</string>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>"</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.html</string>
</dict>
</dict>
<key>contentName</key>
<string>meta.toc-list.id.html</string>
<key>end</key>
<string>"</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.html</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.double.html</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#embedded-code</string>
</dict>
<dict>
<key>include</key>
<string>#entities</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>'</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.html</string>
</dict>
</dict>
<key>contentName</key>
<string>meta.toc-list.id.html</string>
<key>end</key>
<string>'</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.html</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.single.html</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#embedded-code</string>
</dict>
<dict>
<key>include</key>
<string>#entities</string>
</dict>
</array>
</dict>
<dict>
<key>captures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>meta.toc-list.id.html</string>
</dict>
</dict>
<key>match</key>
<string>(?&lt;==)(?:[^\s&lt;&gt;/'"]|/(?!&gt;))+</string>
<key>name</key>
<string>string.unquoted.html</string>
</dict>
</array>
</dict>
<key>tag-stuff</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#tag-id-attribute</string>
</dict>
<dict>
<key>include</key>
<string>#tag-generic-attribute</string>
</dict>
<dict>
<key>include</key>
<string>#string-double-quoted</string>
</dict>
<dict>
<key>include</key>
<string>#string-single-quoted</string>
</dict>
<dict>
<key>include</key>
<string>#embedded-code</string>
</dict>
<dict>
<key>include</key>
<string>#unquoted-attribute</string>
</dict>
</array>
</dict>
<key>unquoted-attribute</key>
<dict>
<key>match</key>
<string>(?&lt;==)(?:[^\s&lt;&gt;/'"]|/(?!&gt;))+</string>
<key>name</key>
<string>string.unquoted.html</string>
</dict>
</dict>
<key>scopeName</key>
<string>text.html.basic</string>
<key>uuid</key>
<string>17994EC8-6B1D-11D9-AC3A-000D93589AF6</string>
</dict>
</plist>

View file

@ -0,0 +1,553 @@
{
"fileTypes": [
"html",
"htm",
"shtml",
"xhtml",
"inc",
"tmpl",
"tpl"
],
"firstLineMatch": "<(?i:(!DOCTYPE\\s*)?html)",
"injections": {
"R:text.html - comment.block": {
"comment": "Use R: to ensure this matches after any other injections.",
"patterns": [
{
"match": "<",
"name": "invalid.illegal.bad-angle-bracket.html"
}
]
}
},
"keyEquivalent": "^~H",
"name": "HTML",
"patterns": [
{
"begin": "(<)([a-zA-Z0-9:]++)(?=[^>]*></\\2>)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.html"
},
"2": {
"name": "entity.name.tag.html"
}
},
"end": "(>(<)/)(\\2)(>)",
"endCaptures": {
"1": {
"name": "punctuation.definition.tag.html"
},
"2": {
"name": "meta.scope.between-tag-pair.html"
},
"3": {
"name": "entity.name.tag.html"
},
"4": {
"name": "punctuation.definition.tag.html"
}
},
"name": "meta.tag.any.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},
{
"begin": "(<\\?)(xml)",
"captures": {
"1": {
"name": "punctuation.definition.tag.html"
},
"2": {
"name": "entity.name.tag.xml.html"
}
},
"end": "(\\?>)",
"name": "meta.tag.preprocessor.xml.html",
"patterns": [
{
"include": "#tag-generic-attribute"
},
{
"include": "#string-double-quoted"
},
{
"include": "#string-single-quoted"
}
]
},
{
"begin": "<!--",
"captures": {
"0": {
"name": "punctuation.definition.comment.html"
}
},
"end": "--\\s*>",
"name": "comment.block.html",
"patterns": [
{
"match": "--",
"name": "invalid.illegal.bad-comments-or-CDATA.html"
},
{
"include": "#embedded-code"
}
]
},
{
"begin": "<!",
"captures": {
"0": {
"name": "punctuation.definition.tag.html"
}
},
"end": ">",
"name": "meta.tag.sgml.html",
"patterns": [
{
"begin": "(?i:DOCTYPE)",
"captures": {
"1": {
"name": "entity.name.tag.doctype.html"
}
},
"end": "(?=>)",
"name": "meta.tag.sgml.doctype.html",
"patterns": [
{
"match": "\"[^\">]*\"",
"name": "string.quoted.double.doctype.identifiers-and-DTDs.html"
}
]
},
{
"begin": "\\[CDATA\\[",
"end": "]](?=>)",
"name": "constant.other.inline-data.html"
},
{
"match": "(\\s*)(?!--|>)\\S(\\s*)",
"name": "invalid.illegal.bad-comments-or-CDATA.html"
}
]
},
{
"include": "#embedded-code"
},
{
"begin": "(?:^\\s+)?(<)((?i:style))\\b(?![^>]*/>)",
"captures": {
"1": {
"name": "punctuation.definition.tag.html"
},
"2": {
"name": "entity.name.tag.style.html"
},
"3": {
"name": "punctuation.definition.tag.html"
}
},
"end": "(</)((?i:style))(>)(?:\\s*\\n)?",
"name": "source.css.embedded.html",
"patterns": [
{
"include": "#tag-stuff"
},
{
"begin": "(>)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.html"
}
},
"end": "(?=</(?i:style))",
"patterns": [
{
"include": "#embedded-code"
},
{
"include": "source.css"
}
]
}
]
},
{
"begin": "(?:^\\s+)?(<)((?i:script))\\b(?![^>]*/>)(?![^>]*(?i:type.?=.?text/((?!javascript).*)))",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.html"
},
"2": {
"name": "entity.name.tag.script.html"
}
},
"end": "(?<=</(script|SCRIPT))(>)(?:\\s*\\n)?",
"endCaptures": {
"2": {
"name": "punctuation.definition.tag.html"
}
},
"name": "source.js.embedded.html",
"patterns": [
{
"include": "#tag-stuff"
},
{
"begin": "(?<!</(?:script|SCRIPT))(>)",
"captures": {
"1": {
"name": "punctuation.definition.tag.html"
},
"2": {
"name": "entity.name.tag.script.html"
}
},
"end": "(</)((?i:script))",
"patterns": [
{
"captures": {
"1": {
"name": "punctuation.definition.comment.js"
}
},
"match": "(//).*?((?=</script)|$\\n?)",
"name": "comment.line.double-slash.js"
},
{
"begin": "/\\*",
"captures": {
"0": {
"name": "punctuation.definition.comment.js"
}
},
"end": "\\*/|(?=</script)",
"name": "comment.block.js"
},
{
"include": "source.js"
}
]
}
]
},
{
"begin": "(</?)((?i:body|head|html)\\b)",
"captures": {
"1": {
"name": "punctuation.definition.tag.html"
},
"2": {
"name": "entity.name.tag.structure.any.html"
}
},
"end": "(>)",
"name": "meta.tag.structure.any.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},
{
"begin": "(</?)((?i:address|blockquote|dd|div|section|article|aside|header|footer|nav|menu|dl|dt|fieldset|form|frame|frameset|h1|h2|h3|h4|h5|h6|iframe|noframes|object|ol|p|ul|applet|center|dir|hr|pre)\\b)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.block.any.html"
}
},
"end": "(>)",
"endCaptures": {
"1": {
"name": "punctuation.definition.tag.end.html"
}
},
"name": "meta.tag.block.any.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},
{
"begin": "(</?)((?i:a|abbr|acronym|area|b|base|basefont|bdo|big|br|button|caption|cite|code|col|colgroup|del|dfn|em|font|head|html|i|img|input|ins|isindex|kbd|label|legend|li|link|map|meta|noscript|optgroup|option|param|q|s|samp|script|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|title|tr|tt|u|var)\\b)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.inline.any.html"
}
},
"end": "((?: ?/)?>)",
"endCaptures": {
"1": {
"name": "punctuation.definition.tag.end.html"
}
},
"name": "meta.tag.inline.any.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},
{
"begin": "(</?)([a-zA-Z0-9:]+)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.other.html"
}
},
"end": "(>)",
"endCaptures": {
"1": {
"name": "punctuation.definition.tag.end.html"
}
},
"name": "meta.tag.other.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},
{
"include": "#entities"
},
{
"match": "<>",
"name": "invalid.illegal.incomplete.html"
}
],
"repository": {
"embedded-code": {
"patterns": [
{
"include": "#smarty"
},
{
"include": "#python"
}
]
},
"entities": {
"patterns": [
{
"captures": {
"1": {
"name": "punctuation.definition.entity.html"
},
"3": {
"name": "punctuation.definition.entity.html"
}
},
"match": "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)",
"name": "constant.character.entity.html"
},
{
"match": "&",
"name": "invalid.illegal.bad-ampersand.html"
}
]
},
"python": {
"begin": "(?:^\\s*)<\\?python(?!.*\\?>)",
"end": "\\?>(?:\\s*$\\n)?",
"name": "source.python.embedded.html",
"patterns": [
{
"include": "source.python"
}
]
},
"smarty": {
"patterns": [
{
"begin": "(\\{(literal)\\})",
"captures": {
"1": {
"name": "source.smarty.embedded.html"
},
"2": {
"name": "support.function.built-in.smarty"
}
},
"end": "(\\{/(literal)\\})"
},
{
"begin": "{{|{",
"disabled": 1,
"end": "}}|}",
"name": "source.smarty.embedded.html",
"patterns": [
{
"include": "source.smarty"
}
]
}
]
},
"string-double-quoted": {
"begin": "\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.html"
}
},
"end": "\"",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.html"
}
},
"name": "string.quoted.double.html",
"patterns": [
{
"include": "#embedded-code"
},
{
"include": "#entities"
}
]
},
"string-single-quoted": {
"begin": "'",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.html"
}
},
"end": "'",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.html"
}
},
"name": "string.quoted.single.html",
"patterns": [
{
"include": "#embedded-code"
},
{
"include": "#entities"
}
]
},
"tag-generic-attribute": {
"match": "(?<=[^=])\\b([a-zA-Z0-9:-]+)",
"name": "entity.other.attribute-name.html"
},
"tag-id-attribute": {
"begin": "\\b(id)\\b\\s*(=)",
"captures": {
"1": {
"name": "entity.other.attribute-name.id.html"
},
"2": {
"name": "punctuation.separator.key-value.html"
}
},
"end": "(?!\\G)(?<='|\"|[^\\s<>/])",
"name": "meta.attribute-with-value.id.html",
"patterns": [
{
"begin": "\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.html"
}
},
"contentName": "meta.toc-list.id.html",
"end": "\"",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.html"
}
},
"name": "string.quoted.double.html",
"patterns": [
{
"include": "#embedded-code"
},
{
"include": "#entities"
}
]
},
{
"begin": "'",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.html"
}
},
"contentName": "meta.toc-list.id.html",
"end": "'",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.html"
}
},
"name": "string.quoted.single.html",
"patterns": [
{
"include": "#embedded-code"
},
{
"include": "#entities"
}
]
},
{
"captures": {
"0": {
"name": "meta.toc-list.id.html"
}
},
"match": "(?<==)(?:[^\\s<>/'\"]|/(?!>))+",
"name": "string.unquoted.html"
}
]
},
"tag-stuff": {
"patterns": [
{
"include": "#tag-id-attribute"
},
{
"include": "#tag-generic-attribute"
},
{
"include": "#string-double-quoted"
},
{
"include": "#string-single-quoted"
},
{
"include": "#embedded-code"
},
{
"include": "#unquoted-attribute"
}
]
},
"unquoted-attribute": {
"match": "(?<==)(?:[^\\s<>/'\"]|/(?!>))+",
"name": "string.unquoted.html"
}
},
"scopeName": "text.html.basic",
"uuid": "17994EC8-6B1D-11D9-AC3A-000D93589AF6",
"version": "https://github.com/textmate/html.tmbundle/commit/d1231e3da1c22d3a5310223881b89c311aec9f04"
}

View file

@ -11,6 +11,7 @@ import 'vs/editor/contrib/quickOpen/browser/gotoLine';
import 'vs/editor/contrib/quickOpen/browser/quickCommand';
import 'vs/languages/languages.main';
import 'vs/languages/php/common/php.contribution';
import 'vs/languages/html/common/html.contribution';
import {createMonacoBaseAPI} from 'vs/editor/common/standalone/standaloneBase';
import {createMonacoEditorAPI} from 'vs/editor/browser/standalone/standaloneEditor';

View file

@ -7,5 +7,4 @@
import 'vs/languages/handlebars/common/handlebars.contribution';
import 'vs/languages/html/common/html.contribution';
import 'vs/languages/razor/common/razor.contribution';