From 6f9c8bffec18458333f5cc8731a861c2a96a5b3f Mon Sep 17 00:00:00 2001 From: Erik Lieben Date: Mon, 19 Dec 2016 12:19:38 +0100 Subject: [PATCH 1/3] feat(vscode): upgrade to support features from version 1.8.0 of vscode --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ae3d20ec..323cc25b 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "url": "https://github.com/aurelia/vscode-extension" }, "engines": { - "vscode": "^1.7.1" + "vscode": "^1.8.0" }, "categories": [ "Languages", @@ -74,7 +74,7 @@ { "command": "extension.auRunWatch", "title": "au run --watch" - } + } ], "themes": [ { From 6a8fd57aae773bd1e7b845de46d1d95f56add14c Mon Sep 17 00:00:00 2001 From: Erik Lieben Date: Mon, 19 Dec 2016 12:30:43 +0100 Subject: [PATCH 2/3] feat(vscode): upgraded vscode-language* libs to latest --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 323cc25b..84839f1a 100644 --- a/package.json +++ b/package.json @@ -140,9 +140,9 @@ }, "dependencies": { "aurelia-cli": "^0.21.0", - "vscode-languageclient": "^2.6.3", - "vscode-languageserver": "^2.6.2", - "vscode-languageserver-types": "^1.0.4", + "vscode-languageclient": "^3.0.1-alpha.13", + "vscode-languageserver": "^3.0.1-alpha.13", + "vscode-languageserver-types": "^3.0.1-alpha.9", "vscode-uri": "^1.0.0" } } From 93ed362bd4e140cfac07a4755139b0284d700d76 Mon Sep 17 00:00:00 2001 From: Erik Lieben Date: Mon, 19 Dec 2016 13:56:02 +0100 Subject: [PATCH 3/3] feat(autocomplete): usage snippetstring for auto complete --- dist/src/client/aureliaCLICommands.js | 190 ++-- dist/src/client/aureliaCLICommands.js.map | 2 +- .../htmlInvalidCasingCodeActionProvider.js | 72 +- ...htmlInvalidCasingCodeActionProvider.js.map | 2 +- dist/src/client/main.js | 74 +- dist/src/client/main.js.map | 2 +- .../aureliaLanguageService.js | 26 +- .../aureliaLanguageService.js.map | 2 +- .../parser/aureliaTagProvider.js | 104 +-- .../parser/aureliaTagProvider.js.map | 2 +- .../parser/aureliaTags.js | 454 +++++----- .../parser/aureliaTags.js.map | 2 +- .../parser/htmlParser.js | 333 +++---- .../parser/htmlParser.js.map | 2 +- .../parser/htmlScanner.js | 844 +++++++++--------- .../parser/htmlScanner.js.map | 2 +- .../aurelia-languageservice/parser/models.js | 34 +- .../parser/models.js.map | 2 +- .../services/htmlCompletion.js | 351 ++++---- .../services/htmlCompletion.js.map | 2 +- .../services/htmlValidation.js | 174 ++-- .../services/htmlValidation.js.map | 2 +- dist/src/server/languageModelCache.js | 140 +-- dist/src/server/languageModelCache.js.map | 2 +- dist/src/server/main.js | 96 +- dist/src/server/main.js.map | 2 +- .../services/htmlCompletion.ts | 396 ++++---- 27 files changed, 1662 insertions(+), 1652 deletions(-) diff --git a/dist/src/client/aureliaCLICommands.js b/dist/src/client/aureliaCLICommands.js index 01c1d887..a0d77669 100644 --- a/dist/src/client/aureliaCLICommands.js +++ b/dist/src/client/aureliaCLICommands.js @@ -1,96 +1,96 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments)).next()); - }); -}; -const vscode = require('vscode'); -const cp = require('child_process'); -const path = require('path'); -const fs = require('fs'); -class AureliaCliCommands { - static registerCommands(outputChannel) { - return vscode.Disposable.from(vscode.commands.registerCommand('extension.auNew', () => this.auNew(outputChannel)), vscode.commands.registerCommand('extension.auGenerate', () => this.auGenerate(outputChannel)), vscode.commands.registerCommand('extension.auBuild', () => this.auBuild(outputChannel)), vscode.commands.registerCommand('extension.auTest', () => this.runCommand(['test'], outputChannel)), vscode.commands.registerCommand('extension.auRun', () => this.runCommand(['run'], outputChannel, 'aurelia-cli-run')), vscode.commands.registerCommand('extension.auRunWatch', () => this.runCommand(['run', '--watch'], outputChannel, 'aurelia-cli-run-watch'))); - } - static auNew(outputChannel) { - return __awaiter(this, void 0, void 0, function* () { - let projectName = yield vscode.window.showInputBox({ placeHolder: 'Please enter a name for your new project' }); - this.runCommand(['new', projectName], outputChannel, 'aurelia-cli'); - }); - } - static auGenerate(outputChannel) { - return __awaiter(this, void 0, void 0, function* () { - let param = ['generate']; - let type = yield vscode.window.showQuickPick(this.getGeneratorTypes(), { matchOnDescription: false, placeHolder: 'Select type' }); - param.push(type); - let name = yield vscode.window.showInputBox({ placeHolder: `What would you like to call the ${type}?` }); - param.push(name); - this.runCommand(param, outputChannel); - }); - } - static auBuild(outputChannel) { - return __awaiter(this, void 0, void 0, function* () { - let param = ['build']; - let auTemplatePath = path.join(vscode.workspace.rootPath, 'aurelia_project/environments'); - let items = []; - fs.readdirSync(auTemplatePath).forEach((name) => { - if (path.extname(name) === '.ts' || path.extname(name) === '.js') { - items.push(path.basename(name.replace('.ts', '').replace('.js', ''))); - } - }); - let options = { matchOnDescription: false, placeHolder: 'Select environment to build' }; - vscode.window.showQuickPick(items, options).then((data) => { - param.push('--env ' + data); - this.runCommand(param, outputChannel); - }); - }); - } - static getGeneratorTypes() { - let items = []; - fs.readdirSync(path.join(vscode.workspace.rootPath, 'aurelia_project/generators')).forEach(name => { - if (path.extname(name) === '.ts' || path.extname(name) === '.js') { - items.push(path.basename(name.replace('.ts', '').replace('.js', ''))); - } - }); - return items; - } - static showOutput(outputChannel) { - outputChannel.show(vscode.ViewColumn.One); - } - static runCommand(args, outputChannel, terminalName) { - let cwd = vscode.workspace.rootPath; - if (terminalName && terminalName.length) { - this.runCommandInTerminal(args); - } - else { - this.runCommandInOutputWindow(args, cwd, outputChannel); - } - } - static runCommandInOutputWindow(args, cwd, outputChannel) { - let cmd = 'au ' + args.join(' '); - let childProcess = cp.exec(cmd, { cwd: cwd, env: process.env }); - childProcess.stderr.on('data', data => outputChannel.append(data)); - childProcess.stdout.on('data', data => outputChannel.append(data)); - this.showOutput(outputChannel); - } - static runCommandInTerminal(args) { - return __awaiter(this, void 0, void 0, function* () { - try { - fs.accessSync(path.join(vscode.workspace.rootPath, 'aurelia_project/aurelia.json')); - } - catch (e) { - vscode.window.showErrorMessage(`Unable to find 'aurelia_project/aurelia.json'. Are you sure you are in the correct directory?`); - return; - } - let terminal = vscode.window.createTerminal('aurelia-cli'); - terminal.show(true); - terminal.sendText('au ' + args.join(' '), true); - }); - } -} -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = AureliaCliCommands; +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments)).next()); + }); +}; +const vscode = require("vscode"); +const cp = require("child_process"); +const path = require("path"); +const fs = require("fs"); +class AureliaCliCommands { + static registerCommands(outputChannel) { + return vscode.Disposable.from(vscode.commands.registerCommand('extension.auNew', () => this.auNew(outputChannel)), vscode.commands.registerCommand('extension.auGenerate', () => this.auGenerate(outputChannel)), vscode.commands.registerCommand('extension.auBuild', () => this.auBuild(outputChannel)), vscode.commands.registerCommand('extension.auTest', () => this.runCommand(['test'], outputChannel)), vscode.commands.registerCommand('extension.auRun', () => this.runCommand(['run'], outputChannel, 'aurelia-cli-run')), vscode.commands.registerCommand('extension.auRunWatch', () => this.runCommand(['run', '--watch'], outputChannel, 'aurelia-cli-run-watch'))); + } + static auNew(outputChannel) { + return __awaiter(this, void 0, void 0, function* () { + let projectName = yield vscode.window.showInputBox({ placeHolder: 'Please enter a name for your new project' }); + this.runCommand(['new', projectName], outputChannel, 'aurelia-cli'); + }); + } + static auGenerate(outputChannel) { + return __awaiter(this, void 0, void 0, function* () { + let param = ['generate']; + let type = yield vscode.window.showQuickPick(this.getGeneratorTypes(), { matchOnDescription: false, placeHolder: 'Select type' }); + param.push(type); + let name = yield vscode.window.showInputBox({ placeHolder: `What would you like to call the ${type}?` }); + param.push(name); + this.runCommand(param, outputChannel); + }); + } + static auBuild(outputChannel) { + return __awaiter(this, void 0, void 0, function* () { + let param = ['build']; + let auTemplatePath = path.join(vscode.workspace.rootPath, 'aurelia_project/environments'); + let items = []; + fs.readdirSync(auTemplatePath).forEach((name) => { + if (path.extname(name) === '.ts' || path.extname(name) === '.js') { + items.push(path.basename(name.replace('.ts', '').replace('.js', ''))); + } + }); + let options = { matchOnDescription: false, placeHolder: 'Select environment to build' }; + vscode.window.showQuickPick(items, options).then((data) => { + param.push('--env ' + data); + this.runCommand(param, outputChannel); + }); + }); + } + static getGeneratorTypes() { + let items = []; + fs.readdirSync(path.join(vscode.workspace.rootPath, 'aurelia_project/generators')).forEach(name => { + if (path.extname(name) === '.ts' || path.extname(name) === '.js') { + items.push(path.basename(name.replace('.ts', '').replace('.js', ''))); + } + }); + return items; + } + static showOutput(outputChannel) { + outputChannel.show(vscode.ViewColumn.One); + } + static runCommand(args, outputChannel, terminalName) { + let cwd = vscode.workspace.rootPath; + if (terminalName && terminalName.length) { + this.runCommandInTerminal(args); + } + else { + this.runCommandInOutputWindow(args, cwd, outputChannel); + } + } + static runCommandInOutputWindow(args, cwd, outputChannel) { + let cmd = 'au ' + args.join(' '); + let childProcess = cp.exec(cmd, { cwd: cwd, env: process.env }); + childProcess.stderr.on('data', data => outputChannel.append(data)); + childProcess.stdout.on('data', data => outputChannel.append(data)); + this.showOutput(outputChannel); + } + static runCommandInTerminal(args) { + return __awaiter(this, void 0, void 0, function* () { + try { + fs.accessSync(path.join(vscode.workspace.rootPath, 'aurelia_project/aurelia.json')); + } + catch (e) { + vscode.window.showErrorMessage(`Unable to find 'aurelia_project/aurelia.json'. Are you sure you are in the correct directory?`); + return; + } + let terminal = vscode.window.createTerminal('aurelia-cli'); + terminal.show(true); + terminal.sendText('au ' + args.join(' '), true); + }); + } +} +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = AureliaCliCommands; //# sourceMappingURL=aureliaCLICommands.js.map \ No newline at end of file diff --git a/dist/src/client/aureliaCLICommands.js.map b/dist/src/client/aureliaCLICommands.js.map index e2d1c775..e11db629 100644 --- a/dist/src/client/aureliaCLICommands.js.map +++ b/dist/src/client/aureliaCLICommands.js.map @@ -1 +1 @@ -{"version":3,"file":"aureliaCLICommands.js","sourceRoot":"","sources":["../../../src/client/aureliaCLICommands.ts"],"names":[],"mappings":";;;;;;;;;AAAA,MAAY,MAAM,WAAM,QAAQ,CAAC,CAAA;AACjC,MAAY,EAAE,WAAM,eAAe,CAAC,CAAA;AACpC,MAAY,IAAI,WAAM,MAAM,CAAC,CAAA;AAC7B,MAAY,EAAE,WAAM,IAAI,CAAC,CAAA;AAEzB;IAEE,OAAc,gBAAgB,CAAC,aAAmC;QAChE,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAC3B,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,iBAAiB,EAAE,MAAM,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,EACnF,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,sBAAsB,EAAE,MAAM,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,EAC7F,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,mBAAmB,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,EACvF,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,kBAAkB,EAAE,MAAM,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC,CAAC,EACnG,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,iB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,CAAU,IAAI,CAAC,CAAC,CAAC;QAC5E,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,IAAI,aAAa,CAAC,MAAM,CAAU,IAAI,CAAC,CAAC,CAAC;QAE5E,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjC,CAAC;IAEO,MAAM,CAAO,oBAAoB,CAAC,IAAc;;YAEtD,IAAI,CAAC;gBACH,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,8BAA8B,CAAC,CAAC,CAAC;YACtF,CAAE;YAAA,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACX,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,+FAA+F,CAAC,CAAC;gBAChI,MAAM,CAAC;YACT,CAAC;YAED,IAAI,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;YAC3D,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACpB,QAAQ,CAAC,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;QAClD,CAAC;KAAA;CACF;;AA/FD,qCA+FC"} \ No newline at end of file diff --git a/dist/src/client/htmlInvalidCasingCodeActionProvider.js b/dist/src/client/htmlInvalidCasingCodeActionProvider.js index d9c155e4..423486fd 100644 --- a/dist/src/client/htmlInvalidCasingCodeActionProvider.js +++ b/dist/src/client/htmlInvalidCasingCodeActionProvider.js @@ -1,37 +1,37 @@ -'use strict'; -const vscode = require('vscode'); -class HtmlInvalidCasingActionProvider { - activate(subscriptions) { - this.command = vscode.commands.registerCommand(HtmlInvalidCasingActionProvider.commandId, this.fixInvalidCasing, this); - subscriptions.push(this); - } - provideCodeActions(document, range, context, token) { - let diagnostic = context.diagnostics[0]; - let text = document.getText(diagnostic.range); - const kebabCaseValidationRegex = /(.*)\.(bind|one-way|two-way|one-time|call|delegate|trigger)/; - let result = kebabCaseValidationRegex.exec(text); - let attribute = result[1]; - let binding = result[2]; - let fixedAttribute = attribute.split(/(?=[A-Z])/).map(s => s.toLowerCase()).join('-'); - let fixedText = `${fixedAttribute}.${binding}`; - let commands = []; - commands.push({ - arguments: [document, diagnostic.range, fixedText], - command: HtmlInvalidCasingActionProvider.commandId, - title: `Rename ${attribute} to ${fixedAttribute}`, - }); - return commands; - } - fixInvalidCasing(document, range, fixedText) { - let edit = new vscode.WorkspaceEdit(); - edit.replace(document.uri, range, fixedText); - return vscode.workspace.applyEdit(edit); - } - dispose() { - this.command.dispose(); - } -} -HtmlInvalidCasingActionProvider.commandId = 'aurelia-fix-invalid-casing'; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = HtmlInvalidCasingActionProvider; +'use strict'; +const vscode = require("vscode"); +class HtmlInvalidCasingActionProvider { + activate(subscriptions) { + this.command = vscode.commands.registerCommand(HtmlInvalidCasingActionProvider.commandId, this.fixInvalidCasing, this); + subscriptions.push(this); + } + provideCodeActions(document, range, context, token) { + let diagnostic = context.diagnostics[0]; + let text = document.getText(diagnostic.range); + const kebabCaseValidationRegex = /(.*)\.(bind|one-way|two-way|one-time|call|delegate|trigger)/; + let result = kebabCaseValidationRegex.exec(text); + let attribute = result[1]; + let binding = result[2]; + let fixedAttribute = attribute.split(/(?=[A-Z])/).map(s => s.toLowerCase()).join('-'); + let fixedText = `${fixedAttribute}.${binding}`; + let commands = []; + commands.push({ + arguments: [document, diagnostic.range, fixedText], + command: HtmlInvalidCasingActionProvider.commandId, + title: `Rename ${attribute} to ${fixedAttribute}`, + }); + return commands; + } + fixInvalidCasing(document, range, fixedText) { + let edit = new vscode.WorkspaceEdit(); + edit.replace(document.uri, range, fixedText); + return vscode.workspace.applyEdit(edit); + } + dispose() { + this.command.dispose(); + } +} +HtmlInvalidCasingActionProvider.commandId = 'aurelia-fix-invalid-casing'; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = HtmlInvalidCasingActionProvider; //# sourceMappingURL=htmlInvalidCasingCodeActionProvider.js.map \ No newline at end of file diff --git a/dist/src/client/htmlInvalidCasingCodeActionProvider.js.map b/dist/src/client/htmlInvalidCasingCodeActionProvider.js.map index fcdb27dc..7fffaea2 100644 --- a/dist/src/client/htmlInvalidCasingCodeActionProvider.js.map +++ b/dist/src/client/htmlInvalidCasingCodeActionProvider.js.map @@ -1 +1 @@ -{"version":3,"file":"htmlInvalidCasingCodeActionProvider.js","sourceRoot":"","sources":["../../../src/client/htmlInvalidCasingCodeActionProvider.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,MAAO,MAAM,WAAW,QAAQ,CAAC,CAAC;AAElC;IAIS,QAAQ,CAAC,aAAkC;QAChD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,+BAA+B,CAAC,SAAS,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;QACvH,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAEM,kBAAkB,CACvB,QAA6B,EAC7B,KAAmB,EACnB,OAAiC,EACjC,KAA+B;QAE7B,IAAI,UAAU,GAAsB,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QAC3D,IAAI,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAC9C,MAAM,wBAAwB,GAAG,6DAA6D,CAAC;QAE/F,IAAI,MAAM,GAAG,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjD,IAAI,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QAC1B,IAAI,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QACxB,IAAI,cAAc,GAAG,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACtF,IAAI,SAAS,GAAG,GAAG,cAAc,IAAI,OAAO,EAAE,CAAC;QAC/C,IAAI,QAAQ,GAAqB,EAAE,CAAC;QAEpC,QAAQ,CAAC,IAAI,CAAC;YACR,SAAS,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC;YAClD,OAAO,EAAE,+BAA+B,CAAC,SAAS;YAClD,KAAK,EAAE,UAAU,SAAS,OAAO,cAAc,EAAE;SACpD,CAAC,CAAC;QAEL,MAAM,CAAC,QAAQ,CAAC;IACpB,CAAC;IAEM,gBAAgB,CAAC,QAAQ,EAAE,KAAK,EAAE,SAAS;QAChD,IAAI,IAAI,GAAG,IAAI,MAAM,CAAC,aAAa,EAAE,CAAC;QACtC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;QAC7C,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC;IAEM,OAAO;QACZ,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;IACzB,CAAC;AACH,CAAC;AA3CgB,yCAAS,GAAW,4BAA4B,CAAC;AADlE;iDA4CC,CAAA"} \ No newline at end of file +{"version":3,"file":"htmlInvalidCasingCodeActionProvider.js","sourceRoot":"","sources":["../../../src/client/htmlInvalidCasingCodeActionProvider.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,iCAAkC;AAElC;IAIS,QAAQ,CAAC,aAAkC;QAChD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,+BAA+B,CAAC,SAAS,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;QACvH,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAEM,kBAAkB,CACvB,QAA6B,EA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OAAO,CAAC,OAAO,EAAE,CAAC;IACzB,CAAC;;AA1Cc,yCAAS,GAAW,4BAA4B,CAAC;;AADlE,kDA4CC"} \ No newline at end of file diff --git a/dist/src/client/main.js b/dist/src/client/main.js index 5905bbf0..c3d52b30 100644 --- a/dist/src/client/main.js +++ b/dist/src/client/main.js @@ -1,38 +1,38 @@ -"use strict"; -const path = require('path'); -const vscode_1 = require('vscode'); -const vscode_languageclient_1 = require('vscode-languageclient'); -const aureliaCLICommands_1 = require('./aureliaCLICommands'); -const htmlInvalidCasingCodeActionProvider_1 = require('./htmlInvalidCasingCodeActionProvider'); -let outputChannel; -function activate(context) { - // Create default output channel - outputChannel = vscode_1.window.createOutputChannel('aurelia'); - context.subscriptions.push(outputChannel); - // Register CLI commands - context.subscriptions.push(aureliaCLICommands_1.default.registerCommands(outputChannel)); - // Register code fix - const invalidCasingAction = new htmlInvalidCasingCodeActionProvider_1.default(); - invalidCasingAction.activate(context.subscriptions); - vscode_1.languages.registerCodeActionsProvider('html', invalidCasingAction); - // Register Aurelia language server - const serverModule = context.asAbsolutePath(path.join('dist', 'src', 'server', 'main.js')); - const debugOptions = { execArgv: ['--nolazy', '--debug=6004'] }; - const serverOptions = { - debug: { module: serverModule, options: debugOptions, transport: vscode_languageclient_1.TransportKind.ipc }, - run: { module: serverModule, transport: vscode_languageclient_1.TransportKind.ipc }, - }; - const clientOptions = { - diagnosticCollectionName: 'Aurelia', - documentSelector: ['html'], - initializationOptions: {}, - synchronize: { - configurationSection: ['aurelia'], - }, - }; - const client = new vscode_languageclient_1.LanguageClient('html', 'Aurelia', serverOptions, clientOptions); - const disposable = client.start(); - context.subscriptions.push(disposable); -} -exports.activate = activate; +"use strict"; +const path = require("path"); +const vscode_1 = require("vscode"); +const vscode_languageclient_1 = require("vscode-languageclient"); +const aureliaCLICommands_1 = require("./aureliaCLICommands"); +const htmlInvalidCasingCodeActionProvider_1 = require("./htmlInvalidCasingCodeActionProvider"); +let outputChannel; +function activate(context) { + // Create default output channel + outputChannel = vscode_1.window.createOutputChannel('aurelia'); + context.subscriptions.push(outputChannel); + // Register CLI commands + context.subscriptions.push(aureliaCLICommands_1.default.registerCommands(outputChannel)); + // Register code fix + const invalidCasingAction = new htmlInvalidCasingCodeActionProvider_1.default(); + invalidCasingAction.activate(context.subscriptions); + vscode_1.languages.registerCodeActionsProvider('html', invalidCasingAction); + // Register Aurelia language server + const serverModule = context.asAbsolutePath(path.join('dist', 'src', 'server', 'main.js')); + const debugOptions = { execArgv: ['--nolazy', '--debug=6004'] }; + const serverOptions = { + debug: { module: serverModule, options: debugOptions, transport: vscode_languageclient_1.TransportKind.ipc }, + run: { module: serverModule, transport: vscode_languageclient_1.TransportKind.ipc }, + }; + const clientOptions = { + diagnosticCollectionName: 'Aurelia', + documentSelector: ['html'], + initializationOptions: {}, + synchronize: { + configurationSection: ['aurelia'], + }, + }; + const client = new vscode_languageclient_1.LanguageClient('html', 'Aurelia', serverOptions, clientOptions); + const disposable = client.start(); + context.subscriptions.push(disposable); +} +exports.activate = activate; //# sourceMappingURL=main.js.map \ No newline at end of file diff --git a/dist/src/client/main.js.map b/dist/src/client/main.js.map index 84b63a65..b3fd5357 100644 --- a/dist/src/client/main.js.map +++ b/dist/src/client/main.js.map @@ -1 +1 @@ -{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../src/client/main.ts"],"names":[],"mappings":";AAAA,MAAY,IAAI,WAAM,MAAM,CAAC,CAAA;AAC7B,yBAAmE,QAAQ,CAAC,CAAA;AAC5E,wCAAoF,uBAAuB,CAAC,CAAA;AAC5G,qCAA+B,sBAAsB,CAAC,CAAA;AACtD,sDAA4C,uCAAuC,CAAC,CAAA;AAEpF,IAAI,aAA4B,CAAC;AAEjC,kBAAyB,OAAyB;IAEhD,gCAAgC;IAChC,aAAa,GAAG,eAAM,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;IACtD,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAE1C,wBAA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;YACX,oBAAoB,EAAE,CAAC,SAAS,CAAC;SAClC;KACF,CAAC;IAEF,MAAM,MAAM,GAAG,IAAI,sCAAc,CAAC,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC;IACnF,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC;IAClC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AACzC,CAAC;AAlCD,4BAkCC"} \ No newline at end of file diff --git a/dist/src/server/aurelia-languageservice/aureliaLanguageService.js b/dist/src/server/aurelia-languageservice/aureliaLanguageService.js index 7ec30aec..1046e5a0 100644 --- a/dist/src/server/aurelia-languageservice/aureliaLanguageService.js +++ b/dist/src/server/aurelia-languageservice/aureliaLanguageService.js @@ -1,14 +1,14 @@ -"use strict"; -const htmlParser_1 = require('./parser/htmlParser'); -const htmlCompletion_1 = require('./services/htmlCompletion'); -const htmlValidation_1 = require('./services/htmlValidation'); -function getLanguageService() { - const validation = new htmlValidation_1.HTMLValidation(); - return { - doComplete: htmlCompletion_1.doComplete, - doValidation: validation.doValidation.bind(validation), - parseHTMLDocument: document => htmlParser_1.parse(document.getText()), - }; -} -exports.getLanguageService = getLanguageService; +"use strict"; +const htmlParser_1 = require("./parser/htmlParser"); +const htmlCompletion_1 = require("./services/htmlCompletion"); +const htmlValidation_1 = require("./services/htmlValidation"); +function getLanguageService() { + const validation = new htmlValidation_1.HTMLValidation(); + return { + doComplete: htmlCompletion_1.doComplete, + doValidation: validation.doValidation.bind(validation), + parseHTMLDocument: document => htmlParser_1.parse(document.getText()), + }; +} +exports.getLanguageService = getLanguageService; //# sourceMappingURL=aureliaLanguageService.js.map \ No newline at end of file diff --git a/dist/src/server/aurelia-languageservice/aureliaLanguageService.js.map b/dist/src/server/aurelia-languageservice/aureliaLanguageService.js.map index 1ad75388..03c3104d 100644 --- a/dist/src/server/aurelia-languageservice/aureliaLanguageService.js.map +++ b/dist/src/server/aurelia-languageservice/aureliaLanguageService.js.map @@ -1 +1 @@ -{"version":3,"file":"aureliaLanguageService.js","sourceRoot":"","sources":["../../../../src/server/aurelia-languageservice/aureliaLanguageService.ts"],"names":[],"mappings":";AAAA,6BAAsB,qBAAqB,CAAC,CAAA;AAC5C,iCAA2B,2BAA2B,CAAC,CAAA;AACvD,iCAA+B,2BAA2B,CAAC,CAAA;AAoB3D;IACE,MAAM,UAAU,GAAG,IAAI,+BAAc,EAAE,CAAC;IACxC,MAAM,CAAC;QACL,uCAAU;QACV,YAAY,EAAE,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC;QACtD,iBAAiB,EAAE,QAAQ,IAAI,kBAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;KACzD,CAAC;AACJ,CAAC;AAPe,0BAAkB,qBAOjC,CAAA"} \ No newline at end of file +{"version":3,"file":"aureliaLanguageService.js","sourceRoot":"","sources":["../../../../src/server/aurelia-languageservice/aureliaLanguageService.ts"],"names":[],"mappings":";AAAA,oDAA4C;AAC5C,8DAAuD;AACvD,8DAA2D;AAoB3D;IACE,MAAM,UAAU,GAAG,IAAI,+BAAc,EAAE,CAAC;IACxC,MAAM,CAAC;QACL,UAAU,EAAV,2BAAU;QACV,YAAY,EAAE,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC;QACtD,iBAAiB,EAAE,QAAQ,IAAI,kBAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;KACzD,CAAC;AACJ,CAAC;AAPD,gDAOC"} \ No newline at end of file diff --git a/dist/src/server/aurelia-languageservice/parser/aureliaTagProvider.js b/dist/src/server/aurelia-languageservice/parser/aureliaTagProvider.js index 45bd1282..1ed846c8 100644 --- a/dist/src/server/aurelia-languageservice/parser/aureliaTagProvider.js +++ b/dist/src/server/aurelia-languageservice/parser/aureliaTagProvider.js @@ -1,53 +1,53 @@ -"use strict"; -const aureliaTags_1 = require('./aureliaTags'); -function getAureliaTagProvider() { - return { - collectAttributes: (tag, collector) => { - if (tag) { - let tagWithAttributes = aureliaTags_1.AURELIA_TAGS[tag]; - let attributes = aureliaTags_1.AURELIA_ATTRIBUTES[tag]; - if (tagWithAttributes) { - addAttributes(tagWithAttributes.attributes, collector); - } - else if (attributes) { - addAttributes(attributes, collector); - } - else { - addAttributes(aureliaTags_1.AURELIA_GLOBAL_ATTRIBUTES, collector); - } - let tagWithEvents = aureliaTags_1.AURELIA_EVENTS[tag]; - if (tagWithEvents) { - addAttributes(tagWithEvents, collector); - } - } - }, - collectTags: (collector) => collectTagsDefault(collector, aureliaTags_1.AURELIA_TAGS), - // tslint:disable-next-line:no-empty - collectValues: (tag, attribute, collector) => { - }, - getId: () => 'aurelia', - isApplicable: (languageId) => languageId === 'html', - }; -} -exports.getAureliaTagProvider = getAureliaTagProvider; -function addAttributes(attributes, collector) { - attributes.forEach(attribute => { - if (!attribute.hasBody) { - collector(attribute.name, 'v'); - } - else if (!attribute.defaultAttribute) { - collector(attribute.name, null); - } - if (attribute.dataBindings && attribute.dataBindings.length) { - attribute.dataBindings.forEach(binding => collector(attribute.name + '.' + binding, null)); - } - }); -} -function collectTagsDefault(collector, tagSet) { - for (let tag in tagSet) { - if (tagSet.hasOwnProperty(tag)) { - collector(tag, tagSet[tag].label); - } - } -} +"use strict"; +const aureliaTags_1 = require("./aureliaTags"); +function getAureliaTagProvider() { + return { + collectAttributes: (tag, collector) => { + if (tag) { + let tagWithAttributes = aureliaTags_1.AURELIA_TAGS[tag]; + let attributes = aureliaTags_1.AURELIA_ATTRIBUTES[tag]; + if (tagWithAttributes) { + addAttributes(tagWithAttributes.attributes, collector); + } + else if (attributes) { + addAttributes(attributes, collector); + } + else { + addAttributes(aureliaTags_1.AURELIA_GLOBAL_ATTRIBUTES, collector); + } + let tagWithEvents = aureliaTags_1.AURELIA_EVENTS[tag]; + if (tagWithEvents) { + addAttributes(tagWithEvents, collector); + } + } + }, + collectTags: (collector) => collectTagsDefault(collector, aureliaTags_1.AURELIA_TAGS), + // tslint:disable-next-line:no-empty + collectValues: (tag, attribute, collector) => { + }, + getId: () => 'aurelia', + isApplicable: (languageId) => languageId === 'html', + }; +} +exports.getAureliaTagProvider = getAureliaTagProvider; +function addAttributes(attributes, collector) { + attributes.forEach(attribute => { + if (!attribute.hasBody) { + collector(attribute.name, 'v'); + } + else if (!attribute.defaultAttribute) { + collector(attribute.name, null); + } + if (attribute.dataBindings && attribute.dataBindings.length) { + attribute.dataBindings.forEach(binding => collector(attribute.name + '.' + binding, null)); + } + }); +} +function collectTagsDefault(collector, tagSet) { + for (let tag in tagSet) { + if (tagSet.hasOwnProperty(tag)) { + collector(tag, tagSet[tag].label); + } + } +} //# sourceMappingURL=aureliaTagProvider.js.map \ No newline at end of file diff --git a/dist/src/server/aurelia-languageservice/parser/aureliaTagProvider.js.map b/dist/src/server/aurelia-languageservice/parser/aureliaTagProvider.js.map index d9f2b80b..66aabdc4 100644 --- a/dist/src/server/aurelia-languageservice/parser/aureliaTagProvider.js.map +++ b/dist/src/server/aurelia-languageservice/parser/aureliaTagProvider.js.map @@ -1 +1 @@ -{"version":3,"file":"aureliaTagProvider.js","sourceRoot":"","sources":["../../../../../src/server/aurelia-languageservice/parser/aureliaTagProvider.ts"],"names":[],"mappings":";AACA,8BAA4F,eAAe,CAAC,CAAA;AAG5G;IACE,MAAM,CAAC;QACL,iBAAiB,EAAE,CAAC,GAAW,EAAE,SAAoD;YACnF,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;gBACR,IAAI,iBAAiB,GAAG,0BAAY,CAAC,GAAG,CAAC,CAAC;gBAC1C,IAAI,UAAU,GAAG,gCAAkB,CAAC,GAAG,CAAC,CAAC;gBAEzC,EAAE,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC;oBACtB,aAAa,CAAC,iBAAiB,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;gBACzD,CAAC;gBAAC,IAAI,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;oBACtB,aA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F,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED,4BAA4B,SAA+C,EAAE,MAAc;IACzF,GAAG,CAAC,CAAC,IAAI,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC;QACvB,EAAE,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAC/B,SAAS,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;AACH,CAAC"} \ No newline at end of file +{"version":3,"file":"aureliaTagProvider.js","sourceRoot":"","sources":["../../../../../src/server/aurelia-languageservice/parser/aureliaTagProvider.ts"],"names":[],"mappings":";AACA,+CAA4G;AAG5G;IACE,MAAM,CAAC;QACL,iBAAiB,EAAE,CAAC,GAAW,EAAE,SAAoD;YACnF,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;gBACR,IAAI,iBAAiB,GAAG,0BAAY,CAAC,GAAG,CAAC,CAAC;gBAC1C,IAAI,UAAU,GAAG,gCAAkB,CAAC,GAAG,CAAC,CAAC;gBAEzC,EAAE,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC;oBACtB,aAAa,CAAC,iBAAiB,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;gBACzD,CAAC;gBAAC,IAAI,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;oBACtB,aAAa,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;gBACvC,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACN,aAAa,CAAC,uCAAyB,EAAE,SAAS,CAAC,CAAC;gBACtD,CAAC;gBAED,IAAI,aAAa,GAAG,4BAAc,CAAC,GAAG,CAAC,CAAC;gBACxC,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC;oBAClB,aAAa,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;gBAC1C,CAAC;YACH,CAAC;QACH,CAAC;QACD,WAA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/server/aurelia-languageservice/parser/aureliaTags.js b/dist/src/server/aurelia-languageservice/parser/aureliaTags.js index 0b948284..bdb5d6bc 100644 --- a/dist/src/server/aurelia-languageservice/parser/aureliaTags.js +++ b/dist/src/server/aurelia-languageservice/parser/aureliaTags.js @@ -1,226 +1,230 @@ -"use strict"; -const models_1 = require('./models'); -exports.AURELIA_TAGS = { - 'require': new models_1.HTMLTagSpecification(`"import" or "require" various resources into a view. Equivalent of the ES 2015 "import" syntax`, [ - new models_1.HTMLAttributeSpecification('from', [], true, false), - new models_1.HTMLAttributeSpecification('as', [], true, false)]), - 'router-view': new models_1.HTMLTagSpecification(`Placeholder for the router content`, [ - new models_1.HTMLAttributeSpecification('name'), - new models_1.HTMLAttributeSpecification('layout-view', [], true, false), - new models_1.HTMLAttributeSpecification('layout-view-model', [], true, false), - new models_1.HTMLAttributeSpecification('layout-model', [], true, false)]), - 'compose': new models_1.HTMLTagSpecification(`Composes the view in the current position`, [ - new models_1.HTMLAttributeSpecification('view', [], true, false)]), - 'slot': new models_1.HTMLTagSpecification(`Shadow DOM slot element, Aurelia will project the element's content in to the element.`, [ - new models_1.HTMLAttributeSpecification('name'), - new models_1.HTMLAttributeSpecification('slot')]), -}; -const defaultBindings = ['bind', 'one-way', 'two-way', 'one-time']; -exports.AURELIA_ATTRIBUTES = { - 'select': [new models_1.HTMLAttributeSpecification('matcher', defaultBindings, true, false)], - 'option': [new models_1.HTMLAttributeSpecification('model', defaultBindings, true, false)], - 'input': [ - new models_1.HTMLAttributeSpecification('value', defaultBindings, true, true), - new models_1.HTMLAttributeSpecification('checked', defaultBindings, true, true), - new models_1.HTMLAttributeSpecification('model', defaultBindings, true, false), - ], - 'compose': [ - new models_1.HTMLAttributeSpecification('view', defaultBindings, true, false), - new models_1.HTMLAttributeSpecification('view-model', defaultBindings, true, false), - new models_1.HTMLAttributeSpecification('model', defaultBindings, true, false), - ], - 'template': [ - new models_1.HTMLAttributeSpecification('replaceable', [], false, false), - new models_1.HTMLAttributeSpecification('replace-part', defaultBindings, true, false), - new models_1.HTMLAttributeSpecification('bindable', defaultBindings, true, false), - new models_1.HTMLAttributeSpecification('containerless', [], false, false), - ], - 'a': [new models_1.HTMLAttributeSpecification('route-href', defaultBindings, true, false)], - 'slot': [new models_1.HTMLAttributeSpecification('name', defaultBindings, true, true)], -}; -exports.AURELIA_GLOBAL_ATTRIBUTES = [ - new models_1.HTMLAttributeSpecification('repeat.for', [], true, false), - new models_1.HTMLAttributeSpecification('as-element', [], true, false), - new models_1.HTMLAttributeSpecification('view', defaultBindings, true, false), - new models_1.HTMLAttributeSpecification('ref', [], true, false), - new models_1.HTMLAttributeSpecification('element.ref', [], true, false), - new models_1.HTMLAttributeSpecification('view-model.ref', [], true, false), - new models_1.HTMLAttributeSpecification('view.ref', [], true, false), - new models_1.HTMLAttributeSpecification('controller.ref', [], true, false), - new models_1.HTMLAttributeSpecification('innerhtml', defaultBindings, true, false), - new models_1.HTMLAttributeSpecification('textcontent', defaultBindings, true, false), - new models_1.HTMLAttributeSpecification('style', defaultBindings, true, true), - new models_1.HTMLAttributeSpecification('show', defaultBindings, true, false), - new models_1.HTMLAttributeSpecification('if', defaultBindings, true, false), - new models_1.HTMLAttributeSpecification('naive-if', defaultBindings, true, false), - new models_1.HTMLAttributeSpecification('with', defaultBindings, true, false), - new models_1.HTMLAttributeSpecification('slot', [], true, false), - new models_1.HTMLAttributeSpecification('view-spy', [], true, false), - new models_1.HTMLAttributeSpecification('compile-spy', [], true, false), -]; -const actionRedirectOptions = ['delegate', 'trigger', 'call']; -const actionRedirectOptionsNonBubbling = ['trigger', 'call']; -const globalEvents = [ - // Resource Events - new models_1.HTMLAttributeSpecification('error', actionRedirectOptionsNonBubbling), - new models_1.HTMLAttributeSpecification('abort', actionRedirectOptionsNonBubbling), - new models_1.HTMLAttributeSpecification('load', actionRedirectOptionsNonBubbling), - new models_1.HTMLAttributeSpecification('unload', actionRedirectOptionsNonBubbling), - // Focus Events - new models_1.HTMLAttributeSpecification('blur', actionRedirectOptionsNonBubbling), - new models_1.HTMLAttributeSpecification('focus', ['call', 'trigger', 'bind', 'one-way', 'two-way', 'one-time']), - // CSS Animation Events - new models_1.HTMLAttributeSpecification('animationstart', actionRedirectOptions), - new models_1.HTMLAttributeSpecification('animationend', actionRedirectOptions), - new models_1.HTMLAttributeSpecification('animationiteration', actionRedirectOptions), - // Text Composition Events - new models_1.HTMLAttributeSpecification('compositionstart', actionRedirectOptions), - new models_1.HTMLAttributeSpecification('compositionupdate', actionRedirectOptions), - new models_1.HTMLAttributeSpecification('compositionend', actionRedirectOptions), - // View Events - new models_1.HTMLAttributeSpecification('scroll', actionRedirectOptionsNonBubbling), - // Clipboard Events - new models_1.HTMLAttributeSpecification('cut', actionRedirectOptions), - new models_1.HTMLAttributeSpecification('copy', actionRedirectOptions), - new models_1.HTMLAttributeSpecification('paste', actionRedirectOptions), - // Keyboard Events - new models_1.HTMLAttributeSpecification('keydown', actionRedirectOptions), - new models_1.HTMLAttributeSpecification('keypress', actionRedirectOptions), - new models_1.HTMLAttributeSpecification('keyup', actionRedirectOptions), - // Mouse Events - new models_1.HTMLAttributeSpecification('mouseenter', actionRedirectOptionsNonBubbling), - new models_1.HTMLAttributeSpecification('mouseover', actionRedirectOptions), - new models_1.HTMLAttributeSpecification('mousemove', actionRedirectOptions), - new models_1.HTMLAttributeSpecification('mousedown', actionRedirectOptions), - new models_1.HTMLAttributeSpecification('mouseup', actionRedirectOptions), - new models_1.HTMLAttributeSpecification('mouseout', actionRedirectOptionsNonBubbling), - new models_1.HTMLAttributeSpecification('click', actionRedirectOptions), - new models_1.HTMLAttributeSpecification('dblclick', actionRedirectOptions), - new models_1.HTMLAttributeSpecification('contextmenu', actionRedirectOptions), - new models_1.HTMLAttributeSpecification('wheel', actionRedirectOptions), - new models_1.HTMLAttributeSpecification('mouseleave', actionRedirectOptionsNonBubbling), - new models_1.HTMLAttributeSpecification('mouseout', actionRedirectOptions), - new models_1.HTMLAttributeSpecification('select', actionRedirectOptionsNonBubbling), - new models_1.HTMLAttributeSpecification('pointerlockchange', actionRedirectOptions), - new models_1.HTMLAttributeSpecification('pointerlockerror', actionRedirectOptions), - // Drag & Drop Events - new models_1.HTMLAttributeSpecification('dragstart', actionRedirectOptions), - new models_1.HTMLAttributeSpecification('drag', actionRedirectOptions), - new models_1.HTMLAttributeSpecification('dragend', actionRedirectOptions), - new models_1.HTMLAttributeSpecification('dragenter', actionRedirectOptions), - new models_1.HTMLAttributeSpecification('dragover', actionRedirectOptions), - new models_1.HTMLAttributeSpecification('dragleave', actionRedirectOptions), - new models_1.HTMLAttributeSpecification('drop', actionRedirectOptions), - // Touch events - new models_1.HTMLAttributeSpecification('touchstart', actionRedirectOptions), - new models_1.HTMLAttributeSpecification('touchmove', actionRedirectOptions), - new models_1.HTMLAttributeSpecification('touchend', actionRedirectOptions), - // Other - new models_1.HTMLAttributeSpecification('close', actionRedirectOptions), -]; -exports.AURELIA_EVENTS = { - 'a': globalEvents, - 'abbr': globalEvents, - 'address': globalEvents, - 'area': globalEvents, - 'article': globalEvents, - 'aside': globalEvents, - 'audio': globalEvents, - 'b': globalEvents, - 'base': globalEvents, - 'bdi': globalEvents, - 'bdo': globalEvents, - 'blockquote': globalEvents, - 'body': globalEvents, - 'br': globalEvents, - 'button': globalEvents, - 'canvas': globalEvents, - 'caption': globalEvents, - 'cite': globalEvents, - 'code': globalEvents, - 'col': globalEvents, - 'colgroup': globalEvents, - 'data': globalEvents, - 'datalist': globalEvents, - 'dd': globalEvents, - 'del': globalEvents, - 'details': globalEvents, - 'dfn': globalEvents, - 'div': globalEvents, - 'dl': globalEvents, - 'dt': globalEvents, - 'em': globalEvents, - 'embed': globalEvents, - 'fieldset': globalEvents, - 'figcaption': globalEvents, - 'figure': globalEvents, - 'footer': globalEvents, - 'form': [ - ...globalEvents, - new models_1.HTMLAttributeSpecification('reset', actionRedirectOptions), - new models_1.HTMLAttributeSpecification('submit', actionRedirectOptions), - new models_1.HTMLAttributeSpecification('change', actionRedirectOptions), - new models_1.HTMLAttributeSpecification('input', actionRedirectOptions), - ], - 'header': globalEvents, - 'hr': globalEvents, - 'i': globalEvents, - 'iframe': globalEvents, - 'img': globalEvents, - 'input': globalEvents, - 'ins': globalEvents, - 'kbd': globalEvents, - 'label': globalEvents, - 'legend': globalEvents, - 'li': globalEvents, - 'link': globalEvents, - 'main': globalEvents, - 'map': globalEvents, - 'mark': globalEvents, - 'meter': globalEvents, - 'nav': globalEvents, - 'object': globalEvents, - 'ol': globalEvents, - 'optgroup': globalEvents, - 'option': globalEvents, - 'output': globalEvents, - 'p': [...globalEvents], - 'param': [...globalEvents], - 'pre': [...globalEvents], - 'progress': [...globalEvents], - 'q': globalEvents, - 'rp': globalEvents, - 'rt': globalEvents, - 'rtc': globalEvents, - 'ruby': globalEvents, - 's': globalEvents, - 'samp': globalEvents, - 'section': globalEvents, - 'select': globalEvents, - 'shadow': globalEvents, - 'small': globalEvents, - 'source': globalEvents, - 'span': globalEvents, - 'strong': globalEvents, - 'sub': globalEvents, - 'summary': globalEvents, - 'sup': globalEvents, - 'table': globalEvents, - 'tbody': globalEvents, - 'td': globalEvents, - 'template': globalEvents, - 'textarea': globalEvents, - 'tfoot': globalEvents, - 'th': globalEvents, - 'thead': globalEvents, - 'time': globalEvents, - 'title': globalEvents, - 'tr': globalEvents, - 'track': globalEvents, - 'u': globalEvents, - 'ul': globalEvents, - 'var': globalEvents, - 'video': globalEvents, - 'wbr': globalEvents, -}; +"use strict"; +const models_1 = require("./models"); +exports.AURELIA_TAGS = { + 'require': new models_1.HTMLTagSpecification(`"import" or "require" various resources into a view. Equivalent of the ES 2015 "import" syntax`, [ + new models_1.HTMLAttributeSpecification('from', [], true, false), + new models_1.HTMLAttributeSpecification('as', [], true, false) + ]), + 'router-view': new models_1.HTMLTagSpecification(`Placeholder for the router content`, [ + new models_1.HTMLAttributeSpecification('name'), + new models_1.HTMLAttributeSpecification('layout-view', [], true, false), + new models_1.HTMLAttributeSpecification('layout-view-model', [], true, false), + new models_1.HTMLAttributeSpecification('layout-model', [], true, false) + ]), + 'compose': new models_1.HTMLTagSpecification(`Composes the view in the current position`, [ + new models_1.HTMLAttributeSpecification('view', [], true, false) + ]), + 'slot': new models_1.HTMLTagSpecification(`Shadow DOM slot element, Aurelia will project the element's content in to the element.`, [ + new models_1.HTMLAttributeSpecification('name'), + new models_1.HTMLAttributeSpecification('slot') + ]), +}; +const defaultBindings = ['bind', 'one-way', 'two-way', 'one-time']; +exports.AURELIA_ATTRIBUTES = { + 'select': [new models_1.HTMLAttributeSpecification('matcher', defaultBindings, true, false)], + 'option': [new models_1.HTMLAttributeSpecification('model', defaultBindings, true, false)], + 'input': [ + new models_1.HTMLAttributeSpecification('value', defaultBindings, true, true), + new models_1.HTMLAttributeSpecification('checked', defaultBindings, true, true), + new models_1.HTMLAttributeSpecification('model', defaultBindings, true, false), + ], + 'compose': [ + new models_1.HTMLAttributeSpecification('view', defaultBindings, true, false), + new models_1.HTMLAttributeSpecification('view-model', defaultBindings, true, false), + new models_1.HTMLAttributeSpecification('model', defaultBindings, true, false), + ], + 'template': [ + new models_1.HTMLAttributeSpecification('replaceable', [], false, false), + new models_1.HTMLAttributeSpecification('replace-part', defaultBindings, true, false), + new models_1.HTMLAttributeSpecification('bindable', defaultBindings, true, false), + new models_1.HTMLAttributeSpecification('containerless', [], false, false), + ], + 'a': [new models_1.HTMLAttributeSpecification('route-href', defaultBindings, true, false)], + 'slot': [new models_1.HTMLAttributeSpecification('name', defaultBindings, true, true)], +}; +exports.AURELIA_GLOBAL_ATTRIBUTES = [ + new models_1.HTMLAttributeSpecification('repeat.for', [], true, false), + new models_1.HTMLAttributeSpecification('as-element', [], true, false), + new models_1.HTMLAttributeSpecification('view', defaultBindings, true, false), + new models_1.HTMLAttributeSpecification('ref', [], true, false), + new models_1.HTMLAttributeSpecification('element.ref', [], true, false), + new models_1.HTMLAttributeSpecification('view-model.ref', [], true, false), + new models_1.HTMLAttributeSpecification('view.ref', [], true, false), + new models_1.HTMLAttributeSpecification('controller.ref', [], true, false), + new models_1.HTMLAttributeSpecification('innerhtml', defaultBindings, true, false), + new models_1.HTMLAttributeSpecification('textcontent', defaultBindings, true, false), + new models_1.HTMLAttributeSpecification('style', defaultBindings, true, true), + new models_1.HTMLAttributeSpecification('show', defaultBindings, true, false), + new models_1.HTMLAttributeSpecification('if', defaultBindings, true, false), + new models_1.HTMLAttributeSpecification('naive-if', defaultBindings, true, false), + new models_1.HTMLAttributeSpecification('with', defaultBindings, true, false), + new models_1.HTMLAttributeSpecification('slot', [], true, false), + new models_1.HTMLAttributeSpecification('view-spy', [], true, false), + new models_1.HTMLAttributeSpecification('compile-spy', [], true, false), +]; +const actionRedirectOptions = ['capture', 'delegate', 'trigger', 'call']; +const actionRedirectOptionsNonBubbling = ['capture', 'trigger', 'call']; +const globalEvents = [ + // Resource Events + new models_1.HTMLAttributeSpecification('error', actionRedirectOptionsNonBubbling), + new models_1.HTMLAttributeSpecification('abort', actionRedirectOptionsNonBubbling), + new models_1.HTMLAttributeSpecification('load', actionRedirectOptionsNonBubbling), + new models_1.HTMLAttributeSpecification('unload', actionRedirectOptionsNonBubbling), + // Focus Events + new models_1.HTMLAttributeSpecification('blur', actionRedirectOptionsNonBubbling), + new models_1.HTMLAttributeSpecification('focus', ['call', 'capture', 'trigger', 'bind', 'one-way', 'two-way', 'one-time']), + // CSS Animation Events + new models_1.HTMLAttributeSpecification('animationstart', actionRedirectOptions), + new models_1.HTMLAttributeSpecification('animationend', actionRedirectOptions), + new models_1.HTMLAttributeSpecification('animationiteration', actionRedirectOptions), + // Text Composition Events + new models_1.HTMLAttributeSpecification('compositionstart', actionRedirectOptions), + new models_1.HTMLAttributeSpecification('compositionupdate', actionRedirectOptions), + new models_1.HTMLAttributeSpecification('compositionend', actionRedirectOptions), + // View Events + new models_1.HTMLAttributeSpecification('scroll', actionRedirectOptionsNonBubbling), + // Clipboard Events + new models_1.HTMLAttributeSpecification('cut', actionRedirectOptions), + new models_1.HTMLAttributeSpecification('copy', actionRedirectOptions), + new models_1.HTMLAttributeSpecification('paste', actionRedirectOptions), + // Keyboard Events + new models_1.HTMLAttributeSpecification('keydown', actionRedirectOptions), + new models_1.HTMLAttributeSpecification('keypress', actionRedirectOptions), + new models_1.HTMLAttributeSpecification('keyup', actionRedirectOptions), + // Mouse Events + new models_1.HTMLAttributeSpecification('mouseenter', actionRedirectOptionsNonBubbling), + new models_1.HTMLAttributeSpecification('mouseover', actionRedirectOptions), + new models_1.HTMLAttributeSpecification('mousemove', actionRedirectOptions), + new models_1.HTMLAttributeSpecification('mousedown', actionRedirectOptions), + new models_1.HTMLAttributeSpecification('mouseup', actionRedirectOptions), + new models_1.HTMLAttributeSpecification('mouseout', actionRedirectOptionsNonBubbling), + new models_1.HTMLAttributeSpecification('click', actionRedirectOptions), + new models_1.HTMLAttributeSpecification('dblclick', actionRedirectOptions), + new models_1.HTMLAttributeSpecification('contextmenu', actionRedirectOptions), + new models_1.HTMLAttributeSpecification('wheel', actionRedirectOptions), + new models_1.HTMLAttributeSpecification('mouseleave', actionRedirectOptionsNonBubbling), + new models_1.HTMLAttributeSpecification('mouseout', actionRedirectOptions), + new models_1.HTMLAttributeSpecification('select', actionRedirectOptionsNonBubbling), + new models_1.HTMLAttributeSpecification('pointerlockchange', actionRedirectOptions), + new models_1.HTMLAttributeSpecification('pointerlockerror', actionRedirectOptions), + // Drag & Drop Events + new models_1.HTMLAttributeSpecification('dragstart', actionRedirectOptions), + new models_1.HTMLAttributeSpecification('drag', actionRedirectOptions), + new models_1.HTMLAttributeSpecification('dragend', actionRedirectOptions), + new models_1.HTMLAttributeSpecification('dragenter', actionRedirectOptions), + new models_1.HTMLAttributeSpecification('dragover', actionRedirectOptions), + new models_1.HTMLAttributeSpecification('dragleave', actionRedirectOptions), + new models_1.HTMLAttributeSpecification('drop', actionRedirectOptions), + // Touch events + new models_1.HTMLAttributeSpecification('touchstart', actionRedirectOptions), + new models_1.HTMLAttributeSpecification('touchmove', actionRedirectOptions), + new models_1.HTMLAttributeSpecification('touchend', actionRedirectOptions), + // Other + new models_1.HTMLAttributeSpecification('close', actionRedirectOptions), +]; +exports.AURELIA_EVENTS = { + 'a': globalEvents, + 'abbr': globalEvents, + 'address': globalEvents, + 'area': globalEvents, + 'article': globalEvents, + 'aside': globalEvents, + 'audio': globalEvents, + 'b': globalEvents, + 'base': globalEvents, + 'bdi': globalEvents, + 'bdo': globalEvents, + 'blockquote': globalEvents, + 'body': globalEvents, + 'br': globalEvents, + 'button': globalEvents, + 'canvas': globalEvents, + 'caption': globalEvents, + 'cite': globalEvents, + 'code': globalEvents, + 'col': globalEvents, + 'colgroup': globalEvents, + 'data': globalEvents, + 'datalist': globalEvents, + 'dd': globalEvents, + 'del': globalEvents, + 'details': globalEvents, + 'dfn': globalEvents, + 'div': globalEvents, + 'dl': globalEvents, + 'dt': globalEvents, + 'em': globalEvents, + 'embed': globalEvents, + 'fieldset': globalEvents, + 'figcaption': globalEvents, + 'figure': globalEvents, + 'footer': globalEvents, + 'form': [ + ...globalEvents, + new models_1.HTMLAttributeSpecification('reset', actionRedirectOptions), + new models_1.HTMLAttributeSpecification('submit', actionRedirectOptions), + new models_1.HTMLAttributeSpecification('change', actionRedirectOptions), + new models_1.HTMLAttributeSpecification('input', actionRedirectOptions), + ], + 'header': globalEvents, + 'hr': globalEvents, + 'i': globalEvents, + 'iframe': globalEvents, + 'img': globalEvents, + 'input': globalEvents, + 'ins': globalEvents, + 'kbd': globalEvents, + 'label': globalEvents, + 'legend': globalEvents, + 'li': globalEvents, + 'link': globalEvents, + 'main': globalEvents, + 'map': globalEvents, + 'mark': globalEvents, + 'meter': globalEvents, + 'nav': globalEvents, + 'object': globalEvents, + 'ol': globalEvents, + 'optgroup': globalEvents, + 'option': globalEvents, + 'output': globalEvents, + 'p': [...globalEvents], + 'param': [...globalEvents], + 'pre': [...globalEvents], + 'progress': [...globalEvents], + 'q': globalEvents, + 'rp': globalEvents, + 'rt': globalEvents, + 'rtc': globalEvents, + 'ruby': globalEvents, + 's': globalEvents, + 'samp': globalEvents, + 'section': globalEvents, + 'select': globalEvents, + 'shadow': globalEvents, + 'small': globalEvents, + 'source': globalEvents, + 'span': globalEvents, + 'strong': globalEvents, + 'sub': globalEvents, + 'summary': globalEvents, + 'sup': globalEvents, + 'table': globalEvents, + 'tbody': globalEvents, + 'td': globalEvents, + 'template': globalEvents, + 'textarea': globalEvents, + 'tfoot': globalEvents, + 'th': globalEvents, + 'thead': globalEvents, + 'time': globalEvents, + 'title': globalEvents, + 'tr': globalEvents, + 'track': globalEvents, + 'u': globalEvents, + 'ul': globalEvents, + 'var': globalEvents, + 'video': globalEvents, + 'wbr': globalEvents, +}; //# sourceMappingURL=aureliaTags.js.map \ No newline at end of file diff --git a/dist/src/server/aurelia-languageservice/parser/aureliaTags.js.map b/dist/src/server/aurelia-languageservice/parser/aureliaTags.js.map index 81a08ee4..6467ac66 100644 --- a/dist/src/server/aurelia-languageservice/parser/aureliaTags.js.map +++ b/dist/src/server/aurelia-languageservice/parser/aureliaTags.js.map @@ -1 +1 @@ -{"version":3,"file":"aureliaTags.js","sourceRoot":"","sources":["../../../../../src/server/aurelia-languageservice/parser/aureliaTags.ts"],"names":[],"mappings":";AAAA,yBAAiG,UAAU,CAAC,CAAA;AAE/F,oBAAY,GAAW;IAClC,SAAS,EAAG,IAAI,6BAAoB,CAAC,gGAAgG,EAAE;QACrI,IAAI,mCAA0B,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC;QACvD,IAAI,mCAA0B,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,CAAE,CAAC;IAC1D,aAAa,EAAE,IAAI,6BAAoB,CAAC,oCAAoC,EAAE;QAC5E,IAAI,mCAA0B,CAAC,MAAM,CAAC;QACtC,IAAI,mCAA0B,CAAC,aAAa,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC;QAC9D,IAAI,mCAA0B,CAAE,mBAAmB,EAAE,EAAE,E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AE,YAAY;CACpB,CAAC"} \ No newline at end of file +{"version":3,"file":"aureliaTags.js","sourceRoot":"","sources":["../../../../../src/server/aurelia-languageservice/parser/aureliaTags.ts"],"names":[],"mappings":";AAAA,qCAA4G;AAE/F,QAAA,YAAY,GAAW;IAClC,SAAS,EAAG,IAAI,6BAAoB,CAAC,gGAAgG,EAAE;QACrI,IAAI,mCAA0B,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC;QACvD,IAAI,mCAA0B,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC;KAAE,CAAC;IAC1D,aAAa,EAAE,IAAI,6BAAoB,CAAC,oCAAoC,EAAE;QAC5E,IAAI,mCAA0B,CAAC,MAAM,CAAC;QACtC,IAAI,mCAA0B,CAAC,aAAa,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC;QAC9D,IAAI,mCAA0B,CAAE,mBAAmB,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC;QACrE,IAAI,mCAA0B,CAAC,cAAc,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC;KAAC,CAAC;IACnE,SAAS,EAAE,IAAI,6BAAoB,CAAC,2CAA2C,EAAE;QAC/E,IAAI,mCAA0B,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC;KAAC,CAAC;IAC3D,MAAM,EAAE,IAAI,6BAAoB,CAAC,sGAAsG,EAAE;QACvI,IAAI,mCAA0B,CAAC,MAAM,CAAC;QACtC,IAAI,mCAA0B,CAAC,MAAM,CAAC;KAAC,CAAC;CAC3C,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAEtD,QAAA,kBAAkB,GAAiB;IAC5C,QAAQ,EAAI,CAAE,IAAI,mCAA0B,CAAC,SAAS,EAAE,eAAe,EAAE,IAAI,EAAE,KAAK,CAAC,CAAE;IACvF,Q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AY;IACpB,SAAS,EAAE,YAAY;IACvB,QAAQ,EAAE,YAAY;IACtB,QAAQ,EAAE,YAAY;IACtB,OAAO,EAAE,YAAY;IACrB,QAAQ,EAAE,YAAY;IACtB,MAAM,EAAE,YAAY;IACpB,QAAQ,EAAE,YAAY;IACtB,KAAK,EAAE,YAAY;IACnB,SAAS,EAAE,YAAY;IACvB,KAAK,EAAE,YAAY;IACnB,OAAO,EAAE,YAAY;IACrB,OAAO,EAAE,YAAY;IACrB,IAAI,EAAE,YAAY;IAClB,UAAU,EAAE,YAAY;IACxB,UAAU,EAAE,YAAY;IACxB,OAAO,EAAE,YAAY;IACrB,IAAI,EAAE,YAAY;IAClB,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,YAAY;IACpB,OAAO,EAAE,YAAY;IACrB,IAAI,EAAE,YAAY;IAClB,OAAO,EAAE,YAAY;IACrB,GAAG,EAAE,YAAY;IACjB,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,YAAY;IACnB,OAAO,EAAE,YAAY;IACrB,KAAK,EAAE,YAAY;CACpB,CAAC"} \ No newline at end of file diff --git a/dist/src/server/aurelia-languageservice/parser/htmlParser.js b/dist/src/server/aurelia-languageservice/parser/htmlParser.js index 509fab17..8010d2c5 100644 --- a/dist/src/server/aurelia-languageservice/parser/htmlParser.js +++ b/dist/src/server/aurelia-languageservice/parser/htmlParser.js @@ -1,167 +1,168 @@ -"use strict"; -const htmlScanner_1 = require('./htmlScanner'); -class Node { - constructor(start, end, children, parent) { - this.start = start; - this.end = end; - this.children = children; - this.parent = parent; - } - get firstChild() { return this.children[0]; } - get lastChild() { return this.children.length ? this.children[this.children.length - 1] : void 0; } - findNodeBefore(offset) { - let idx = findFirst(this.children, c => offset <= c.start) - 1; - if (idx >= 0) { - let child = this.children[idx]; - if (offset > child.start) { - if (offset < child.end) { - return child.findNodeBefore(offset); - } - let lastChild = child.lastChild; - if (lastChild && lastChild.end === child.end) { - return child.findNodeBefore(offset); - } - return child; - } - } - return this; - } - findNodeAt(offset) { - let idx = findFirst(this.children, c => offset <= c.start) - 1; - if (idx >= 0) { - let child = this.children[idx]; - if (offset > child.start && offset <= child.end) { - return child.findNodeAt(offset); - } - } - return this; - } -} -exports.Node = Node; -function parse(text) { - let scanner = htmlScanner_1.createScanner(text); - let htmlDocument = new Node(0, text.length, [], null); - let curr = htmlDocument; - let endTagStart = -1; - let token = scanner.scan(); - while (token !== htmlScanner_1.TokenType.EOS) { - // tslint:disable-next-line:switch-default - switch (token) { - case htmlScanner_1.TokenType.StartTagOpen: - let child = new Node(scanner.getTokenOffset(), text.length, [], curr); - curr.children.push(child); - curr = child; - break; - case htmlScanner_1.TokenType.StartTag: - curr.tag = scanner.getTokenText(); - break; - case htmlScanner_1.TokenType.StartTagClose: - curr.end = scanner.getTokenEnd(); // might be later set to end tag position - if (isEmptyElement(curr.tag) && curr !== htmlDocument) { - curr.closed = true; - curr = curr.parent; - } - break; - case htmlScanner_1.TokenType.EndTagOpen: - endTagStart = scanner.getTokenOffset(); - break; - case htmlScanner_1.TokenType.EndTag: - let closeTag = scanner.getTokenText(); - while (!isSameTag(curr.tag, closeTag) && curr !== htmlDocument) { - curr.end = endTagStart; - curr.closed = false; - curr = curr.parent; - } - if (curr !== htmlDocument) { - curr.closed = true; - curr.endTagStart = endTagStart; - } - break; - case htmlScanner_1.TokenType.StartTagSelfClose: - if (curr !== htmlDocument) { - curr.closed = true; - curr.end = scanner.getTokenEnd(); - curr = curr.parent; - } - break; - case htmlScanner_1.TokenType.EndTagClose: - if (curr !== htmlDocument) { - curr.end = scanner.getTokenEnd(); - curr = curr.parent; - } - break; - } - token = scanner.scan(); - } - while (curr !== htmlDocument) { - curr.end = text.length; - curr.closed = false; - curr = curr.parent; - } - return { - findNodeAt: htmlDocument.findNodeAt.bind(htmlDocument), - findNodeBefore: htmlDocument.findNodeBefore.bind(htmlDocument), - roots: htmlDocument.children, - }; -} -exports.parse = parse; -function findFirst(array, p) { - let low = 0; - let high = array.length; - if (high === 0) { - return 0; // no children - } - while (low < high) { - let mid = Math.floor((low + high) / 2); - if (p(array[mid])) { - high = mid; - } - else { - low = mid + 1; - } - } - return low; -} -function binarySearch(array, key, comparator) { - let low = 0; - let high = array.length - 1; - while (low <= high) { - // tslint:disable-next-line:no-bitwise - let mid = ((low + high) / 2) | 0; - let comp = comparator(array[mid], key); - if (comp < 0) { - low = mid + 1; - } - else if (comp > 0) { - high = mid - 1; - } - else { - return mid; - } - } - return -(low + 1); -} -exports.EMPTY_ELEMENTS = [ - 'area', - 'base', - 'br', - 'col', - 'embed', - 'hr', - 'img', - 'input', - 'keygen', - 'link', - 'menuitem', - 'meta', - 'param', - 'source', - 'track', - 'wbr']; -function isEmptyElement(e) { - return e && binarySearch(exports.EMPTY_ELEMENTS, e.toLowerCase(), (s1, s2) => s1.localeCompare(s2)) >= 0; -} -function isSameTag(t1, t2) { - return t1 && t2 && t1.toLowerCase() === t2.toLowerCase(); -} +"use strict"; +const htmlScanner_1 = require("./htmlScanner"); +class Node { + constructor(start, end, children, parent) { + this.start = start; + this.end = end; + this.children = children; + this.parent = parent; + } + get firstChild() { return this.children[0]; } + get lastChild() { return this.children.length ? this.children[this.children.length - 1] : void 0; } + findNodeBefore(offset) { + let idx = findFirst(this.children, c => offset <= c.start) - 1; + if (idx >= 0) { + let child = this.children[idx]; + if (offset > child.start) { + if (offset < child.end) { + return child.findNodeBefore(offset); + } + let lastChild = child.lastChild; + if (lastChild && lastChild.end === child.end) { + return child.findNodeBefore(offset); + } + return child; + } + } + return this; + } + findNodeAt(offset) { + let idx = findFirst(this.children, c => offset <= c.start) - 1; + if (idx >= 0) { + let child = this.children[idx]; + if (offset > child.start && offset <= child.end) { + return child.findNodeAt(offset); + } + } + return this; + } +} +exports.Node = Node; +function parse(text) { + let scanner = htmlScanner_1.createScanner(text); + let htmlDocument = new Node(0, text.length, [], null); + let curr = htmlDocument; + let endTagStart = -1; + let token = scanner.scan(); + while (token !== htmlScanner_1.TokenType.EOS) { + // tslint:disable-next-line:switch-default + switch (token) { + case htmlScanner_1.TokenType.StartTagOpen: + let child = new Node(scanner.getTokenOffset(), text.length, [], curr); + curr.children.push(child); + curr = child; + break; + case htmlScanner_1.TokenType.StartTag: + curr.tag = scanner.getTokenText(); + break; + case htmlScanner_1.TokenType.StartTagClose: + curr.end = scanner.getTokenEnd(); // might be later set to end tag position + if (isEmptyElement(curr.tag) && curr !== htmlDocument) { + curr.closed = true; + curr = curr.parent; + } + break; + case htmlScanner_1.TokenType.EndTagOpen: + endTagStart = scanner.getTokenOffset(); + break; + case htmlScanner_1.TokenType.EndTag: + let closeTag = scanner.getTokenText(); + while (!isSameTag(curr.tag, closeTag) && curr !== htmlDocument) { + curr.end = endTagStart; + curr.closed = false; + curr = curr.parent; + } + if (curr !== htmlDocument) { + curr.closed = true; + curr.endTagStart = endTagStart; + } + break; + case htmlScanner_1.TokenType.StartTagSelfClose: + if (curr !== htmlDocument) { + curr.closed = true; + curr.end = scanner.getTokenEnd(); + curr = curr.parent; + } + break; + case htmlScanner_1.TokenType.EndTagClose: + if (curr !== htmlDocument) { + curr.end = scanner.getTokenEnd(); + curr = curr.parent; + } + break; + } + token = scanner.scan(); + } + while (curr !== htmlDocument) { + curr.end = text.length; + curr.closed = false; + curr = curr.parent; + } + return { + findNodeAt: htmlDocument.findNodeAt.bind(htmlDocument), + findNodeBefore: htmlDocument.findNodeBefore.bind(htmlDocument), + roots: htmlDocument.children, + }; +} +exports.parse = parse; +function findFirst(array, p) { + let low = 0; + let high = array.length; + if (high === 0) { + return 0; // no children + } + while (low < high) { + let mid = Math.floor((low + high) / 2); + if (p(array[mid])) { + high = mid; + } + else { + low = mid + 1; + } + } + return low; +} +function binarySearch(array, key, comparator) { + let low = 0; + let high = array.length - 1; + while (low <= high) { + // tslint:disable-next-line:no-bitwise + let mid = ((low + high) / 2) | 0; + let comp = comparator(array[mid], key); + if (comp < 0) { + low = mid + 1; + } + else if (comp > 0) { + high = mid - 1; + } + else { + return mid; + } + } + return -(low + 1); +} +exports.EMPTY_ELEMENTS = [ + 'area', + 'base', + 'br', + 'col', + 'embed', + 'hr', + 'img', + 'input', + 'keygen', + 'link', + 'menuitem', + 'meta', + 'param', + 'source', + 'track', + 'wbr' +]; +function isEmptyElement(e) { + return e && binarySearch(exports.EMPTY_ELEMENTS, e.toLowerCase(), (s1, s2) => s1.localeCompare(s2)) >= 0; +} +function isSameTag(t1, t2) { + return t1 && t2 && t1.toLowerCase() === t2.toLowerCase(); +} //# sourceMappingURL=htmlParser.js.map \ No newline at end of file diff --git a/dist/src/server/aurelia-languageservice/parser/htmlParser.js.map b/dist/src/server/aurelia-languageservice/parser/htmlParser.js.map index b8c513f5..a3a12a29 100644 --- a/dist/src/server/aurelia-languageservice/parser/htmlParser.js.map +++ b/dist/src/server/aurelia-languageservice/parser/htmlParser.js.map @@ -1 +1 @@ -{"version":3,"file":"htmlParser.js","sourceRoot":"","sources":["../../../../../src/server/aurelia-languageservice/parser/htmlParser.ts"],"names":[],"mappings":";AAAA,8BAAyC,eAAe,CAAC,CAAA;AAEzD;IAIE,YAAmB,KAAa,EAAS,GAAW,EAAS,QAAgB,EAAS,MAAY;QAA/E,UAAK,GAAL,KAAK,CAAQ;QAAS,QAAG,GAAH,GAAG,CAAQ;QAAS,aAAQ,GAAR,QAAQ,CAAQ;QAAS,WAAM,GAAN,MAAM,CAAM;IAElG,CAAC;IACD,IAAW,UAAU,KAAW,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1D,IAAW,SAAS,KAAW,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAEzG,cAAc,CAAC,MAAc;QAClC,IAAI,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,IAAI,MAAM,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,CAAC,GAAG,CAAC,CAAC;QACjC,IAAI,IAAI,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;QACvC,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;YACb,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC;QAChB,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;YACpB,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC;QACjB,CAAC;QAAC,IAAI,CAAC,CAAC;YACN,MAAM,CAAC,GAAG,CAAC;QACb,CAAC;IACH,CAAC;IACD,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;AACpB,CAAC;AAEY,sBAAc,GAAa;IACtC,MAAM;IACN,MAAM;IACN,IAAI;IACJ,KAAK;IACL,OAAO;IACP,IAAI;IACJ,KAAK;IACL,OAAO;IACP,QAAQ;IACR,MAAM;IACN,UAAU;IACV,MAAM;IACN,OAAO;IACP,QAAQ;IACR,OAAO;IACP,KAAK,CAAC,CAAC;AAET,wBAAwB,CAAS;IAC/B,MAAM,CAAC,CAAC,IAAI,YAAY,CAAC,sBAAc,EAAE,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,EAAU,EAAE,EAAU,KAAK,EAAE,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACnH,CAAC;AACD,mBAAmB,EAAU,EAAE,EAAU;IACvC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,EAAE,CAAC,WAAW,EAAE,CAAC;AAC3D,CAAC"} \ No newline at end of file +{"version":3,"file":"htmlParser.js","sourceRoot":"","sources":["../../../../../src/server/aurelia-languageservice/parser/htmlParser.ts"],"names":[],"mappings":";AAAA,+CAAyD;AAEzD;IAIE,YAAmB,KAAa,EAAS,GAAW,EAAS,QAAgB,EAA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B,MAAM,CAAC,CAAC,IAAI,YAAY,CAAC,sBAAc,EAAE,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,EAAU,EAAE,EAAU,KAAK,EAAE,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACnH,CAAC;AACD,mBAAmB,EAAU,EAAE,EAAU;IACvC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,EAAE,CAAC,WAAW,EAAE,CAAC;AAC3D,CAAC"} \ No newline at end of file diff --git a/dist/src/server/aurelia-languageservice/parser/htmlScanner.js b/dist/src/server/aurelia-languageservice/parser/htmlScanner.js index f5492688..8db1bb6b 100644 --- a/dist/src/server/aurelia-languageservice/parser/htmlScanner.js +++ b/dist/src/server/aurelia-languageservice/parser/htmlScanner.js @@ -1,423 +1,423 @@ -"use strict"; -(function (TokenType) { - TokenType[TokenType["StartCommentTag"] = 0] = "StartCommentTag"; - TokenType[TokenType["Comment"] = 1] = "Comment"; - TokenType[TokenType["EndCommentTag"] = 2] = "EndCommentTag"; - TokenType[TokenType["StartTagOpen"] = 3] = "StartTagOpen"; - TokenType[TokenType["StartTagClose"] = 4] = "StartTagClose"; - TokenType[TokenType["StartTagSelfClose"] = 5] = "StartTagSelfClose"; - TokenType[TokenType["StartTag"] = 6] = "StartTag"; - TokenType[TokenType["EndTagOpen"] = 7] = "EndTagOpen"; - TokenType[TokenType["EndTagClose"] = 8] = "EndTagClose"; - TokenType[TokenType["EndTag"] = 9] = "EndTag"; - TokenType[TokenType["DelimiterAssign"] = 10] = "DelimiterAssign"; - TokenType[TokenType["AttributeName"] = 11] = "AttributeName"; - TokenType[TokenType["AttributeValue"] = 12] = "AttributeValue"; - TokenType[TokenType["StartDoctypeTag"] = 13] = "StartDoctypeTag"; - TokenType[TokenType["Doctype"] = 14] = "Doctype"; - TokenType[TokenType["EndDoctypeTag"] = 15] = "EndDoctypeTag"; - TokenType[TokenType["Content"] = 16] = "Content"; - TokenType[TokenType["Whitespace"] = 17] = "Whitespace"; - TokenType[TokenType["Unknown"] = 18] = "Unknown"; - TokenType[TokenType["Script"] = 19] = "Script"; - TokenType[TokenType["Styles"] = 20] = "Styles"; - TokenType[TokenType["EOS"] = 21] = "EOS"; -})(exports.TokenType || (exports.TokenType = {})); -var TokenType = exports.TokenType; -class MultiLineStream { - constructor(source, position) { - this.source = source; - this.len = source.length; - this.position = position; - } - eos() { - return this.len <= this.position; - } - getSource() { - return this.source; - } - pos() { - return this.position; - } - goBackTo(pos) { - this.position = pos; - } - goBack(n) { - this.position -= n; - } - advance(n) { - this.position += n; - } - goToEnd() { - this.position = this.source.length; - } - nextChar() { - return this.source.charCodeAt(this.position++) || 0; - } - peekChar(n = 0) { - return this.source.charCodeAt(this.position + n) || 0; - } - advanceIfChar(ch) { - if (ch === this.source.charCodeAt(this.position)) { - this.position++; - return true; - } - return false; - } - advanceIfChars(ch) { - let i; - 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; - } - advanceIfRegExp(regex) { - 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 ''; - } - advanceUntilRegExp(regex) { - let str = this.source.substr(this.position); - let match = str.match(regex); - if (match) { - this.position = this.position + match.index; - return match[0]; - } - return ''; - } - advanceUntilChar(ch) { - while (this.position < this.source.length) { - if (this.source.charCodeAt(this.position) === ch) { - return true; - } - this.advance(1); - } - return false; - } - advanceUntilChars(ch) { - while (this.position + ch.length <= this.source.length) { - let i = 0; - // tslint:disable-next-line:no-empty - for (; i < ch.length && this.source.charCodeAt(this.position + i) === ch[i]; i++) { - } - if (i === ch.length) { - return true; - } - this.advance(1); - } - this.goToEnd(); - return false; - } - skipWhitespace() { - let n = this.advanceWhileChar(ch => { - return ch === _WSP || ch === _TAB || ch === _NWL || ch === _LFD || ch === _CAR; - }); - return n > 0; - } - advanceWhileChar(condition) { - 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); -(function (ScannerState) { - ScannerState[ScannerState["WithinContent"] = 0] = "WithinContent"; - ScannerState[ScannerState["AfterOpeningStartTag"] = 1] = "AfterOpeningStartTag"; - ScannerState[ScannerState["AfterOpeningEndTag"] = 2] = "AfterOpeningEndTag"; - ScannerState[ScannerState["WithinDoctype"] = 3] = "WithinDoctype"; - ScannerState[ScannerState["WithinTag"] = 4] = "WithinTag"; - ScannerState[ScannerState["WithinEndTag"] = 5] = "WithinEndTag"; - ScannerState[ScannerState["WithinComment"] = 6] = "WithinComment"; - ScannerState[ScannerState["WithinScriptContent"] = 7] = "WithinScriptContent"; - ScannerState[ScannerState["WithinStyleContent"] = 8] = "WithinStyleContent"; - ScannerState[ScannerState["AfterAttributeName"] = 9] = "AfterAttributeName"; - ScannerState[ScannerState["BeforeAttributeValue"] = 10] = "BeforeAttributeValue"; -})(exports.ScannerState || (exports.ScannerState = {})); -var ScannerState = exports.ScannerState; -const htmlScriptContents = { - 'text/x-handlebars-template': true, -}; -function createScanner(input, initialOffset = 0, initialState = ScannerState.WithinContent) { - let stream = new MultiLineStream(input, initialOffset); - let state = initialState; - let tokenOffset = 0; - let tokenType = void 0; - let tokenError; - let hasSpaceAfterTag; - let lastTag; - let lastAttributeName; - let lastTypeValue; - function nextElementName() { - return stream.advanceIfRegExp(/^[_:\w][_:\w-.\d]*/).toLowerCase(); - } - function nextAttributeName() { - return stream.advanceIfRegExp(/^[^\s"'>/=\x00-\x0F\x7F\x80-\x9F]*/).toLowerCase(); - } - function finishToken(offset, type, errorMessage) { - tokenType = type; - tokenOffset = offset; - tokenError = errorMessage; - return type; - } - function scan() { - let offset = stream.pos(); - let oldState = state; - let token = internalScan(); - if (token !== TokenType.EOS && offset === stream.pos()) { - // tslint:disable-next-line:no-console - console.log('Scanner.scan has not advanced at offset ' + offset + ', state before: ' + oldState + ' after: ' + state); - stream.advance(1); - return finishToken(offset, TokenType.Unknown); - } - return token; - } - function internalScan() { - let offset = stream.pos(); - if (stream.eos()) { - return finishToken(offset, TokenType.EOS); - } - let errorMessage; - // tslint:disable-next-line:switch-default - switch (state) { - case ScannerState.WithinComment: - if (stream.advanceIfChars([_MIN, _MIN, _RAN])) { - state = ScannerState.WithinContent; - return finishToken(offset, TokenType.EndCommentTag); - } - stream.advanceUntilChars([_MIN, _MIN, _RAN]); // --> - return finishToken(offset, TokenType.Comment); - case ScannerState.WithinDoctype: - if (stream.advanceIfChar(_RAN)) { - state = ScannerState.WithinContent; - return finishToken(offset, TokenType.EndDoctypeTag); - } - stream.advanceUntilChar(_RAN); // > - return finishToken(offset, TokenType.Doctype); - case ScannerState.WithinContent: - if (stream.advanceIfChar(_LAN)) { - if (!stream.eos() && stream.peekChar() === _BNG) { - if (stream.advanceIfChars([_BNG, _MIN, _MIN])) { - state = ScannerState.WithinComment; - return finishToken(offset, TokenType.StartCommentTag); - } - if (stream.advanceIfRegExp(/^!doctype/i)) { - state = ScannerState.WithinDoctype; - return finishToken(offset, TokenType.StartDoctypeTag); - } - } - if (stream.advanceIfChar(_FSL)) { - state = ScannerState.AfterOpeningEndTag; - return finishToken(offset, TokenType.EndTagOpen); - } - state = ScannerState.AfterOpeningStartTag; - return finishToken(offset, TokenType.StartTagOpen); - } - stream.advanceUntilChar(_LAN); - return finishToken(offset, TokenType.Content); - case ScannerState.AfterOpeningEndTag: - let tagName = nextElementName(); - if (tagName.length > 0) { - state = ScannerState.WithinEndTag; - return finishToken(offset, TokenType.EndTag); - } - if (stream.skipWhitespace()) { - return finishToken(offset, TokenType.Whitespace, 'Tag name must directly follow the open bracket.'); - } - state = ScannerState.WithinEndTag; - stream.advanceUntilChar(_RAN); - if (offset < stream.pos()) { - return finishToken(offset, TokenType.Unknown, 'End tag name expected.'); - } - return internalScan(); - case ScannerState.WithinEndTag: - if (stream.skipWhitespace()) { - return finishToken(offset, TokenType.Whitespace); - } - if (stream.advanceIfChar(_RAN)) { - state = ScannerState.WithinContent; - return finishToken(offset, TokenType.EndTagClose); - } - errorMessage = 'Closing bracket expected.'; - break; - case ScannerState.AfterOpeningStartTag: - lastTag = nextElementName(); - lastTypeValue = null; - lastAttributeName = null; - if (lastTag.length > 0) { - hasSpaceAfterTag = false; - state = ScannerState.WithinTag; - return finishToken(offset, TokenType.StartTag); - } - if (stream.skipWhitespace()) { - return finishToken(offset, TokenType.Whitespace, 'Tag name must directly follow the open bracket.'); - } - state = ScannerState.WithinTag; - stream.advanceUntilChar(_RAN); - if (offset < stream.pos()) { - return finishToken(offset, TokenType.Unknown, 'Start tag name expected.'); - } - return internalScan(); - case ScannerState.WithinTag: - if (stream.skipWhitespace()) { - hasSpaceAfterTag = true; // remember that we have seen a whitespace - return finishToken(offset, TokenType.Whitespace); - } - if (hasSpaceAfterTag) { - lastAttributeName = nextAttributeName(); - if (lastAttributeName.length > 0) { - state = ScannerState.AfterAttributeName; - hasSpaceAfterTag = false; - return finishToken(offset, TokenType.AttributeName); - } - } - if (stream.advanceIfChars([_FSL, _RAN])) { - state = ScannerState.WithinContent; - return finishToken(offset, TokenType.StartTagSelfClose); - } - if (stream.advanceIfChar(_RAN)) { - if (lastTag === 'script') { - if (lastTypeValue && htmlScriptContents[lastTypeValue]) { - // stay in html - state = ScannerState.WithinContent; - } - else { - state = ScannerState.WithinScriptContent; - } - } - else if (lastTag === 'style') { - state = ScannerState.WithinStyleContent; - } - else { - state = ScannerState.WithinContent; - } - return finishToken(offset, TokenType.StartTagClose); - } - stream.advance(1); - return finishToken(offset, TokenType.Unknown, 'Unexpected character in tag.'); - case ScannerState.AfterAttributeName: - if (stream.skipWhitespace()) { - hasSpaceAfterTag = true; - return finishToken(offset, TokenType.Whitespace); - } - if (stream.advanceIfChar(_EQS)) { - state = ScannerState.BeforeAttributeValue; - return finishToken(offset, TokenType.DelimiterAssign); - } - state = ScannerState.WithinTag; - return internalScan(); // no advance yet - jump to WithinTag - case ScannerState.BeforeAttributeValue: - if (stream.skipWhitespace()) { - return finishToken(offset, TokenType.Whitespace); - } - let attributeValue = stream.advanceIfRegExp(/^[^\s"'`=<>]+/); - if (attributeValue.length > 0) { - if (lastAttributeName === 'type') { - lastTypeValue = attributeValue; - } - state = ScannerState.WithinTag; - hasSpaceAfterTag = false; - return finishToken(offset, TokenType.AttributeValue); - } - let ch = stream.peekChar(); - if (ch === _SQO || ch === _DQO) { - stream.advance(1); // consume quote - if (stream.advanceUntilChar(ch)) { - stream.advance(1); // consume quote - } - if (lastAttributeName === 'type') { - lastTypeValue = stream.getSource().substring(offset + 1, stream.pos() - 1); - } - state = ScannerState.WithinTag; - hasSpaceAfterTag = false; - return finishToken(offset, TokenType.AttributeValue); - } - state = ScannerState.WithinTag; - hasSpaceAfterTag = false; - return internalScan(); // no advance yet - jump to WithinTag - case ScannerState.WithinScriptContent: - // see http://stackoverflow.com/questions/14574471/how-do-browsers-parse-a-script-tag-exactly - let sciptState = 1; - while (!stream.eos()) { - let match = stream.advanceIfRegExp(/|<\/?script\s*\/?>?/i); - if (match.length === 0) { - stream.goToEnd(); - return finishToken(offset, TokenType.Script); - } - else if (match === '') { - sciptState = 1; - } - else if (match[1] !== '/') { - if (sciptState === 2) { - sciptState = 3; - } - } - else { - if (sciptState === 3) { - sciptState = 2; - } - else { - stream.goBack(match.length); // to the beginning of the closing tag - break; - } - } - } - state = ScannerState.WithinContent; - if (offset < stream.pos()) { - return finishToken(offset, TokenType.Script); - } - return internalScan(); // no advance yet - jump to content - case ScannerState.WithinScriptContent: - stream.advanceUntilRegExp(/<\/style/i); - state = ScannerState.WithinContent; - if (offset < stream.pos()) { - return finishToken(offset, TokenType.Styles); - } - return internalScan(); // no advance yet - jump to content - } - stream.advance(1); - state = ScannerState.WithinContent; - return finishToken(offset, TokenType.Unknown, errorMessage); - } - return { - getScannerState: () => state, - getTokenEnd: () => stream.pos(), - getTokenError: () => tokenError, - getTokenLength: () => stream.pos() - tokenOffset, - getTokenOffset: () => tokenOffset, - getTokenText: () => stream.getSource().substring(tokenOffset, stream.pos()), - getTokenType: () => tokenType, - scan, - }; -} -exports.createScanner = createScanner; +"use strict"; +var TokenType; +(function (TokenType) { + TokenType[TokenType["StartCommentTag"] = 0] = "StartCommentTag"; + TokenType[TokenType["Comment"] = 1] = "Comment"; + TokenType[TokenType["EndCommentTag"] = 2] = "EndCommentTag"; + TokenType[TokenType["StartTagOpen"] = 3] = "StartTagOpen"; + TokenType[TokenType["StartTagClose"] = 4] = "StartTagClose"; + TokenType[TokenType["StartTagSelfClose"] = 5] = "StartTagSelfClose"; + TokenType[TokenType["StartTag"] = 6] = "StartTag"; + TokenType[TokenType["EndTagOpen"] = 7] = "EndTagOpen"; + TokenType[TokenType["EndTagClose"] = 8] = "EndTagClose"; + TokenType[TokenType["EndTag"] = 9] = "EndTag"; + TokenType[TokenType["DelimiterAssign"] = 10] = "DelimiterAssign"; + TokenType[TokenType["AttributeName"] = 11] = "AttributeName"; + TokenType[TokenType["AttributeValue"] = 12] = "AttributeValue"; + TokenType[TokenType["StartDoctypeTag"] = 13] = "StartDoctypeTag"; + TokenType[TokenType["Doctype"] = 14] = "Doctype"; + TokenType[TokenType["EndDoctypeTag"] = 15] = "EndDoctypeTag"; + TokenType[TokenType["Content"] = 16] = "Content"; + TokenType[TokenType["Whitespace"] = 17] = "Whitespace"; + TokenType[TokenType["Unknown"] = 18] = "Unknown"; + TokenType[TokenType["Script"] = 19] = "Script"; + TokenType[TokenType["Styles"] = 20] = "Styles"; + TokenType[TokenType["EOS"] = 21] = "EOS"; +})(TokenType = exports.TokenType || (exports.TokenType = {})); +class MultiLineStream { + constructor(source, position) { + this.source = source; + this.len = source.length; + this.position = position; + } + eos() { + return this.len <= this.position; + } + getSource() { + return this.source; + } + pos() { + return this.position; + } + goBackTo(pos) { + this.position = pos; + } + goBack(n) { + this.position -= n; + } + advance(n) { + this.position += n; + } + goToEnd() { + this.position = this.source.length; + } + nextChar() { + return this.source.charCodeAt(this.position++) || 0; + } + peekChar(n = 0) { + return this.source.charCodeAt(this.position + n) || 0; + } + advanceIfChar(ch) { + if (ch === this.source.charCodeAt(this.position)) { + this.position++; + return true; + } + return false; + } + advanceIfChars(ch) { + let i; + 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; + } + advanceIfRegExp(regex) { + 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 ''; + } + advanceUntilRegExp(regex) { + let str = this.source.substr(this.position); + let match = str.match(regex); + if (match) { + this.position = this.position + match.index; + return match[0]; + } + return ''; + } + advanceUntilChar(ch) { + while (this.position < this.source.length) { + if (this.source.charCodeAt(this.position) === ch) { + return true; + } + this.advance(1); + } + return false; + } + advanceUntilChars(ch) { + while (this.position + ch.length <= this.source.length) { + let i = 0; + // tslint:disable-next-line:no-empty + for (; i < ch.length && this.source.charCodeAt(this.position + i) === ch[i]; i++) { + } + if (i === ch.length) { + return true; + } + this.advance(1); + } + this.goToEnd(); + return false; + } + skipWhitespace() { + let n = this.advanceWhileChar(ch => { + return ch === _WSP || ch === _TAB || ch === _NWL || ch === _LFD || ch === _CAR; + }); + return n > 0; + } + advanceWhileChar(condition) { + 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); +var ScannerState; +(function (ScannerState) { + ScannerState[ScannerState["WithinContent"] = 0] = "WithinContent"; + ScannerState[ScannerState["AfterOpeningStartTag"] = 1] = "AfterOpeningStartTag"; + ScannerState[ScannerState["AfterOpeningEndTag"] = 2] = "AfterOpeningEndTag"; + ScannerState[ScannerState["WithinDoctype"] = 3] = "WithinDoctype"; + ScannerState[ScannerState["WithinTag"] = 4] = "WithinTag"; + ScannerState[ScannerState["WithinEndTag"] = 5] = "WithinEndTag"; + ScannerState[ScannerState["WithinComment"] = 6] = "WithinComment"; + ScannerState[ScannerState["WithinScriptContent"] = 7] = "WithinScriptContent"; + ScannerState[ScannerState["WithinStyleContent"] = 8] = "WithinStyleContent"; + ScannerState[ScannerState["AfterAttributeName"] = 9] = "AfterAttributeName"; + ScannerState[ScannerState["BeforeAttributeValue"] = 10] = "BeforeAttributeValue"; +})(ScannerState = exports.ScannerState || (exports.ScannerState = {})); +const htmlScriptContents = { + 'text/x-handlebars-template': true, +}; +function createScanner(input, initialOffset = 0, initialState = ScannerState.WithinContent) { + let stream = new MultiLineStream(input, initialOffset); + let state = initialState; + let tokenOffset = 0; + let tokenType = void 0; + let tokenError; + let hasSpaceAfterTag; + let lastTag; + let lastAttributeName; + let lastTypeValue; + function nextElementName() { + return stream.advanceIfRegExp(/^[_:\w][_:\w-.\d]*/).toLowerCase(); + } + function nextAttributeName() { + return stream.advanceIfRegExp(/^[^\s"'>/=\x00-\x0F\x7F\x80-\x9F]*/).toLowerCase(); + } + function finishToken(offset, type, errorMessage) { + tokenType = type; + tokenOffset = offset; + tokenError = errorMessage; + return type; + } + function scan() { + let offset = stream.pos(); + let oldState = state; + let token = internalScan(); + if (token !== TokenType.EOS && offset === stream.pos()) { + // tslint:disable-next-line:no-console + console.log('Scanner.scan has not advanced at offset ' + offset + ', state before: ' + oldState + ' after: ' + state); + stream.advance(1); + return finishToken(offset, TokenType.Unknown); + } + return token; + } + function internalScan() { + let offset = stream.pos(); + if (stream.eos()) { + return finishToken(offset, TokenType.EOS); + } + let errorMessage; + // tslint:disable-next-line:switch-default + switch (state) { + case ScannerState.WithinComment: + if (stream.advanceIfChars([_MIN, _MIN, _RAN])) { + state = ScannerState.WithinContent; + return finishToken(offset, TokenType.EndCommentTag); + } + stream.advanceUntilChars([_MIN, _MIN, _RAN]); // --> + return finishToken(offset, TokenType.Comment); + case ScannerState.WithinDoctype: + if (stream.advanceIfChar(_RAN)) { + state = ScannerState.WithinContent; + return finishToken(offset, TokenType.EndDoctypeTag); + } + stream.advanceUntilChar(_RAN); // > + return finishToken(offset, TokenType.Doctype); + case ScannerState.WithinContent: + if (stream.advanceIfChar(_LAN)) { + if (!stream.eos() && stream.peekChar() === _BNG) { + if (stream.advanceIfChars([_BNG, _MIN, _MIN])) { + state = ScannerState.WithinComment; + return finishToken(offset, TokenType.StartCommentTag); + } + if (stream.advanceIfRegExp(/^!doctype/i)) { + state = ScannerState.WithinDoctype; + return finishToken(offset, TokenType.StartDoctypeTag); + } + } + if (stream.advanceIfChar(_FSL)) { + state = ScannerState.AfterOpeningEndTag; + return finishToken(offset, TokenType.EndTagOpen); + } + state = ScannerState.AfterOpeningStartTag; + return finishToken(offset, TokenType.StartTagOpen); + } + stream.advanceUntilChar(_LAN); + return finishToken(offset, TokenType.Content); + case ScannerState.AfterOpeningEndTag: + let tagName = nextElementName(); + if (tagName.length > 0) { + state = ScannerState.WithinEndTag; + return finishToken(offset, TokenType.EndTag); + } + if (stream.skipWhitespace()) { + return finishToken(offset, TokenType.Whitespace, 'Tag name must directly follow the open bracket.'); + } + state = ScannerState.WithinEndTag; + stream.advanceUntilChar(_RAN); + if (offset < stream.pos()) { + return finishToken(offset, TokenType.Unknown, 'End tag name expected.'); + } + return internalScan(); + case ScannerState.WithinEndTag: + if (stream.skipWhitespace()) { + return finishToken(offset, TokenType.Whitespace); + } + if (stream.advanceIfChar(_RAN)) { + state = ScannerState.WithinContent; + return finishToken(offset, TokenType.EndTagClose); + } + errorMessage = 'Closing bracket expected.'; + break; + case ScannerState.AfterOpeningStartTag: + lastTag = nextElementName(); + lastTypeValue = null; + lastAttributeName = null; + if (lastTag.length > 0) { + hasSpaceAfterTag = false; + state = ScannerState.WithinTag; + return finishToken(offset, TokenType.StartTag); + } + if (stream.skipWhitespace()) { + return finishToken(offset, TokenType.Whitespace, 'Tag name must directly follow the open bracket.'); + } + state = ScannerState.WithinTag; + stream.advanceUntilChar(_RAN); + if (offset < stream.pos()) { + return finishToken(offset, TokenType.Unknown, 'Start tag name expected.'); + } + return internalScan(); + case ScannerState.WithinTag: + if (stream.skipWhitespace()) { + hasSpaceAfterTag = true; // remember that we have seen a whitespace + return finishToken(offset, TokenType.Whitespace); + } + if (hasSpaceAfterTag) { + lastAttributeName = nextAttributeName(); + if (lastAttributeName.length > 0) { + state = ScannerState.AfterAttributeName; + hasSpaceAfterTag = false; + return finishToken(offset, TokenType.AttributeName); + } + } + if (stream.advanceIfChars([_FSL, _RAN])) { + state = ScannerState.WithinContent; + return finishToken(offset, TokenType.StartTagSelfClose); + } + if (stream.advanceIfChar(_RAN)) { + if (lastTag === 'script') { + if (lastTypeValue && htmlScriptContents[lastTypeValue]) { + // stay in html + state = ScannerState.WithinContent; + } + else { + state = ScannerState.WithinScriptContent; + } + } + else if (lastTag === 'style') { + state = ScannerState.WithinStyleContent; + } + else { + state = ScannerState.WithinContent; + } + return finishToken(offset, TokenType.StartTagClose); + } + stream.advance(1); + return finishToken(offset, TokenType.Unknown, 'Unexpected character in tag.'); + case ScannerState.AfterAttributeName: + if (stream.skipWhitespace()) { + hasSpaceAfterTag = true; + return finishToken(offset, TokenType.Whitespace); + } + if (stream.advanceIfChar(_EQS)) { + state = ScannerState.BeforeAttributeValue; + return finishToken(offset, TokenType.DelimiterAssign); + } + state = ScannerState.WithinTag; + return internalScan(); // no advance yet - jump to WithinTag + case ScannerState.BeforeAttributeValue: + if (stream.skipWhitespace()) { + return finishToken(offset, TokenType.Whitespace); + } + let attributeValue = stream.advanceIfRegExp(/^[^\s"'`=<>]+/); + if (attributeValue.length > 0) { + if (lastAttributeName === 'type') { + lastTypeValue = attributeValue; + } + state = ScannerState.WithinTag; + hasSpaceAfterTag = false; + return finishToken(offset, TokenType.AttributeValue); + } + let ch = stream.peekChar(); + if (ch === _SQO || ch === _DQO) { + stream.advance(1); // consume quote + if (stream.advanceUntilChar(ch)) { + stream.advance(1); // consume quote + } + if (lastAttributeName === 'type') { + lastTypeValue = stream.getSource().substring(offset + 1, stream.pos() - 1); + } + state = ScannerState.WithinTag; + hasSpaceAfterTag = false; + return finishToken(offset, TokenType.AttributeValue); + } + state = ScannerState.WithinTag; + hasSpaceAfterTag = false; + return internalScan(); // no advance yet - jump to WithinTag + case ScannerState.WithinScriptContent: + // see http://stackoverflow.com/questions/14574471/how-do-browsers-parse-a-script-tag-exactly + let sciptState = 1; + while (!stream.eos()) { + let match = stream.advanceIfRegExp(/|<\/?script\s*\/?>?/i); + if (match.length === 0) { + stream.goToEnd(); + return finishToken(offset, TokenType.Script); + } + else if (match === '') { + sciptState = 1; + } + else if (match[1] !== '/') { + if (sciptState === 2) { + sciptState = 3; + } + } + else { + if (sciptState === 3) { + sciptState = 2; + } + else { + stream.goBack(match.length); // to the beginning of the closing tag + break; + } + } + } + state = ScannerState.WithinContent; + if (offset < stream.pos()) { + return finishToken(offset, TokenType.Script); + } + return internalScan(); // no advance yet - jump to content + case ScannerState.WithinScriptContent: + stream.advanceUntilRegExp(/<\/style/i); + state = ScannerState.WithinContent; + if (offset < stream.pos()) { + return finishToken(offset, TokenType.Styles); + } + return internalScan(); // no advance yet - jump to content + } + stream.advance(1); + state = ScannerState.WithinContent; + return finishToken(offset, TokenType.Unknown, errorMessage); + } + return { + getScannerState: () => state, + getTokenEnd: () => stream.pos(), + getTokenError: () => tokenError, + getTokenLength: () => stream.pos() - tokenOffset, + getTokenOffset: () => tokenOffset, + getTokenText: () => stream.getSource().substring(tokenOffset, stream.pos()), + getTokenType: () => tokenType, + scan, + }; +} +exports.createScanner = createScanner; //# sourceMappingURL=htmlScanner.js.map \ No newline at end of file diff --git a/dist/src/server/aurelia-languageservice/parser/htmlScanner.js.map b/dist/src/server/aurelia-languageservice/parser/htmlScanner.js.map index 4484cb36..a726eeac 100644 --- a/dist/src/server/aurelia-languageservice/parser/htmlScanner.js.map +++ b/dist/src/server/aurelia-languageservice/parser/htmlScanner.js.map @@ -1 +1 @@ -{"version":3,"file":"htmlScanner.js","sourceRoot":"","sources":["../../../../../src/server/aurelia-languageservice/parser/htmlScanner.ts"],"names":[],"mappings":";AAAA,WAAY,SAAS;IACnB,+DAAe,CAAA;IACf,+CAAO,CAAA;IACP,2DAAa,CAAA;IACb,yDAAY,CAAA;IACZ,2DAAa,CAAA;IACb,mEAAiB,CAAA;IACjB,iDAAQ,CAAA;IACR,qDAAU,CAAA;IACV,uDAAW,CAAA;IACX,6CAAM,CAAA;IACN,gEAAe,CAAA;IACf,4DAAa,CAAA;IACb,8DAAc,CAAA;IACd,gEAAe,CAAA;IACf,gDAAO,CAAA;IACP,4DAAa,CAAA;IACb,gDAAO,CAAA;IACP,sDAAU,CAAA;IACV,gDAAO,CAAA;IACP,8CAAM,CAAA;IACN,8CAAM,CAAA;IACN,wCAAG,CAAA;AACL,CAAC,EAvBW,iBAAS,KAAT,iBAAS,QAuBpB;AAvBD,IAAY,SAAS,GAAT,iBAuBX,CAAA;AAED;IAME,YAAY,MAAc,EAAE,QAAgB;QAC1C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,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C3E,YAAY,EAAE,MAAM,SAAS;QAC7B,IAAI;KACL,CAAC;AACJ,CAAC;AAlQe,qBAAa,gBAkQ5B,CAAA"} \ No newline at end of file +{"version":3,"file":"htmlScanner.js","sourceRoot":"","sources":["../../../../../src/server/aurelia-languageservice/parser/htmlScanner.ts"],"names":[],"mappings":";AAAA,IAAY,SAuBX;AAvBD,WAAY,SAAS;IACnB,+DAAe,CAAA;IACf,+CAAO,CAAA;IACP,2DAAa,CAAA;IACb,yDAAY,CAAA;IACZ,2DAAa,CAAA;IACb,mEAAiB,CAAA;IACjB,iDAAQ,CAAA;IACR,qDAAU,CAAA;IACV,uDAAW,CAAA;IACX,6CAAM,CAAA;IACN,gEAAe,CAAA;IACf,4DAAa,CAAA;IACb,8DAAc,CAAA;IACd,gEAAe,CAAA;IACf,gDAAO,CAAA;IACP,4DAAa,CAAA;IACb,gDAAO,CAAA;IACP,sDAAU,CAAA;IACV,gDAAO,CAAA;IACP,8CAAM,CAAA;IACN,8CAAM,CAAA;IACN,wCAAG,CAAA;AACL,CAAC,EAvBW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAuBpB;AAED;IAME,YAAY,MAAc,EAAE,QAAgB;QAC1C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAEM,GAAG;QACR,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,QAAQ,CAAC;IACnC,CAAC;IAEM,SAAS;QACd,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAEM,GAAG;QACR,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAEM,QAAQ,CAAC,GAAW;QACzB,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC;IACtB,CAAC;IAEM,MAAM,CAAC,CAAS;QACrB,IAAI,CA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,YAAY,CAAC,aAAa,CAAC;gBACnC,EAAE,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;oBAC1B,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;gBAC/C,CAAC;gBACD,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC,mCAAmC;QAC9D,CAAC;QAED,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAClB,KAAK,GAAG,YAAY,CAAC,aAAa,CAAC;QACnC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAC9D,CAAC;IACD,MAAM,CAAC;QACL,eAAe,EAAE,MAAM,KAAK;QAC5B,WAAW,EAAE,MAAM,MAAM,CAAC,GAAG,EAAE;QAC/B,aAAa,EAAE,MAAM,UAAU;QAC/B,cAAc,EAAE,MAAM,MAAM,CAAC,GAAG,EAAE,GAAG,WAAW;QAChD,cAAc,EAAE,MAAM,WAAW;QACjC,YAAY,EAAE,MAAM,MAAM,CAAC,SAAS,EAAE,CAAC,SAAS,CAAC,WAAW,EAAE,MAAM,CAAC,GAAG,EAAE,CAAC;QAC3E,YAAY,EAAE,MAAM,SAAS;QAC7B,IAAI;KACL,CAAC;AACJ,CAAC;AAlQD,sCAkQC"} \ No newline at end of file diff --git a/dist/src/server/aurelia-languageservice/parser/models.js b/dist/src/server/aurelia-languageservice/parser/models.js index d195ce7b..f33f4544 100644 --- a/dist/src/server/aurelia-languageservice/parser/models.js +++ b/dist/src/server/aurelia-languageservice/parser/models.js @@ -1,18 +1,18 @@ -"use strict"; -class HTMLAttributeSpecification { - constructor(name, dataBindings = [], hasBody = true, defaultAttribute = true) { - this.name = name; - this.dataBindings = dataBindings; - this.hasBody = hasBody; - this.defaultAttribute = defaultAttribute; - } -} -exports.HTMLAttributeSpecification = HTMLAttributeSpecification; -class HTMLTagSpecification { - constructor(label, attributes = []) { - this.label = label; - this.attributes = attributes; - } -} -exports.HTMLTagSpecification = HTMLTagSpecification; +"use strict"; +class HTMLAttributeSpecification { + constructor(name, dataBindings = [], hasBody = true, defaultAttribute = true) { + this.name = name; + this.dataBindings = dataBindings; + this.hasBody = hasBody; + this.defaultAttribute = defaultAttribute; + } +} +exports.HTMLAttributeSpecification = HTMLAttributeSpecification; +class HTMLTagSpecification { + constructor(label, attributes = []) { + this.label = label; + this.attributes = attributes; + } +} +exports.HTMLTagSpecification = HTMLTagSpecification; //# sourceMappingURL=models.js.map \ No newline at end of file diff --git a/dist/src/server/aurelia-languageservice/parser/models.js.map b/dist/src/server/aurelia-languageservice/parser/models.js.map index 5f079319..4b3a799b 100644 --- a/dist/src/server/aurelia-languageservice/parser/models.js.map +++ b/dist/src/server/aurelia-languageservice/parser/models.js.map @@ -1 +1 @@ -{"version":3,"file":"models.js","sourceRoot":"","sources":["../../../../../src/server/aurelia-languageservice/parser/models.ts"],"names":[],"mappings":";AASA;IACE,YAAmB,IAAY,EAAS,YAAY,GAAG,EAAE,EAAS,OAAO,GAAG,IAAI,EAAS,gBAAgB,GAAG,IAAI;QAA7F,SAAI,GAAJ,IAAI,CAAQ;QAAS,iBAAY,GAAZ,YAAY,CAAK;QAAS,YAAO,GAAP,OAAO,CAAO;QAAS,qBAAgB,GAAhB,gBAAgB,CAAO;IAAI,CAAC;AACvH,CAAC;AAFY,kCAA0B,6BAEtC,CAAA;AACD;IACE,YAAmB,KAAa,EAAS,UAAU,GAAiC,EAAE;QAAnE,UAAK,GAAL,KAAK,CAAQ;QAAS,eAAU,GAAV,UAAU,CAAmC;IAAI,CAAC;AAC7F,CAAC;AAFY,4BAAoB,uBAEhC,CAAA"} \ No newline at end of file +{"version":3,"file":"models.js","sourceRoot":"","sources":["../../../../../src/server/aurelia-languageservice/parser/models.ts"],"names":[],"mappings":";AASA;IACE,YAAmB,IAAY,EAAS,eAAe,EAAE,EAAS,UAAU,IAAI,EAAS,mBAAmB,IAAI;QAA7F,SAAI,GAAJ,IAAI,CAAQ;QAAS,iBAAY,GAAZ,YAAY,CAAK;QAAS,YAAO,GAAP,OAAO,CAAO;QAAS,qBAAgB,GAAhB,gBAAgB,CAAO;IAAI,CAAC;CACtH;AAFD,gEAEC;AACD;IACE,YAAmB,KAAa,EAAS,aAA2C,EAAE;QAAnE,UAAK,GAAL,KAAK,CAAQ;QAAS,eAAU,GAAV,UAAU,CAAmC;IAAI,CAAC;CAC5F;AAFD,oDAEC"} \ No newline at end of file diff --git a/dist/src/server/aurelia-languageservice/services/htmlCompletion.js b/dist/src/server/aurelia-languageservice/services/htmlCompletion.js index c740f8c0..b02f47b2 100644 --- a/dist/src/server/aurelia-languageservice/services/htmlCompletion.js +++ b/dist/src/server/aurelia-languageservice/services/htmlCompletion.js @@ -1,175 +1,178 @@ -"use strict"; -const htmlScanner_1 = require('../parser/htmlScanner'); -const aureliaTagProvider_1 = require('../parser/aureliaTagProvider'); -function doComplete(document, position, htmlDocument, quotes) { - let quote = '"'; - if (quotes === 'single') { - quote = '\''; - } - let tagProvider = aureliaTagProvider_1.getAureliaTagProvider(); - let result = { - isIncomplete: false, - items: [], - }; - let offset = document.offsetAt(position); - let node = htmlDocument.findNodeBefore(offset); - let text = document.getText(); - let scanner = htmlScanner_1.createScanner(text, node.start); - let currentTag; - let currentAttributeName; - let token = scanner.scan(); - function getReplaceRange(replaceStart, replaceEnd = offset) { - if (replaceStart > offset) { - replaceStart = offset; - } - return { - end: document.positionAt(replaceEnd), - start: document.positionAt(replaceStart), - }; - } - function collectOpenTagSuggestions(afterOpenBracket, tagNameEnd) { - let range = getReplaceRange(afterOpenBracket, tagNameEnd); - tagProvider.collectTags((tag, label) => { - result.items.push({ - documentation: label, - kind: 10 /* Property */, - label: tag, - textEdit: { newText: tag, range: range }, - }); - }); - return result; - } - function collectTagSuggestions(tagStart, tagEnd) { - collectOpenTagSuggestions(tagStart, tagEnd); - return result; - } - function collectAttributeNameSuggestions(nameStart, nameEnd = offset) { - let range = getReplaceRange(nameStart, nameEnd); - let value = isFollowedBy(text, nameEnd, htmlScanner_1.ScannerState.AfterAttributeName, htmlScanner_1.TokenType.DelimiterAssign) ? '' : '=' + quote + '{{}}' + quote; - tagProvider.collectAttributes(currentTag, (attribute, type) => { - let codeSnippet = attribute; - if (type !== 'v' && value.length) { - codeSnippet = codeSnippet + value; - } - result.items.push({ - kind: type === 'handler' ? 3 /* Function */ : 12 /* Value */, - label: attribute, - textEdit: { newText: codeSnippet, range: range }, - }); - }); - return result; - } - function collectAttributeValueSuggestions(valueStart, valueEnd) { - let range; - let addQuotes; - if (offset > valueStart && offset <= valueEnd && text[valueStart] === quote) { - // inside attribute - if (valueEnd > offset && text[valueEnd - 1] === quote) { - valueEnd--; - } - let wsBefore = getWordStart(text, offset, valueStart + 1); - let wsAfter = getWordEnd(text, offset, valueEnd); - range = getReplaceRange(wsBefore, wsAfter); - addQuotes = false; - } - else { - range = getReplaceRange(valueStart, valueEnd); - addQuotes = true; - } - tagProvider.collectValues(currentTag, currentAttributeName, (value) => { - let codeSnippet = addQuotes ? quote + value + quote : value; - result.items.push({ - filterText: codeSnippet, - kind: 11 /* Unit */, - label: value, - textEdit: { newText: codeSnippet, range: range }, - }); - }); - return result; - } - function scanNextForEndPos(nextToken) { - if (offset === scanner.getTokenEnd()) { - token = scanner.scan(); - if (token === nextToken && scanner.getTokenOffset() === offset) { - return scanner.getTokenEnd(); - } - } - return offset; - } - while (token !== htmlScanner_1.TokenType.EOS && scanner.getTokenOffset() <= offset) { - // tslint:disable-next-line:switch-default - switch (token) { - case htmlScanner_1.TokenType.StartTagOpen: - if (scanner.getTokenEnd() === offset) { - let endPos = scanNextForEndPos(htmlScanner_1.TokenType.StartTag); - return collectTagSuggestions(offset, endPos); - } - break; - case htmlScanner_1.TokenType.StartTag: - if (scanner.getTokenOffset() <= offset && offset <= scanner.getTokenEnd()) { - return collectOpenTagSuggestions(scanner.getTokenOffset(), scanner.getTokenEnd()); - } - currentTag = scanner.getTokenText(); - break; - case htmlScanner_1.TokenType.AttributeName: - if (scanner.getTokenOffset() <= offset && offset <= scanner.getTokenEnd()) { - return collectAttributeNameSuggestions(scanner.getTokenOffset(), scanner.getTokenEnd()); - } - currentAttributeName = scanner.getTokenText(); - break; - case htmlScanner_1.TokenType.DelimiterAssign: - if (scanner.getTokenEnd() === offset) { - return collectAttributeValueSuggestions(scanner.getTokenEnd()); - } - break; - case htmlScanner_1.TokenType.AttributeValue: - if (scanner.getTokenOffset() <= offset && offset <= scanner.getTokenEnd()) { - return collectAttributeValueSuggestions(scanner.getTokenOffset(), scanner.getTokenEnd()); - } - break; - case htmlScanner_1.TokenType.Whitespace: - if (offset <= scanner.getTokenEnd()) { - // tslint:disable-next-line:switch-default - switch (scanner.getScannerState()) { - case htmlScanner_1.ScannerState.AfterOpeningStartTag: - let startPos = scanner.getTokenOffset(); - let endTagPos = scanNextForEndPos(htmlScanner_1.TokenType.StartTag); - return collectTagSuggestions(startPos, endTagPos); - case htmlScanner_1.ScannerState.WithinTag: - case htmlScanner_1.ScannerState.AfterAttributeName: - return collectAttributeNameSuggestions(scanner.getTokenEnd()); - case htmlScanner_1.ScannerState.BeforeAttributeValue: - return collectAttributeValueSuggestions(scanner.getTokenEnd()); - } - } - break; - } - token = scanner.scan(); - } - return result; -} -exports.doComplete = doComplete; -function isWhiteSpace(s) { - return /^\s*$/.test(s); -} -function isFollowedBy(s, offset, intialState, expectedToken) { - let scanner = htmlScanner_1.createScanner(s, offset, intialState); - let token = scanner.scan(); - while (token === htmlScanner_1.TokenType.Whitespace) { - token = scanner.scan(); - } - return token === expectedToken; -} -function getWordStart(s, offset, limit) { - while (offset > limit && !isWhiteSpace(s[offset - 1])) { - offset--; - } - return offset; -} -function getWordEnd(s, offset, limit) { - while (offset < limit && !isWhiteSpace(s[offset])) { - offset++; - } - return offset; -} +"use strict"; +const vscode_languageserver_types_1 = require("vscode-languageserver-types"); +const htmlScanner_1 = require("../parser/htmlScanner"); +const aureliaTagProvider_1 = require("../parser/aureliaTagProvider"); +function doComplete(document, position, htmlDocument, quotes) { + let quote = '"'; + if (quotes === 'single') { + quote = '\''; + } + let tagProvider = aureliaTagProvider_1.getAureliaTagProvider(); + let result = { + isIncomplete: false, + items: [], + }; + let offset = document.offsetAt(position); + let node = htmlDocument.findNodeBefore(offset); + let text = document.getText(); + let scanner = htmlScanner_1.createScanner(text, node.start); + let currentTag; + let currentAttributeName; + let token = scanner.scan(); + function getReplaceRange(replaceStart, replaceEnd = offset) { + if (replaceStart > offset) { + replaceStart = offset; + } + return { + end: document.positionAt(replaceEnd), + start: document.positionAt(replaceStart), + }; + } + function collectOpenTagSuggestions(afterOpenBracket, tagNameEnd) { + let range = getReplaceRange(afterOpenBracket, tagNameEnd); + tagProvider.collectTags((tag, label) => { + result.items.push({ + documentation: label, + kind: 10 /* Property */, + label: tag, + range, + }); + }); + return result; + } + function collectTagSuggestions(tagStart, tagEnd) { + collectOpenTagSuggestions(tagStart, tagEnd); + return result; + } + function collectAttributeNameSuggestions(nameStart, nameEnd = offset) { + let range = getReplaceRange(nameStart, nameEnd); + let value = isFollowedBy(text, nameEnd, htmlScanner_1.ScannerState.AfterAttributeName, htmlScanner_1.TokenType.DelimiterAssign) ? '' : '=' + quote + '$1' + quote; + tagProvider.collectAttributes(currentTag, (attribute, type) => { + let codeSnippet = attribute; + if (type !== 'v' && value.length) { + codeSnippet = codeSnippet + value; + } + result.items.push({ + insertText: vscode_languageserver_types_1.SnippetString.create(codeSnippet), + kind: type === 'handler' ? 3 /* Function */ : 12 /* Value */, + label: attribute, + range, + }); + }); + return result; + } + function collectAttributeValueSuggestions(valueStart, valueEnd) { + let range; + let addQuotes; + if (offset > valueStart && offset <= valueEnd && text[valueStart] === quote) { + // inside attribute + if (valueEnd > offset && text[valueEnd - 1] === quote) { + valueEnd--; + } + let wsBefore = getWordStart(text, offset, valueStart + 1); + let wsAfter = getWordEnd(text, offset, valueEnd); + range = getReplaceRange(wsBefore, wsAfter); + addQuotes = false; + } + else { + range = getReplaceRange(valueStart, valueEnd); + addQuotes = true; + } + tagProvider.collectValues(currentTag, currentAttributeName, (value) => { + let insertText = addQuotes ? quote + value + quote : value; + result.items.push({ + filterText: insertText, + kind: 11 /* Unit */, + label: value, + insertText, + range, + }); + }); + return result; + } + function scanNextForEndPos(nextToken) { + if (offset === scanner.getTokenEnd()) { + token = scanner.scan(); + if (token === nextToken && scanner.getTokenOffset() === offset) { + return scanner.getTokenEnd(); + } + } + return offset; + } + while (token !== htmlScanner_1.TokenType.EOS && scanner.getTokenOffset() <= offset) { + // tslint:disable-next-line:switch-default + switch (token) { + case htmlScanner_1.TokenType.StartTagOpen: + if (scanner.getTokenEnd() === offset) { + let endPos = scanNextForEndPos(htmlScanner_1.TokenType.StartTag); + return collectTagSuggestions(offset, endPos); + } + break; + case htmlScanner_1.TokenType.StartTag: + if (scanner.getTokenOffset() <= offset && offset <= scanner.getTokenEnd()) { + return collectOpenTagSuggestions(scanner.getTokenOffset(), scanner.getTokenEnd()); + } + currentTag = scanner.getTokenText(); + break; + case htmlScanner_1.TokenType.AttributeName: + if (scanner.getTokenOffset() <= offset && offset <= scanner.getTokenEnd()) { + return collectAttributeNameSuggestions(scanner.getTokenOffset(), scanner.getTokenEnd()); + } + currentAttributeName = scanner.getTokenText(); + break; + case htmlScanner_1.TokenType.DelimiterAssign: + if (scanner.getTokenEnd() === offset) { + return collectAttributeValueSuggestions(scanner.getTokenEnd()); + } + break; + case htmlScanner_1.TokenType.AttributeValue: + if (scanner.getTokenOffset() <= offset && offset <= scanner.getTokenEnd()) { + return collectAttributeValueSuggestions(scanner.getTokenOffset(), scanner.getTokenEnd()); + } + break; + case htmlScanner_1.TokenType.Whitespace: + if (offset <= scanner.getTokenEnd()) { + // tslint:disable-next-line:switch-default + switch (scanner.getScannerState()) { + case htmlScanner_1.ScannerState.AfterOpeningStartTag: + let startPos = scanner.getTokenOffset(); + let endTagPos = scanNextForEndPos(htmlScanner_1.TokenType.StartTag); + return collectTagSuggestions(startPos, endTagPos); + case htmlScanner_1.ScannerState.WithinTag: + case htmlScanner_1.ScannerState.AfterAttributeName: + return collectAttributeNameSuggestions(scanner.getTokenEnd()); + case htmlScanner_1.ScannerState.BeforeAttributeValue: + return collectAttributeValueSuggestions(scanner.getTokenEnd()); + } + } + break; + } + token = scanner.scan(); + } + return result; +} +exports.doComplete = doComplete; +function isWhiteSpace(s) { + return /^\s*$/.test(s); +} +function isFollowedBy(s, offset, intialState, expectedToken) { + let scanner = htmlScanner_1.createScanner(s, offset, intialState); + let token = scanner.scan(); + while (token === htmlScanner_1.TokenType.Whitespace) { + token = scanner.scan(); + } + return token === expectedToken; +} +function getWordStart(s, offset, limit) { + while (offset > limit && !isWhiteSpace(s[offset - 1])) { + offset--; + } + return offset; +} +function getWordEnd(s, offset, limit) { + while (offset < limit && !isWhiteSpace(s[offset])) { + offset++; + } + return offset; +} //# sourceMappingURL=htmlCompletion.js.map \ No newline at end of file diff --git a/dist/src/server/aurelia-languageservice/services/htmlCompletion.js.map b/dist/src/server/aurelia-languageservice/services/htmlCompletion.js.map index cd768c91..5979ef5d 100644 --- a/dist/src/server/aurelia-languageservice/services/htmlCompletion.js.map +++ b/dist/src/server/aurelia-languageservice/services/htmlCompletion.js.map @@ -1 +1 @@ -{"version":3,"file":"htmlCompletion.js","sourceRoot":"","sources":["../../../../../src/server/aurelia-languageservice/services/htmlCompletion.ts"],"names":[],"mappings":";AAEA,8BAAuD,uBAAuB,CAAC,CAAA;AAC/E,qCAAsC,8BAA8B,CAAC,CAAA;AAUrE,oBAA2B,QAAsB,EAAE,QAAkB,EAAE,YAA0B,EAAE,MAAc;IAE/G,IAAI,KAAK,GAAG,GAAG,CAAC;IAChB,EAAE,CAAC,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC;QACxB,KAAK,GAAG,IAAI,CAAC;IACf,CAAC;IAED,IAAI,WAAW,GAAG,0CAAqB,EAAE,CAAC;IAC1C,IAAI,MAAM,GAAmB;QAC3B,Y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A;AAED,sBAAsB,CAAS;IAC7B,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACzB,CAAC;AAED,sBAAsB,CAAS,EAAE,MAAc,EAAE,WAAyB,EAAE,aAAwB;IAClG,IAAI,OAAO,GAAG,2BAAa,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;IACpD,IAAI,KAAK,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAC3B,OAAO,KAAK,KAAK,uBAAS,CAAC,UAAU,EAAE,CAAC;QACtC,KAAK,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC;IACD,MAAM,CAAC,KAAK,KAAK,aAAa,CAAC;AACjC,CAAC;AAED,sBAAsB,CAAS,EAAE,MAAc,EAAE,KAAa;IAC5D,OAAO,MAAM,GAAG,KAAK,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACtD,MAAM,EAAE,CAAC;IACX,CAAC;IACD,MAAM,CAAC,MAAM,CAAC;AAChB,CAAC;AAED,oBAAoB,CAAS,EAAE,MAAc,EAAE,KAAa;IAC1D,OAAO,MAAM,GAAG,KAAK,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;QAClD,MAAM,EAAE,CAAC;IACX,CAAC;IACD,MAAM,CAAC,MAAM,CAAC;AAChB,CAAC"} \ No newline at end of file +{"version":3,"file":"htmlCompletion.js","sourceRoot":"","sources":["../../../../../src/server/aurelia-languageservice/services/htmlCompletion.ts"],"names":[],"mappings":";AAAA,6EAA+H;AAE/H,uDAA+E;AAC/E,qEAAqE;AAUrE,oBAA2B,QAAsB,EAAE,QAAkB,EAAE,YAA0B,EAAE,MAAc;IAE/G,IAAI,KAAK,GAAG,GAAG,CAAC;IAChB,EAAE,CAAC,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC;QACxB,KAAK,GAAG,I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OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACzB,CAAC;AAED,sBAAsB,CAAS,EAAE,MAAc,EAAE,WAAyB,EAAE,aAAwB;IAClG,IAAI,OAAO,GAAG,2BAAa,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;IACpD,IAAI,KAAK,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAC3B,OAAO,KAAK,KAAK,uBAAS,CAAC,UAAU,EAAE,CAAC;QACtC,KAAK,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC;IACD,MAAM,CAAC,KAAK,KAAK,aAAa,CAAC;AACjC,CAAC;AAED,sBAAsB,CAAS,EAAE,MAAc,EAAE,KAAa;IAC5D,OAAO,MAAM,GAAG,KAAK,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACtD,MAAM,EAAE,CAAC;IACX,CAAC;IACD,MAAM,CAAC,MAAM,CAAC;AAChB,CAAC;AAED,oBAAoB,CAAS,EAAE,MAAc,EAAE,KAAa;IAC1D,OAAO,MAAM,GAAG,KAAK,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;QAClD,MAAM,EAAE,CAAC;IACX,CAAC;IACD,MAAM,CAAC,MAAM,CAAC;AAChB,CAAC"} \ No newline at end of file diff --git a/dist/src/server/aurelia-languageservice/services/htmlValidation.js b/dist/src/server/aurelia-languageservice/services/htmlValidation.js index fe12d640..6f21b6aa 100644 --- a/dist/src/server/aurelia-languageservice/services/htmlValidation.js +++ b/dist/src/server/aurelia-languageservice/services/htmlValidation.js @@ -1,88 +1,88 @@ -'use strict'; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments)).next()); - }); -}; -const vscode_languageserver_types_1 = require('vscode-languageserver-types'); -const htmlScanner_1 = require('../parser/htmlScanner'); -exports.DiagnosticCodes = { - InvalidCasing: 'invalid-casing', - InvalidMethod: 'invalid-method', -}; -exports.DiagnosticSource = 'Aurelia'; -const kebabCaseValidationRegex = /(.*)\.(bind|one-way|two-way|one-time|call|delegate|trigger)/; -function camelToKebab(s) { - return s.replace(/\.?([A-Z])/g, (x, y) => '-' + y.toLowerCase()).replace(/^-/, ''); -} -class HTMLValidation { - constructor() { - this.validationEnabled = true; - } - configure(raw) { - if (raw) { - this.validationEnabled = raw.validate; - } - } - doValidation(document, htmlDocument) { - return __awaiter(this, void 0, void 0, function* () { - if (!this.validationEnabled) { - return Promise.resolve([]); - } - const text = document.getText(); - const scanner = htmlScanner_1.createScanner(text, htmlDocument.roots[0].start); - const diagnostics = []; - let attr; - let token = scanner.scan(); - while (token !== htmlScanner_1.TokenType.EOS) { - // tslint:disable-next-line:switch-default - switch (token) { - case htmlScanner_1.TokenType.AttributeName: - attr = { - length: scanner.getTokenLength(), - name: scanner.getTokenText(), - start: scanner.getTokenOffset(), - }; - break; - case htmlScanner_1.TokenType.AttributeValue: - attr.value = scanner.getTokenText(); - yield this.validateAttribute(attr, document, diagnostics); - break; - } - token = scanner.scan(); - } - return Promise.resolve(diagnostics); - }); - } - validateAttribute(attr, document, diagnostics) { - return __awaiter(this, void 0, void 0, function* () { - let match = kebabCaseValidationRegex.exec(attr.name); - if (match && match.length) { - const prop = match[1]; - const op = match[2]; - if (prop !== prop.toLowerCase()) { - diagnostics.push(this.toDiagnostic(attr, document, `'${attr.name}' has invalid casing; it should likely be '${camelToKebab(prop)}.${op}'`, exports.DiagnosticCodes.InvalidCasing)); - } - } - return Promise.resolve(); - }); - } - toDiagnostic(attr, document, message, code = undefined, serverity = 1 /* Error */) { - const range = vscode_languageserver_types_1.Range.create(document.positionAt(attr.start), document.positionAt(attr.start + attr.length)); - const diagnostic = { - message: message, - range: range, - severity: serverity, - source: exports.DiagnosticSource, - }; - if (code !== undefined) { - diagnostic.code = code; - } - return diagnostic; - } -} -exports.HTMLValidation = HTMLValidation; +'use strict'; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments)).next()); + }); +}; +const vscode_languageserver_types_1 = require("vscode-languageserver-types"); +const htmlScanner_1 = require("../parser/htmlScanner"); +exports.DiagnosticCodes = { + InvalidCasing: 'invalid-casing', + InvalidMethod: 'invalid-method', +}; +exports.DiagnosticSource = 'Aurelia'; +const kebabCaseValidationRegex = /(.*)\.(bind|one-way|two-way|one-time|call|delegate|trigger)/; +function camelToKebab(s) { + return s.replace(/\.?([A-Z])/g, (x, y) => '-' + y.toLowerCase()).replace(/^-/, ''); +} +class HTMLValidation { + constructor() { + this.validationEnabled = true; + } + configure(raw) { + if (raw) { + this.validationEnabled = raw.validate; + } + } + doValidation(document, htmlDocument) { + return __awaiter(this, void 0, void 0, function* () { + if (!this.validationEnabled) { + return Promise.resolve([]); + } + const text = document.getText(); + const scanner = htmlScanner_1.createScanner(text, htmlDocument.roots[0].start); + const diagnostics = []; + let attr; + let token = scanner.scan(); + while (token !== htmlScanner_1.TokenType.EOS) { + // tslint:disable-next-line:switch-default + switch (token) { + case htmlScanner_1.TokenType.AttributeName: + attr = { + length: scanner.getTokenLength(), + name: scanner.getTokenText(), + start: scanner.getTokenOffset(), + }; + break; + case htmlScanner_1.TokenType.AttributeValue: + attr.value = scanner.getTokenText(); + yield this.validateAttribute(attr, document, diagnostics); + break; + } + token = scanner.scan(); + } + return Promise.resolve(diagnostics); + }); + } + validateAttribute(attr, document, diagnostics) { + return __awaiter(this, void 0, void 0, function* () { + let match = kebabCaseValidationRegex.exec(attr.name); + if (match && match.length) { + const prop = match[1]; + const op = match[2]; + if (prop !== prop.toLowerCase()) { + diagnostics.push(this.toDiagnostic(attr, document, `'${attr.name}' has invalid casing; it should likely be '${camelToKebab(prop)}.${op}'`, exports.DiagnosticCodes.InvalidCasing)); + } + } + return Promise.resolve(); + }); + } + toDiagnostic(attr, document, message, code = undefined, serverity = 1 /* Error */) { + const range = vscode_languageserver_types_1.Range.create(document.positionAt(attr.start), document.positionAt(attr.start + attr.length)); + const diagnostic = { + message: message, + range: range, + severity: serverity, + source: exports.DiagnosticSource, + }; + if (code !== undefined) { + diagnostic.code = code; + } + return diagnostic; + } +} +exports.HTMLValidation = HTMLValidation; //# sourceMappingURL=htmlValidation.js.map \ No newline at end of file diff --git a/dist/src/server/aurelia-languageservice/services/htmlValidation.js.map b/dist/src/server/aurelia-languageservice/services/htmlValidation.js.map index c607e593..984b1d3f 100644 --- a/dist/src/server/aurelia-languageservice/services/htmlValidation.js.map +++ b/dist/src/server/aurelia-languageservice/services/htmlValidation.js.map @@ -1 +1 @@ -{"version":3,"file":"htmlValidation.js","sourceRoot":"","sources":["../../../../../src/server/aurelia-languageservice/services/htmlValidation.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;AACb,8CAAoE,6BAA6B,CAAC,CAAA;AAGlG,8BAAyC,uBAAuB,CAAC,CAAA;AAGpD,uBAAe,GAAG;IAC7B,aAAa,EAAE,gBAAmC;IAClD,aAAa,EAAE,gBAAmC;CACnD,CAAC;AAEW,wBAAgB,GAAG,SAAS,CAAC;AAS1C,MAAM,wBAAwB,GAAG,6DAA6D,CAAC;AAE/F,sBAAsB,CAAS;IAC7B,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,GAAG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GAAgB;YAC9B,OAAO,EAAE,OAAO;YAChB,KAAK,EAAE,KAAK;YACZ,QAAQ,EAAE,SAAS;YACnB,MAAM,EAAE,wBAAgB;SACzB,CAAC;QAEF,EAAE,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC;YACvB,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC;QACzB,CAAC;QACD,MAAM,CAAC,UAAU,CAAC;IACtB,CAAC;AACH,CAAC;AAjFY,sBAAc,iBAiF1B,CAAA"} \ No newline at end of file +{"version":3,"file":"htmlValidation.js","sourceRoot":"","sources":["../../../../../src/server/aurelia-languageservice/services/htmlValidation.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;AACb,6EAAkG;AAGlG,uDAAiE;AAGpD,QAAA,eAAe,GAAG;IAC7B,aAAa,EAAE,gBAAmC;IAClD,aAAa,EAAE,gBAAmC;CACnD,CAAC;AAEW,QAAA,gBAAgB,GAAG,SAAS,CAAC;AAS1C,MAAM,wBAAwB,GAAG,6DAA6D,CAAC;AAE/F,sBAAsB,CAAS;IAC7B,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AACrF,CAAC;AAED;IAGE;QACE,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAChC,CAAC;IAEM,SAAS,CAAC,GAAqB;QACpC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YACR,IAAI,CAAC,iBAAiB,GAAG,GAAG,CAAC,QAAQ,CAAC;QACxC,CAAC;IACH,CAAC;IAEY,YAAY,CAAC,QAAsB,EAAE,YAA0B;;YAC1E,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC;gBAC5B,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,E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,CAAC,CAAC,CAAC,CAAC;gBACtB,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;gBAEpB,EAAE,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;oBAChC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,QAAQ,EAC/C,IAAI,IAAI,CAAC,IAAI,8CAA8C,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EACtF,uBAAe,CAAC,aAAa,CAAC,CAAC,CAAC;gBACpC,CAAC;YACH,CAAC;YAED,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QAC3B,CAAC;KAAA;IAEO,YAAY,CAClB,IAAe,EACf,QAAsB,EACtB,OAAe,EACf,OAAoC,SAAS,EAC7C,YAAgC,aAAwB;QACtD,MAAM,KAAK,GAAG,mCAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAC3G,MAAM,UAAU,GAAgB;YAC9B,OAAO,EAAE,OAAO;YAChB,KAAK,EAAE,KAAK;YACZ,QAAQ,EAAE,SAAS;YACnB,MAAM,EAAE,wBAAgB;SACzB,CAAC;QAEF,EAAE,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC;YACvB,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC;QACzB,CAAC;QACD,MAAM,CAAC,UAAU,CAAC;IACtB,CAAC;CACF;AAjFD,wCAiFC"} \ No newline at end of file diff --git a/dist/src/server/languageModelCache.js b/dist/src/server/languageModelCache.js index 90d76891..711b3138 100644 --- a/dist/src/server/languageModelCache.js +++ b/dist/src/server/languageModelCache.js @@ -1,71 +1,71 @@ -'use strict'; -function getLanguageModelCache(maxEntries, cleanupIntervalTimeInSec, parse) { - let languageModels = {}; - let nModels = 0; - let cleanupInterval = void 0; - if (cleanupIntervalTimeInSec > 0) { - cleanupInterval = setInterval(() => { - let cutoffTime = Date.now() - cleanupIntervalTimeInSec * 1000; - let uris = Object.keys(languageModels); - for (let uri of uris) { - let languageModelInfo = languageModels[uri]; - if (languageModelInfo.cTime < cutoffTime) { - delete languageModels[uri]; - nModels--; - } - } - }, cleanupIntervalTimeInSec * 1000); - } - return { - get(document) { - let version = document.version; - let languageId = document.languageId; - let languageModelInfo = languageModels[document.uri]; - if (languageModelInfo && languageModelInfo.version === version && languageModelInfo.languageId === languageId) { - languageModelInfo.cTime = Date.now(); - return languageModelInfo.languageModel; - } - let languageModel = parse(document); - languageModels[document.uri] = { languageModel, version, languageId, cTime: Date.now() }; - if (!languageModelInfo) { - nModels++; - } - if (nModels === maxEntries) { - let oldestTime = Number.MAX_VALUE; - let oldestUri = null; - for (let uri in languageModels) { - if (languageModels.hasOwnProperty(uri)) { - // tslint:disable-next-line:no-shadowed-variable - let languageModelInfo = languageModels[uri]; - if (languageModelInfo.cTime < oldestTime) { - oldestUri = uri; - oldestTime = languageModelInfo.cTime; - } - } - } - if (oldestUri) { - delete languageModels[oldestUri]; - nModels--; - } - } - return languageModel; - }, - onDocumentRemoved(document) { - let uri = document.uri; - if (languageModels[uri]) { - delete languageModels[uri]; - nModels--; - } - }, - dispose() { - if (typeof cleanupInterval !== 'undefined') { - clearInterval(cleanupInterval); - cleanupInterval = void 0; - languageModels = {}; - nModels = 0; - } - }, - }; -} -exports.getLanguageModelCache = getLanguageModelCache; +'use strict'; +function getLanguageModelCache(maxEntries, cleanupIntervalTimeInSec, parse) { + let languageModels = {}; + let nModels = 0; + let cleanupInterval = void 0; + if (cleanupIntervalTimeInSec > 0) { + cleanupInterval = setInterval(() => { + let cutoffTime = Date.now() - cleanupIntervalTimeInSec * 1000; + let uris = Object.keys(languageModels); + for (let uri of uris) { + let languageModelInfo = languageModels[uri]; + if (languageModelInfo.cTime < cutoffTime) { + delete languageModels[uri]; + nModels--; + } + } + }, cleanupIntervalTimeInSec * 1000); + } + return { + get(document) { + let version = document.version; + let languageId = document.languageId; + let languageModelInfo = languageModels[document.uri]; + if (languageModelInfo && languageModelInfo.version === version && languageModelInfo.languageId === languageId) { + languageModelInfo.cTime = Date.now(); + return languageModelInfo.languageModel; + } + let languageModel = parse(document); + languageModels[document.uri] = { languageModel, version, languageId, cTime: Date.now() }; + if (!languageModelInfo) { + nModels++; + } + if (nModels === maxEntries) { + let oldestTime = Number.MAX_VALUE; + let oldestUri = null; + for (let uri in languageModels) { + if (languageModels.hasOwnProperty(uri)) { + // tslint:disable-next-line:no-shadowed-variable + let languageModelInfo = languageModels[uri]; + if (languageModelInfo.cTime < oldestTime) { + oldestUri = uri; + oldestTime = languageModelInfo.cTime; + } + } + } + if (oldestUri) { + delete languageModels[oldestUri]; + nModels--; + } + } + return languageModel; + }, + onDocumentRemoved(document) { + let uri = document.uri; + if (languageModels[uri]) { + delete languageModels[uri]; + nModels--; + } + }, + dispose() { + if (typeof cleanupInterval !== 'undefined') { + clearInterval(cleanupInterval); + cleanupInterval = void 0; + languageModels = {}; + nModels = 0; + } + }, + }; +} +exports.getLanguageModelCache = getLanguageModelCache; //# sourceMappingURL=languageModelCache.js.map \ No newline at end of file diff --git a/dist/src/server/languageModelCache.js.map b/dist/src/server/languageModelCache.js.map index 88500022..c0c44f39 100644 --- a/dist/src/server/languageModelCache.js.map +++ b/dist/src/server/languageModelCache.js.map @@ -1 +1 @@ -{"version":3,"file":"languageModelCache.js","sourceRoot":"","sources":["../../../src/server/languageModelCache.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAUb,+BACE,UAAkB,EAClB,wBAAgC,EAChC,KAAoC;IAClC,IAAI,cAAc,GAAgG,EAAE,CAAC;IACrH,IAAI,OAAO,GAAG,CAAC,CAAC;IAEhB,IAAI,eAAe,GAAG,KAAK,CAAC,CAAC;IAC7B,EAAE,CAAC,CAAC,wBAAwB,GAAG,C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C;gBACpB,OAAO,GAAG,CAAC,CAAC;YACd,CAAC;QACH,CAAC;KACF,CAAC;AACN,CAAC;AA1Ee,6BAAqB,wBA0EpC,CAAA"} \ No newline at end of file +{"version":3,"file":"languageModelCache.js","sourceRoot":"","sources":["../../../src/server/languageModelCache.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAUb,+BACE,UAAkB,EAClB,wBAAgC,EAChC,KAAoC;IAClC,IAAI,cAAc,GAAgG,EAAE,CAAC;IACrH,IAAI,OAAO,GAAG,CAAC,CAAC;IAEhB,IAAI,eAAe,GAAG,KAAK,CAAC,CAAC;IAC7B,EAAE,CAAC,CAAC,wBAAwB,GAAG,CAAC,CAAC,CAAC,CAAC;QACjC,eAAe,GAAG,WAAW,CAAC;YAC5B,IAAI,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,wBAAwB,GAAG,IAAI,CAAC;YAC9D,IAAI,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YACvC,GAAG,CAAC,CAAC,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC;gBACrB,IAAI,iBAAiB,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;gBAC5C,EAAE,CAAC,CAAC,iBAAiB,CAAC,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC;oBACzC,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;oBAC3B,OAAO,EAAE,CAAC;gBACZ,CAAC;YACH,CAAC;QACH,CAAC,EAAE,wBAAwB,GAAG,IAAI,CAAC,CAAC;IACtC,CAAC;IAED,MAAM,CAAC;QACL,GAAG,CAAC,QAAsB;YACxB,IAAI,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC;YAC/B,IAAI,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC;YACrC,IAAI,iBAAiB,GAAG,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;YACrD,EAAE,CAAC,CAAC,iBAAiB,IAAI,iBAAi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C;QACD,iBAAiB,CAAC,QAAsB;YACtC,IAAI,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC;YACvB,EAAE,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBACxB,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;gBAC3B,OAAO,EAAE,CAAC;YACZ,CAAC;QACH,CAAC;QACD,OAAO;YACL,EAAE,CAAC,CAAC,OAAO,eAAe,KAAK,WAAW,CAAC,CAAC,CAAC;gBAC3C,aAAa,CAAC,eAAe,CAAC,CAAC;gBAC/B,eAAe,GAAG,KAAK,CAAC,CAAC;gBACzB,cAAc,GAAG,EAAE,CAAC;gBACpB,OAAO,GAAG,CAAC,CAAC;YACd,CAAC;QACH,CAAC;KACF,CAAC;AACN,CAAC;AA1ED,sDA0EC"} \ No newline at end of file diff --git a/dist/src/server/main.js b/dist/src/server/main.js index 5b5caa97..5fa6cb2d 100644 --- a/dist/src/server/main.js +++ b/dist/src/server/main.js @@ -1,49 +1,49 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments)).next()); - }); -}; -const vscode_languageserver_1 = require('vscode-languageserver'); -const aureliaLanguageService_1 = require('./aurelia-languageservice/aureliaLanguageService'); -const languageModelCache_1 = require('./languageModelCache'); -let connection = vscode_languageserver_1.createConnection(); -console.log = connection.console.log.bind(connection.console); -console.error = connection.console.error.bind(connection.console); -let documents = new vscode_languageserver_1.TextDocuments(); -documents.listen(connection); -let htmlDocuments = languageModelCache_1.getLanguageModelCache(10, 60, document => aureliaLanguageService_1.getLanguageService().parseHTMLDocument(document)); -documents.onDidClose(e => { - htmlDocuments.onDocumentRemoved(e.document); -}); -connection.onShutdown(() => { - htmlDocuments.dispose(); -}); -let workspacePath; -connection.onInitialize((params) => { - workspacePath = params.rootPath; - return { - capabilities: { - completionProvider: { resolveProvider: false, triggerCharacters: ['.', '<'] }, - textDocumentSync: documents.syncKind, - }, - }; -}); -let aureliaSettings; -connection.onDidChangeConfiguration(change => aureliaSettings = change.settings.aurelia); -let languageService = aureliaLanguageService_1.getLanguageService(); -documents.onDidChangeContent((change) => __awaiter(this, void 0, void 0, function* () { - let htmlDocument = htmlDocuments.get(change.document); - const diagnostics = yield languageService.doValidation(change.document, htmlDocument); - connection.sendDiagnostics({ uri: change.document.uri, diagnostics }); -})); -connection.onCompletion(textDocumentPosition => { - let document = documents.get(textDocumentPosition.textDocument.uri); - let htmlDocument = htmlDocuments.get(document); - return languageService.doComplete(document, textDocumentPosition.position, htmlDocument, aureliaSettings.autocomplete.quotes); -}); -connection.listen(); +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments)).next()); + }); +}; +const vscode_languageserver_1 = require("vscode-languageserver"); +const aureliaLanguageService_1 = require("./aurelia-languageservice/aureliaLanguageService"); +const languageModelCache_1 = require("./languageModelCache"); +let connection = vscode_languageserver_1.createConnection(); +console.log = connection.console.log.bind(connection.console); +console.error = connection.console.error.bind(connection.console); +let documents = new vscode_languageserver_1.TextDocuments(); +documents.listen(connection); +let htmlDocuments = languageModelCache_1.getLanguageModelCache(10, 60, document => aureliaLanguageService_1.getLanguageService().parseHTMLDocument(document)); +documents.onDidClose(e => { + htmlDocuments.onDocumentRemoved(e.document); +}); +connection.onShutdown(() => { + htmlDocuments.dispose(); +}); +let workspacePath; +connection.onInitialize((params) => { + workspacePath = params.rootPath; + return { + capabilities: { + completionProvider: { resolveProvider: false, triggerCharacters: ['.', '<'] }, + textDocumentSync: documents.syncKind, + }, + }; +}); +let aureliaSettings; +connection.onDidChangeConfiguration(change => aureliaSettings = change.settings.aurelia); +let languageService = aureliaLanguageService_1.getLanguageService(); +documents.onDidChangeContent((change) => __awaiter(this, void 0, void 0, function* () { + let htmlDocument = htmlDocuments.get(change.document); + const diagnostics = yield languageService.doValidation(change.document, htmlDocument); + connection.sendDiagnostics({ uri: change.document.uri, diagnostics }); +})); +connection.onCompletion(textDocumentPosition => { + let document = documents.get(textDocumentPosition.textDocument.uri); + let htmlDocument = htmlDocuments.get(document); + return languageService.doComplete(document, textDocumentPosition.position, htmlDocument, aureliaSettings.autocomplete.quotes); +}); +connection.listen(); //# sourceMappingURL=main.js.map \ No newline at end of file diff --git a/dist/src/server/main.js.map b/dist/src/server/main.js.map index af447edd..4b4414f1 100644 --- a/dist/src/server/main.js.map +++ b/dist/src/server/main.js.map @@ -1 +1 @@ -{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../src/server/main.ts"],"names":[],"mappings":";;;;;;;;;AAAA,wCAAiG,uBAAuB,CAAC,CAAA;AACzH,yCAAiD,kDAAkD,CAAC,CAAA;AACpG,qCAAsC,sBAAsB,CAAC,CAAA;AAE7D,IAAI,UAAU,GAAgB,wCAAgB,EAAE,CAAC;AACjD,OAAO,CAAC,GAAG,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AAC9D,OAAO,CAAC,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AAElE,IAAI,SAAS,GAAkB,IAAI,qCAAa,EAAE,CAAC;AACnD,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AAE7B,IAAI,aAAa,G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AAE,CAAC"} \ No newline at end of file diff --git a/src/server/aurelia-languageservice/services/htmlCompletion.ts b/src/server/aurelia-languageservice/services/htmlCompletion.ts index e128f8d8..b5d6c35b 100644 --- a/src/server/aurelia-languageservice/services/htmlCompletion.ts +++ b/src/server/aurelia-languageservice/services/htmlCompletion.ts @@ -1,197 +1,199 @@ -import { TextDocument, Position, CompletionList, CompletionItemKind, Range } from 'vscode-languageserver-types'; -import { HTMLDocument } from '../parser/htmlParser'; -import { TokenType, createScanner, ScannerState } from '../parser/htmlScanner'; -import { getAureliaTagProvider } from '../parser/aureliaTagProvider'; - -export interface HTMLTagProvider { - getId(): string; - isApplicable(languageId: string); - collectTags(collector: (tag: string, label: string) => void): void; - collectAttributes(tag: string, collector: (attribute: string, type: string) => void): void; - collectValues(tag: string, attribute: string, collector: (value: string) => void): void; -} - -export function doComplete(document: TextDocument, position: Position, htmlDocument: HTMLDocument, quotes: string): CompletionList { - - let quote = '"'; - if (quotes === 'single') { - quote = '\''; - } - - let tagProvider = getAureliaTagProvider(); - let result: CompletionList = { - isIncomplete: false, - items: [], - }; - let offset = document.offsetAt(position); - let node = htmlDocument.findNodeBefore(offset); - let text = document.getText(); - let scanner = createScanner(text, node.start); - let currentTag: string; - let currentAttributeName: string; - let token = scanner.scan(); - - function getReplaceRange(replaceStart: number, replaceEnd: number = offset): Range { - if (replaceStart > offset) { - replaceStart = offset; - } - return { - end: document.positionAt(replaceEnd), - start: document.positionAt(replaceStart), - }; - } - - function collectOpenTagSuggestions(afterOpenBracket: number, tagNameEnd?: number): CompletionList { - let range = getReplaceRange(afterOpenBracket, tagNameEnd); - tagProvider.collectTags((tag, label) => { - result.items.push({ - documentation: label, - kind: CompletionItemKind.Property, - label: tag, - textEdit: { newText: tag, range: range }, - }); - }); - return result; - } - - function collectTagSuggestions(tagStart: number, tagEnd: number): CompletionList { - collectOpenTagSuggestions(tagStart, tagEnd); - return result; - } - - function collectAttributeNameSuggestions(nameStart: number, nameEnd: number = offset): CompletionList { - let range = getReplaceRange(nameStart, nameEnd); - let value = isFollowedBy(text, nameEnd, ScannerState.AfterAttributeName, TokenType.DelimiterAssign) ? '' : '=' + quote + '{{}}' + quote; - tagProvider.collectAttributes(currentTag, (attribute, type) => { - let codeSnippet = attribute; - if (type !== 'v' && value.length) { - codeSnippet = codeSnippet + value; - } - result.items.push({ - kind: type === 'handler' ? CompletionItemKind.Function : CompletionItemKind.Value, - label: attribute, - textEdit: { newText: codeSnippet, range: range }, - }); - }); - return result; - } - - function collectAttributeValueSuggestions(valueStart: number, valueEnd?: number): CompletionList { - let range: Range; - let addQuotes: boolean; - if (offset > valueStart && offset <= valueEnd && text[valueStart] === quote) { - // inside attribute - if (valueEnd > offset && text[valueEnd - 1] === quote) { - valueEnd--; - } - let wsBefore = getWordStart(text, offset, valueStart + 1); - let wsAfter = getWordEnd(text, offset, valueEnd); - range = getReplaceRange(wsBefore, wsAfter); - addQuotes = false; - } else { - range = getReplaceRange(valueStart, valueEnd); - addQuotes = true; - } - - tagProvider.collectValues(currentTag, currentAttributeName, (value) => { - let codeSnippet = addQuotes ? quote + value + quote : value; - result.items.push({ - filterText: codeSnippet, - kind: CompletionItemKind.Unit, - label: value, - textEdit: { newText: codeSnippet, range: range }, - }); - }); - return result; - } - - function scanNextForEndPos(nextToken: TokenType): number { - if (offset === scanner.getTokenEnd()) { - token = scanner.scan(); - if (token === nextToken && scanner.getTokenOffset() === offset) { - return scanner.getTokenEnd(); - } - } - return offset; - } - - while (token !== TokenType.EOS && scanner.getTokenOffset() <= offset) { - // tslint:disable-next-line:switch-default - switch (token) { - case TokenType.StartTagOpen: - if (scanner.getTokenEnd() === offset) { - let endPos = scanNextForEndPos(TokenType.StartTag); - return collectTagSuggestions(offset, endPos); - } - break; - case TokenType.StartTag: - if (scanner.getTokenOffset() <= offset && offset <= scanner.getTokenEnd()) { - return collectOpenTagSuggestions(scanner.getTokenOffset(), scanner.getTokenEnd()); - } - currentTag = scanner.getTokenText(); - break; - case TokenType.AttributeName: - if (scanner.getTokenOffset() <= offset && offset <= scanner.getTokenEnd()) { - return collectAttributeNameSuggestions(scanner.getTokenOffset(), scanner.getTokenEnd()); - } - currentAttributeName = scanner.getTokenText(); - break; - case TokenType.DelimiterAssign: - if (scanner.getTokenEnd() === offset) { - return collectAttributeValueSuggestions(scanner.getTokenEnd()); - } - break; - case TokenType.AttributeValue: - if (scanner.getTokenOffset() <= offset && offset <= scanner.getTokenEnd()) { - return collectAttributeValueSuggestions(scanner.getTokenOffset(), scanner.getTokenEnd()); - } - break; - case TokenType.Whitespace: - if (offset <= scanner.getTokenEnd()) { - // tslint:disable-next-line:switch-default - switch (scanner.getScannerState()) { - case ScannerState.AfterOpeningStartTag: - let startPos = scanner.getTokenOffset(); - let endTagPos = scanNextForEndPos(TokenType.StartTag); - return collectTagSuggestions(startPos, endTagPos); - case ScannerState.WithinTag: - case ScannerState.AfterAttributeName: - return collectAttributeNameSuggestions(scanner.getTokenEnd()); - case ScannerState.BeforeAttributeValue: - return collectAttributeValueSuggestions(scanner.getTokenEnd()); - } - } - break; - } - token = scanner.scan(); - } - - return result; -} - -function isWhiteSpace(s: string): boolean { - return /^\s*$/.test(s); -} - -function isFollowedBy(s: string, offset: number, intialState: ScannerState, expectedToken: TokenType) { - let scanner = createScanner(s, offset, intialState); - let token = scanner.scan(); - while (token === TokenType.Whitespace) { - token = scanner.scan(); - } - return token === expectedToken; -} - -function getWordStart(s: string, offset: number, limit: number): number { - while (offset > limit && !isWhiteSpace(s[offset - 1])) { - offset--; - } - return offset; -} - -function getWordEnd(s: string, offset: number, limit: number): number { - while (offset < limit && !isWhiteSpace(s[offset])) { - offset++; - } - return offset; -} +import { TextDocument, Position, CompletionList, CompletionItemKind, Range, SnippetString } from 'vscode-languageserver-types'; +import { HTMLDocument } from '../parser/htmlParser'; +import { TokenType, createScanner, ScannerState } from '../parser/htmlScanner'; +import { getAureliaTagProvider } from '../parser/aureliaTagProvider'; + +export interface HTMLTagProvider { + getId(): string; + isApplicable(languageId: string); + collectTags(collector: (tag: string, label: string) => void): void; + collectAttributes(tag: string, collector: (attribute: string, type: string) => void): void; + collectValues(tag: string, attribute: string, collector: (value: string) => void): void; +} + +export function doComplete(document: TextDocument, position: Position, htmlDocument: HTMLDocument, quotes: string): CompletionList { + + let quote = '"'; + if (quotes === 'single') { + quote = '\''; + } + + let tagProvider = getAureliaTagProvider(); + let result: CompletionList = { + isIncomplete: false, + items: [], + }; + let offset = document.offsetAt(position); + let node = htmlDocument.findNodeBefore(offset); + let text = document.getText(); + let scanner = createScanner(text, node.start); + let currentTag: string; + let currentAttributeName: string; + let token = scanner.scan(); + + function getReplaceRange(replaceStart: number, replaceEnd: number = offset): Range { + if (replaceStart > offset) { + replaceStart = offset; + } + return { + end: document.positionAt(replaceEnd), + start: document.positionAt(replaceStart), + }; + } + + function collectOpenTagSuggestions(afterOpenBracket: number, tagNameEnd?: number): CompletionList { + let range = getReplaceRange(afterOpenBracket, tagNameEnd); + tagProvider.collectTags((tag, label) => { + result.items.push({ + documentation: label, + kind: CompletionItemKind.Property, + label: tag, + range, + }); + }); + return result; + } + + function collectTagSuggestions(tagStart: number, tagEnd: number): CompletionList { + collectOpenTagSuggestions(tagStart, tagEnd); + return result; + } + + function collectAttributeNameSuggestions(nameStart: number, nameEnd: number = offset): CompletionList { + let range = getReplaceRange(nameStart, nameEnd); + let value = isFollowedBy(text, nameEnd, ScannerState.AfterAttributeName, TokenType.DelimiterAssign) ? '' : '=' + quote + '$1' + quote; + tagProvider.collectAttributes(currentTag, (attribute, type) => { + let codeSnippet = attribute; + if (type !== 'v' && value.length) { + codeSnippet = codeSnippet + value; + } + result.items.push({ + insertText: SnippetString.create(codeSnippet), + kind: type === 'handler' ? CompletionItemKind.Function : CompletionItemKind.Value, + label: attribute, + range, + }); + }); + return result; + } + + function collectAttributeValueSuggestions(valueStart: number, valueEnd?: number): CompletionList { + let range: Range; + let addQuotes: boolean; + if (offset > valueStart && offset <= valueEnd && text[valueStart] === quote) { + // inside attribute + if (valueEnd > offset && text[valueEnd - 1] === quote) { + valueEnd--; + } + let wsBefore = getWordStart(text, offset, valueStart + 1); + let wsAfter = getWordEnd(text, offset, valueEnd); + range = getReplaceRange(wsBefore, wsAfter); + addQuotes = false; + } else { + range = getReplaceRange(valueStart, valueEnd); + addQuotes = true; + } + + tagProvider.collectValues(currentTag, currentAttributeName, (value) => { + let insertText = addQuotes ? quote + value + quote : value; + result.items.push({ + filterText: insertText, + kind: CompletionItemKind.Unit, + label: value, + insertText, + range, + }); + }); + return result; + } + + function scanNextForEndPos(nextToken: TokenType): number { + if (offset === scanner.getTokenEnd()) { + token = scanner.scan(); + if (token === nextToken && scanner.getTokenOffset() === offset) { + return scanner.getTokenEnd(); + } + } + return offset; + } + + while (token !== TokenType.EOS && scanner.getTokenOffset() <= offset) { + // tslint:disable-next-line:switch-default + switch (token) { + case TokenType.StartTagOpen: + if (scanner.getTokenEnd() === offset) { + let endPos = scanNextForEndPos(TokenType.StartTag); + return collectTagSuggestions(offset, endPos); + } + break; + case TokenType.StartTag: + if (scanner.getTokenOffset() <= offset && offset <= scanner.getTokenEnd()) { + return collectOpenTagSuggestions(scanner.getTokenOffset(), scanner.getTokenEnd()); + } + currentTag = scanner.getTokenText(); + break; + case TokenType.AttributeName: + if (scanner.getTokenOffset() <= offset && offset <= scanner.getTokenEnd()) { + return collectAttributeNameSuggestions(scanner.getTokenOffset(), scanner.getTokenEnd()); + } + currentAttributeName = scanner.getTokenText(); + break; + case TokenType.DelimiterAssign: + if (scanner.getTokenEnd() === offset) { + return collectAttributeValueSuggestions(scanner.getTokenEnd()); + } + break; + case TokenType.AttributeValue: + if (scanner.getTokenOffset() <= offset && offset <= scanner.getTokenEnd()) { + return collectAttributeValueSuggestions(scanner.getTokenOffset(), scanner.getTokenEnd()); + } + break; + case TokenType.Whitespace: + if (offset <= scanner.getTokenEnd()) { + // tslint:disable-next-line:switch-default + switch (scanner.getScannerState()) { + case ScannerState.AfterOpeningStartTag: + let startPos = scanner.getTokenOffset(); + let endTagPos = scanNextForEndPos(TokenType.StartTag); + return collectTagSuggestions(startPos, endTagPos); + case ScannerState.WithinTag: + case ScannerState.AfterAttributeName: + return collectAttributeNameSuggestions(scanner.getTokenEnd()); + case ScannerState.BeforeAttributeValue: + return collectAttributeValueSuggestions(scanner.getTokenEnd()); + } + } + break; + } + token = scanner.scan(); + } + + return result; +} + +function isWhiteSpace(s: string): boolean { + return /^\s*$/.test(s); +} + +function isFollowedBy(s: string, offset: number, intialState: ScannerState, expectedToken: TokenType) { + let scanner = createScanner(s, offset, intialState); + let token = scanner.scan(); + while (token === TokenType.Whitespace) { + token = scanner.scan(); + } + return token === expectedToken; +} + +function getWordStart(s: string, offset: number, limit: number): number { + while (offset > limit && !isWhiteSpace(s[offset - 1])) { + offset--; + } + return offset; +} + +function getWordEnd(s: string, offset: number, limit: number): number { + while (offset < limit && !isWhiteSpace(s[offset])) { + offset++; + } + return offset; +}