From 87caa9bbf8664fea8e743a251001ed5db0ae37d6 Mon Sep 17 00:00:00 2001 From: Erik Lieben Date: Mon, 24 Apr 2017 13:41:20 +0200 Subject: [PATCH] feat(language-server): rebuild language server to enable better auto complete and prepare it for future improvements - add language definitions - introduce custom Aurelia html language - auto insert closing brackets on adding ${ - show mdn documentation on hover (https://developer.mozilla.org/en-US/docs/Web/HTML/Element) - auto complete on attributes (only show bind or delegate by default) - auto complete on modifying bindings (for events, check if they bubble) - auto complete attributes on placing emmet [ opening tag (only works on new lines, not inside plain text) - custom element completion - start of building smarter html (ul tag only show allowed li in auto complete) --- .gitignore | 1 + dist/src/client/aureliaCLICommands.js | 97 --- dist/src/client/aureliaCLICommands.js.map | 1 - .../htmlInvalidCasingCodeActionProvider.js | 37 - ...htmlInvalidCasingCodeActionProvider.js.map | 1 - dist/src/client/main.js | 40 - dist/src/client/main.js.map | 1 - .../aureliaLanguageService.js | 14 - .../aureliaLanguageService.js.map | 1 - .../parser/aureliaTagProvider.js | 53 -- .../parser/aureliaTagProvider.js.map | 1 - .../parser/aureliaTags.js | 230 ----- .../parser/aureliaTags.js.map | 1 - .../parser/htmlParser.js | 168 ---- .../parser/htmlParser.js.map | 1 - .../parser/htmlScanner.js | 423 --------- .../parser/htmlScanner.js.map | 1 - .../aurelia-languageservice/parser/models.js | 18 - .../parser/models.js.map | 1 - .../services/htmlCompletion.js | 176 ---- .../services/htmlCompletion.js.map | 1 - .../htmlInvalidCasingCodeActionProvider.js | 8 - ...htmlInvalidCasingCodeActionProvider.js.map | 1 - .../services/htmlValidation.js | 88 -- .../services/htmlValidation.js.map | 1 - dist/src/server/languageModelCache.js | 71 -- dist/src/server/languageModelCache.js.map | 1 - dist/src/server/main.js | 49 -- dist/src/server/main.js.map | 1 - language-configuration.json | 28 + package.json | 33 +- src/client/main.ts | 8 +- src/server/AureliaSettings.ts | 3 + src/server/CompletionItemFactory.ts | 145 ++++ .../Completions/AttributeCompletionFactory.ts | 40 + .../AttributeValueCompletionFactory.ts | 42 + .../BaseAttributeCompletionFactory.ts | 106 +++ .../Completions/BindingCompletionFactory.ts | 101 +++ .../Completions/ElementCompletionFactory.ts | 68 ++ .../Completions/EmmetCompletionFactory.ts | 37 + src/server/Completions/Library/_Element.ts | 14 + .../Completions/Library/_elementLibrary.ts | 239 ++++++ .../Completions/Library/_elementStructure.ts | 808 ++++++++++++++++++ src/server/Completions/Library/aElement.ts | 64 ++ src/server/Completions/Library/abbrElement.ts | 16 + .../Completions/Library/addressElement.ts | 14 + src/server/Completions/Library/areaElement.ts | 50 ++ .../Completions/Library/articleElement.ts | 14 + .../Completions/Library/asideElement.ts | 13 + .../Completions/Library/audioElement.ts | 61 ++ src/server/Completions/Library/bElement.ts | 15 + src/server/Completions/Library/baseElement.ts | 29 + src/server/Completions/Library/bdiElement.ts | 12 + src/server/Completions/Library/bdoElement.ts | 12 + .../Completions/Library/blockquoteElement.ts | 18 + src/server/Completions/Library/bodyElement.ts | 60 ++ src/server/Completions/Library/brElement.ts | 13 + .../Completions/Library/buttonElement.ts | 71 ++ .../Completions/Library/canvasElement.ts | 17 + .../Completions/Library/captionElement.ts | 14 + src/server/Completions/Library/citeElement.ts | 13 + src/server/Completions/Library/codeElement.ts | 12 + src/server/Completions/Library/colElement.ts | 17 + .../Completions/Library/colgroupElement.ts | 16 + .../Completions/Library/composeElement.ts | 20 + src/server/Completions/Library/dataElement.ts | 14 + .../Completions/Library/datalistElement.ts | 13 + src/server/Completions/Library/ddElement.ts | 13 + src/server/Completions/Library/delElement.ts | 17 + .../Completions/Library/detailsElement.ts | 15 + src/server/Completions/Library/dfnElement.ts | 11 + src/server/Completions/Library/divElement.ts | 13 + src/server/Completions/Library/dlElement.ts | 14 + src/server/Completions/Library/dtElement.ts | 14 + src/server/Completions/Library/emElement.ts | 12 + .../Completions/Library/embedElement.ts | 24 + .../Completions/Library/fieldsetElement.ts | 19 + .../Completions/Library/figcaptionElement.ts | 14 + .../Completions/Library/figureElement.ts | 13 + .../Completions/Library/footerElement.ts | 14 + src/server/Completions/Library/formElement.ts | 65 ++ src/server/Completions/Library/hElement.ts | 12 + src/server/Completions/Library/headElement.ts | 15 + .../Completions/Library/headerElement.ts | 12 + src/server/Completions/Library/hrElement.ts | 14 + src/server/Completions/Library/htmlElement.ts | 15 + src/server/Completions/Library/iElement.ts | 13 + .../Completions/Library/iframeElement.ts | 66 ++ src/server/Completions/Library/imgElement.ts | 40 + .../Completions/Library/inputElement.ts | 95 ++ src/server/Completions/Library/insElement.ts | 16 + src/server/Completions/Library/kdbElement.ts | 12 + .../Completions/Library/labelElement.ts | 14 + .../Completions/Library/legendElement.ts | 11 + src/server/Completions/Library/liElement.ts | 21 + src/server/Completions/Library/linkElement.ts | 37 + src/server/Completions/Library/mainElement.ts | 13 + src/server/Completions/Library/mapElement.ts | 13 + src/server/Completions/Library/markElement.ts | 13 + src/server/Completions/Library/metaElement.ts | 49 ++ .../Completions/Library/meterElement.ts | 27 + src/server/Completions/Library/navElement.ts | 12 + .../Completions/Library/noScriptElement.ts | 12 + .../Completions/Library/noframesElement.ts | 13 + .../Completions/Library/objectElement.ts | 30 + src/server/Completions/Library/olElement.ts | 29 + .../Completions/Library/optgroupElement.ts | 16 + .../Completions/Library/optionElement.ts | 20 + .../Completions/Library/outputElement.ts | 18 + src/server/Completions/Library/pElement.ts | 13 + .../Completions/Library/paramElement.ts | 15 + src/server/Completions/Library/preElement.ts | 12 + .../Completions/Library/progressElement.ts | 20 + src/server/Completions/Library/qElement.ts | 17 + .../Completions/Library/requireElement.ts | 18 + src/server/Completions/Library/rpElement.ts | 12 + src/server/Completions/Library/rtElement.ts | 12 + src/server/Completions/Library/rtcElement.ts | 12 + src/server/Completions/Library/rubyElement.ts | 12 + src/server/Completions/Library/sElement.ts | 14 + src/server/Completions/Library/sampElement.ts | 12 + .../Completions/Library/scriptElement.ts | 38 + .../Completions/Library/sectionElement.ts | 12 + .../Completions/Library/selectElement.ts | 36 + src/server/Completions/Library/slotElement.ts | 14 + .../Completions/Library/smallElement.ts | 14 + .../Completions/Library/sourceElement.ts | 28 + src/server/Completions/Library/spanElement.ts | 15 + .../Completions/Library/strongElement.ts | 11 + .../Completions/Library/styleElement.ts | 21 + src/server/Completions/Library/subElement.ts | 12 + .../Completions/Library/summaryElement.ts | 11 + src/server/Completions/Library/supElement.ts | 12 + .../Completions/Library/tableElement.ts | 11 + .../Completions/Library/tbodyElement.ts | 11 + src/server/Completions/Library/tdElement.ts | 22 + .../Completions/Library/templateElement.ts | 12 + .../Completions/Library/textareaElement.ts | 65 ++ .../Completions/Library/tfootElement.ts | 11 + src/server/Completions/Library/thElement.ts | 27 + .../Completions/Library/theadElement.ts | 12 + src/server/Completions/Library/timeElement.ts | 17 + .../Completions/Library/titleElement.ts | 13 + src/server/Completions/Library/trElement.ts | 13 + .../Completions/Library/trackElement.ts | 29 + src/server/Completions/Library/uElement.ts | 14 + src/server/Completions/Library/ulElement.ts | 13 + .../Completions/Library/unknownElement.ts | 11 + src/server/Completions/Library/varElement.ts | 11 + .../Completions/Library/videoElement.ts | 47 + src/server/Completions/Library/wbrElement.ts | 13 + src/server/DocumentParser.ts | 66 ++ src/server/HoverProviderFactory.ts | 105 +++ .../aureliaLanguageService.ts | 3 - .../parser/aureliaTagProvider.ts | 56 -- .../parser/aureliaTags.ts | 481 ++++++----- .../aurelia-languageservice/parser/models.ts | 15 - .../services/htmlCompletion.ts | 199 ----- src/server/main.ts | 65 +- themes/dark_vs.json | 17 +- themes/light_vs.json | 2 +- tsconfig.json | 2 + 162 files changed, 4393 insertions(+), 2036 deletions(-) delete mode 100644 dist/src/client/aureliaCLICommands.js delete mode 100644 dist/src/client/aureliaCLICommands.js.map delete mode 100644 dist/src/client/htmlInvalidCasingCodeActionProvider.js delete mode 100644 dist/src/client/htmlInvalidCasingCodeActionProvider.js.map delete mode 100644 dist/src/client/main.js delete mode 100644 dist/src/client/main.js.map delete mode 100644 dist/src/server/aurelia-languageservice/aureliaLanguageService.js delete mode 100644 dist/src/server/aurelia-languageservice/aureliaLanguageService.js.map delete mode 100644 dist/src/server/aurelia-languageservice/parser/aureliaTagProvider.js delete mode 100644 dist/src/server/aurelia-languageservice/parser/aureliaTagProvider.js.map delete mode 100644 dist/src/server/aurelia-languageservice/parser/aureliaTags.js delete mode 100644 dist/src/server/aurelia-languageservice/parser/aureliaTags.js.map delete mode 100644 dist/src/server/aurelia-languageservice/parser/htmlParser.js delete mode 100644 dist/src/server/aurelia-languageservice/parser/htmlParser.js.map delete mode 100644 dist/src/server/aurelia-languageservice/parser/htmlScanner.js delete mode 100644 dist/src/server/aurelia-languageservice/parser/htmlScanner.js.map delete mode 100644 dist/src/server/aurelia-languageservice/parser/models.js delete mode 100644 dist/src/server/aurelia-languageservice/parser/models.js.map delete mode 100644 dist/src/server/aurelia-languageservice/services/htmlCompletion.js delete mode 100644 dist/src/server/aurelia-languageservice/services/htmlCompletion.js.map delete mode 100644 dist/src/server/aurelia-languageservice/services/htmlInvalidCasingCodeActionProvider.js delete mode 100644 dist/src/server/aurelia-languageservice/services/htmlInvalidCasingCodeActionProvider.js.map delete mode 100644 dist/src/server/aurelia-languageservice/services/htmlValidation.js delete mode 100644 dist/src/server/aurelia-languageservice/services/htmlValidation.js.map delete mode 100644 dist/src/server/languageModelCache.js delete mode 100644 dist/src/server/languageModelCache.js.map delete mode 100644 dist/src/server/main.js delete mode 100644 dist/src/server/main.js.map create mode 100644 language-configuration.json create mode 100644 src/server/AureliaSettings.ts create mode 100644 src/server/CompletionItemFactory.ts create mode 100644 src/server/Completions/AttributeCompletionFactory.ts create mode 100644 src/server/Completions/AttributeValueCompletionFactory.ts create mode 100644 src/server/Completions/BaseAttributeCompletionFactory.ts create mode 100644 src/server/Completions/BindingCompletionFactory.ts create mode 100644 src/server/Completions/ElementCompletionFactory.ts create mode 100644 src/server/Completions/EmmetCompletionFactory.ts create mode 100644 src/server/Completions/Library/_Element.ts create mode 100644 src/server/Completions/Library/_elementLibrary.ts create mode 100644 src/server/Completions/Library/_elementStructure.ts create mode 100644 src/server/Completions/Library/aElement.ts create mode 100644 src/server/Completions/Library/abbrElement.ts create mode 100644 src/server/Completions/Library/addressElement.ts create mode 100644 src/server/Completions/Library/areaElement.ts create mode 100644 src/server/Completions/Library/articleElement.ts create mode 100644 src/server/Completions/Library/asideElement.ts create mode 100644 src/server/Completions/Library/audioElement.ts create mode 100644 src/server/Completions/Library/bElement.ts create mode 100644 src/server/Completions/Library/baseElement.ts create mode 100644 src/server/Completions/Library/bdiElement.ts create mode 100644 src/server/Completions/Library/bdoElement.ts create mode 100644 src/server/Completions/Library/blockquoteElement.ts create mode 100644 src/server/Completions/Library/bodyElement.ts create mode 100644 src/server/Completions/Library/brElement.ts create mode 100644 src/server/Completions/Library/buttonElement.ts create mode 100644 src/server/Completions/Library/canvasElement.ts create mode 100644 src/server/Completions/Library/captionElement.ts create mode 100644 src/server/Completions/Library/citeElement.ts create mode 100644 src/server/Completions/Library/codeElement.ts create mode 100644 src/server/Completions/Library/colElement.ts create mode 100644 src/server/Completions/Library/colgroupElement.ts create mode 100644 src/server/Completions/Library/composeElement.ts create mode 100644 src/server/Completions/Library/dataElement.ts create mode 100644 src/server/Completions/Library/datalistElement.ts create mode 100644 src/server/Completions/Library/ddElement.ts create mode 100644 src/server/Completions/Library/delElement.ts create mode 100644 src/server/Completions/Library/detailsElement.ts create mode 100644 src/server/Completions/Library/dfnElement.ts create mode 100644 src/server/Completions/Library/divElement.ts create mode 100644 src/server/Completions/Library/dlElement.ts create mode 100644 src/server/Completions/Library/dtElement.ts create mode 100644 src/server/Completions/Library/emElement.ts create mode 100644 src/server/Completions/Library/embedElement.ts create mode 100644 src/server/Completions/Library/fieldsetElement.ts create mode 100644 src/server/Completions/Library/figcaptionElement.ts create mode 100644 src/server/Completions/Library/figureElement.ts create mode 100644 src/server/Completions/Library/footerElement.ts create mode 100644 src/server/Completions/Library/formElement.ts create mode 100644 src/server/Completions/Library/hElement.ts create mode 100644 src/server/Completions/Library/headElement.ts create mode 100644 src/server/Completions/Library/headerElement.ts create mode 100644 src/server/Completions/Library/hrElement.ts create mode 100644 src/server/Completions/Library/htmlElement.ts create mode 100644 src/server/Completions/Library/iElement.ts create mode 100644 src/server/Completions/Library/iframeElement.ts create mode 100644 src/server/Completions/Library/imgElement.ts create mode 100644 src/server/Completions/Library/inputElement.ts create mode 100644 src/server/Completions/Library/insElement.ts create mode 100644 src/server/Completions/Library/kdbElement.ts create mode 100644 src/server/Completions/Library/labelElement.ts create mode 100644 src/server/Completions/Library/legendElement.ts create mode 100644 src/server/Completions/Library/liElement.ts create mode 100644 src/server/Completions/Library/linkElement.ts create mode 100644 src/server/Completions/Library/mainElement.ts create mode 100644 src/server/Completions/Library/mapElement.ts create mode 100644 src/server/Completions/Library/markElement.ts create mode 100644 src/server/Completions/Library/metaElement.ts create mode 100644 src/server/Completions/Library/meterElement.ts create mode 100644 src/server/Completions/Library/navElement.ts create mode 100644 src/server/Completions/Library/noScriptElement.ts create mode 100644 src/server/Completions/Library/noframesElement.ts create mode 100644 src/server/Completions/Library/objectElement.ts create mode 100644 src/server/Completions/Library/olElement.ts create mode 100644 src/server/Completions/Library/optgroupElement.ts create mode 100644 src/server/Completions/Library/optionElement.ts create mode 100644 src/server/Completions/Library/outputElement.ts create mode 100644 src/server/Completions/Library/pElement.ts create mode 100644 src/server/Completions/Library/paramElement.ts create mode 100644 src/server/Completions/Library/preElement.ts create mode 100644 src/server/Completions/Library/progressElement.ts create mode 100644 src/server/Completions/Library/qElement.ts create mode 100644 src/server/Completions/Library/requireElement.ts create mode 100644 src/server/Completions/Library/rpElement.ts create mode 100644 src/server/Completions/Library/rtElement.ts create mode 100644 src/server/Completions/Library/rtcElement.ts create mode 100644 src/server/Completions/Library/rubyElement.ts create mode 100644 src/server/Completions/Library/sElement.ts create mode 100644 src/server/Completions/Library/sampElement.ts create mode 100644 src/server/Completions/Library/scriptElement.ts create mode 100644 src/server/Completions/Library/sectionElement.ts create mode 100644 src/server/Completions/Library/selectElement.ts create mode 100644 src/server/Completions/Library/slotElement.ts create mode 100644 src/server/Completions/Library/smallElement.ts create mode 100644 src/server/Completions/Library/sourceElement.ts create mode 100644 src/server/Completions/Library/spanElement.ts create mode 100644 src/server/Completions/Library/strongElement.ts create mode 100644 src/server/Completions/Library/styleElement.ts create mode 100644 src/server/Completions/Library/subElement.ts create mode 100644 src/server/Completions/Library/summaryElement.ts create mode 100644 src/server/Completions/Library/supElement.ts create mode 100644 src/server/Completions/Library/tableElement.ts create mode 100644 src/server/Completions/Library/tbodyElement.ts create mode 100644 src/server/Completions/Library/tdElement.ts create mode 100644 src/server/Completions/Library/templateElement.ts create mode 100644 src/server/Completions/Library/textareaElement.ts create mode 100644 src/server/Completions/Library/tfootElement.ts create mode 100644 src/server/Completions/Library/thElement.ts create mode 100644 src/server/Completions/Library/theadElement.ts create mode 100644 src/server/Completions/Library/timeElement.ts create mode 100644 src/server/Completions/Library/titleElement.ts create mode 100644 src/server/Completions/Library/trElement.ts create mode 100644 src/server/Completions/Library/trackElement.ts create mode 100644 src/server/Completions/Library/uElement.ts create mode 100644 src/server/Completions/Library/ulElement.ts create mode 100644 src/server/Completions/Library/unknownElement.ts create mode 100644 src/server/Completions/Library/varElement.ts create mode 100644 src/server/Completions/Library/videoElement.ts create mode 100644 src/server/Completions/Library/wbrElement.ts create mode 100644 src/server/DocumentParser.ts create mode 100644 src/server/HoverProviderFactory.ts delete mode 100644 src/server/aurelia-languageservice/parser/aureliaTagProvider.ts delete mode 100644 src/server/aurelia-languageservice/parser/models.ts delete mode 100644 src/server/aurelia-languageservice/services/htmlCompletion.ts diff --git a/.gitignore b/.gitignore index ffe87d1a..d3abde90 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ npm-debug.log* .test dist/doc-temp dist/test +dist diff --git a/dist/src/client/aureliaCLICommands.js b/dist/src/client/aureliaCLICommands.js deleted file mode 100644 index ffc8ac4a..00000000 --- a/dist/src/client/aureliaCLICommands.js +++ /dev/null @@ -1,97 +0,0 @@ -"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(`cd ${vscode.workspace.rootPath}`, 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 deleted file mode 100644 index c09768b6..00000000 --- a/dist/src/client/aureliaCLICommands.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"aureliaCLICommands.js","sourceRoot":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QAAQ,CAAC,QAAQ,CAAC,MAAM,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,CAAC;YAC3D,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 deleted file mode 100644 index d56fc27b..00000000 --- a/dist/src/client/htmlInvalidCasingCodeActionProvider.js +++ /dev/null @@ -1,37 +0,0 @@ -'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 deleted file mode 100644 index 7fffaea2..00000000 --- a/dist/src/client/htmlInvalidCasingCodeActionProvider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,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;;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 deleted file mode 100644 index fb5f1ffe..00000000 --- a/dist/src/client/main.js +++ /dev/null @@ -1,40 +0,0 @@ -"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"); -const relatedFiles_1 = require("./relatedFiles"); -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)); - context.subscriptions.push(new relatedFiles_1.RelatedFiles()); - // 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 deleted file mode 100644 index 1283b198..00000000 --- a/dist/src/client/main.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../src/client/main.ts"],"names":[],"mappings":";AAAA,6BAA6B;AAC7B,mCAA4E;AAC5E,iEAA4G;AAC5G,6DAAsD;AACtD,+FAAoF;AACpF,iDAA8C;AAE9C,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,wBAAwB;IACxB,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,4BAAkB,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC,CAAC;IAC/E,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,2BAAY,EAAE,CAAC,CAAC;IAE/C,oBAAoB;IACpB,MAAM,mBAAmB,GAAG,IAAI,6CAA+B,EAAE,CAAC;IAClE,mBAAmB,CAAC,QAAQ,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IACpD,kBAAS,CAAC,2BAA2B,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IAEnE,mCAAmC;IACnC,MAAM,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;IAC3F,MAAM,YAAY,GAAG,EAAE,QAAQ,EAAE,CAAC,UAAU,EAAE,cAAc,CAAC,EAAE,CAAC;IAChE,MAAM,aAAa,GAAkB;QACnC,KAAK,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,qCAAa,CAAC,GAAG,EAAE;QACpF,GAAG,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,qCAAa,CAAC,GAAG,EAAE;KAC5D,CAAC;IAEF,MAAM,aAAa,GAA0B;QAC3C,wBAAwB,EAAE,SAAS;QACnC,gBAAgB,EAAE,CAAC,MAAM,CAAC;QAC1B,qBAAqB,EAAE,EAAE;QACzB,WAAW,EAAE;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;AAnCD,4BAmCC"} \ No newline at end of file diff --git a/dist/src/server/aurelia-languageservice/aureliaLanguageService.js b/dist/src/server/aurelia-languageservice/aureliaLanguageService.js deleted file mode 100644 index 16e24674..00000000 --- a/dist/src/server/aurelia-languageservice/aureliaLanguageService.js +++ /dev/null @@ -1,14 +0,0 @@ -"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 deleted file mode 100644 index 03c3104d..00000000 --- a/dist/src/server/aurelia-languageservice/aureliaLanguageService.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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 deleted file mode 100644 index c0f30944..00000000 --- a/dist/src/server/aurelia-languageservice/parser/aureliaTagProvider.js +++ /dev/null @@ -1,53 +0,0 @@ -"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 deleted file mode 100644 index 66aabdc4..00000000 --- a/dist/src/server/aurelia-languageservice/parser/aureliaTagProvider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,CA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AC;YAC5D,SAAS,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,IAAI,SAAS,CAAC,SAAS,CAAC,IAAI,GAAG,GAAG,GAAG,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;QAC7F,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 diff --git a/dist/src/server/aurelia-languageservice/parser/aureliaTags.js b/dist/src/server/aurelia-languageservice/parser/aureliaTags.js deleted file mode 100644 index e81cc0bf..00000000 --- a/dist/src/server/aurelia-languageservice/parser/aureliaTags.js +++ /dev/null @@ -1,230 +0,0 @@ -"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 deleted file mode 100644 index 6467ac66..00000000 --- a/dist/src/server/aurelia-languageservice/parser/aureliaTags.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,I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B,QAAQ,EAAE,YAAY;IACtB,GAAG,EAAE,CAAC,GAAG,YAAY,CAAC;IACtB,OAAO,EAAE,CAAC,GAAG,YAAY,CAAC;IAC1B,KAAK,EAAE,CAAC,GAAG,YAAY,CAAC;IACxB,UAAU,EAAE,CAAC,GAAG,YAAY,CAAC;IAC7B,GAAG,EAAE,YAAY;IACjB,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,YAAY;IACnB,MAAM,EAAE,YAAY;IACpB,GAAG,EAAE,YAAY;IACjB,MAAM,EAAE,YAAY;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 deleted file mode 100644 index d50cf4b6..00000000 --- a/dist/src/server/aurelia-languageservice/parser/htmlParser.js +++ /dev/null @@ -1,168 +0,0 @@ -"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 deleted file mode 100644 index a3a12a29..00000000 --- a/dist/src/server/aurelia-languageservice/parser/htmlParser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"htmlParser.js","sourceRoot":"","sources":["../../../../../src/server/aurelia-languageservice/parser/htmlParser.ts"],"names":[],"mappings":";AAAA,+CAAyD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ACR,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 diff --git a/dist/src/server/aurelia-languageservice/parser/htmlScanner.js b/dist/src/server/aurelia-languageservice/parser/htmlScanner.js deleted file mode 100644 index 976f9ea1..00000000 --- a/dist/src/server/aurelia-languageservice/parser/htmlScanner.js +++ /dev/null @@ -1,423 +0,0 @@ -"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 deleted file mode 100644 index a726eeac..00000000 --- a/dist/src/server/aurelia-languageservice/parser/htmlScanner.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,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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 deleted file mode 100644 index d195ce7b..00000000 --- a/dist/src/server/aurelia-languageservice/parser/models.js +++ /dev/null @@ -1,18 +0,0 @@ -"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 deleted file mode 100644 index 4b3a799b..00000000 --- a/dist/src/server/aurelia-languageservice/parser/models.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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 deleted file mode 100644 index 36d1d64e..00000000 --- a/dist/src/server/aurelia-languageservice/services/htmlCompletion.js +++ /dev/null @@ -1,176 +0,0 @@ -"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: vscode_languageserver_types_1.CompletionItemKind.Property, - label: tag, - }); - }); - 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({ - textEdit: vscode_languageserver_types_1.TextEdit.replace(range, codeSnippet), - kind: type === 'handler' ? vscode_languageserver_types_1.CompletionItemKind.Function : vscode_languageserver_types_1.CompletionItemKind.Value, - label: attribute, - insertTextFormat: vscode_languageserver_types_1.InsertTextFormat.Snippet - }); - }); - 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: vscode_languageserver_types_1.CompletionItemKind.Unit, - label: value, - insertText, - }); - }); - 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 deleted file mode 100644 index ad6b955d..00000000 --- a/dist/src/server/aurelia-languageservice/services/htmlCompletion.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"htmlCompletion.js","sourceRoot":"","sources":["../../../../../src/server/aurelia-languageservice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services/htmlInvalidCasingCodeActionProvider.js b/dist/src/server/aurelia-languageservice/services/htmlInvalidCasingCodeActionProvider.js deleted file mode 100644 index 11b830e9..00000000 --- a/dist/src/server/aurelia-languageservice/services/htmlInvalidCasingCodeActionProvider.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; -class GoCodeActionProvider { - provideCodeActions(document, range, context, token) { - console.log("CODE PRIVDER"); - return null; - } -} -//# sourceMappingURL=htmlInvalidCasingCodeActionProvider.js.map \ No newline at end of file diff --git a/dist/src/server/aurelia-languageservice/services/htmlInvalidCasingCodeActionProvider.js.map b/dist/src/server/aurelia-languageservice/services/htmlInvalidCasingCodeActionProvider.js.map deleted file mode 100644 index 8f3acedf..00000000 --- a/dist/src/server/aurelia-languageservice/services/htmlInvalidCasingCodeActionProvider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"htmlInvalidCasingCodeActionProvider.js","sourceRoot":"","sources":["../../../../../src/server/aurelia-languageservice/services/htmlInvalidCasingCodeActionProvider.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAKb;IACS,kBAAkB,CACvB,QAA6B,EAC7B,KAAmB,EACnB,OAAiC,EACjC,KAA+B;QAE7B,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAE5B,MAAM,CAAC,IAAI,CAAC;IAChB,CAAC;AACH,CAAC;AAAA"} \ 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 deleted file mode 100644 index dc437b94..00000000 --- a/dist/src/server/aurelia-languageservice/services/htmlValidation.js +++ /dev/null @@ -1,88 +0,0 @@ -'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 = vscode_languageserver_types_1.DiagnosticSeverity.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 deleted file mode 100644 index 06f0f1d1..00000000 --- a/dist/src/server/aurelia-languageservice/services/htmlValidation.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,CA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MAAM,CAAC,CAAC,CAAC;gBAC1B,MAAM,IAAI,GAAG,KAAK,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,gDAAkB,CAAC,KAAK;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 deleted file mode 100644 index 90d76891..00000000 --- a/dist/src/server/languageModelCache.js +++ /dev/null @@ -1,71 +0,0 @@ -'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 deleted file mode 100644 index c0c44f39..00000000 --- a/dist/src/server/languageModelCache.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"languageModelCache.js","sourceRo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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 deleted file mode 100644 index 6b86af9f..00000000 --- a/dist/src/server/main.js +++ /dev/null @@ -1,49 +0,0 @@ -"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 deleted file mode 100644 index 4b4414f1..00000000 --- a/dist/src/server/main.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../src/server/main.ts"],"names":[],"mappings":";;;;;;;;;AAAA,iEAAyH;AACzH,6FAAoG;AACpG,6DAA6D;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,GAAG,0CAAqB,CAAe,EAAE,EAAE,EAAE,EAAE,QAAQ,IAAI,2CAAkB,EAAE,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC9H,SAAS,CAAC,UAAU,CAAC,CAAC;IACpB,a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CAAC;IAC/C,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,QAAQ,EAAE,oBAAoB,CAAC,QAAQ,EAAE,YAAY,EAAE,eAAe,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;AAChI,CAAC,CAAC,CAAC;AAEH,UAAU,CAAC,MAAM,EAAE,CAAC"} \ No newline at end of file diff --git a/language-configuration.json b/language-configuration.json new file mode 100644 index 00000000..ed6c33eb --- /dev/null +++ b/language-configuration.json @@ -0,0 +1,28 @@ +{ + "comments": { + "blockComment": [ "" ] + }, + "brackets": [ + [""], + ["<", ">"], + ["{", "}"], + ["(", ")"] + ], + "autoClosingPairs": [ + { "open": "{", "close": "}"}, + { "open": "[", "close": "]"}, + { "open": "(", "close": ")" }, + { "open": "'", "close": "'" }, + { "open": "\"", "close": "\"" }, + { "open": "${", "close": "}" } + ], + "surroundingPairs": [ + { "open": "'", "close": "'" }, + { "open": "\"", "close": "\"" }, + { "open": "{", "close": "}"}, + { "open": "[", "close": "]"}, + { "open": "(", "close": ")" }, + { "open": "<", "close": ">" }, + { "open": "${", "close": "}" } + ] +} diff --git a/package.json b/package.json index b41d1f8b..45ea2914 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "Snippets" ], "activationEvents": [ - "onLanguage:html", + "onLanguage:aurelia-html", "onCommand:extension.auNew", "onCommand:extension.auGenerate", "onCommand:extension.auTest", @@ -44,9 +44,26 @@ ], "main": "./dist/src/client/main", "contributes": { + "languages": [ + { + "id": "aurelia-html", + "order": 1, + "extensions": [ + ".html" + ], + "aliases": [ + "Aurelia HTML", + "html" + ], + "mimetypes": [ + "text/html" + ], + "configuration": "./language-configuration.json" + } + ], "grammars": [ { - "language": "html", + "language": "aurelia-html", "scopeName": "au.html", "path": "./syntaxes/html.json" } @@ -138,7 +155,8 @@ "postinstall": "node ./node_modules/vscode/bin/install", "lint": "node ./node_modules/tslint/lib/tslint-cli.js -c tslint.json --project tsconfig.json", "changelog": "node ./node_modules/conventional-changelog-cli/cli.js -p angular -i CHANGELOG.md -s", - "test": "mocha ./dist/test --recursive" + "test": "mocha ./dist/test --recursive", + "vscode-typings": "node ./node_modules/vscode/bin/install" }, "devDependencies": { "@types/chai": "^3.4.35", @@ -154,9 +172,12 @@ "vscode-textmate": "^3.1.0" }, "dependencies": { - "aurelia-cli": "^0.24.0", - "vscode-languageclient": "^3.0.4", - "vscode-languageserver": "^3.0.5", + "aurelia-cli": "^0.21.0", + "aurelia-dependency-injection": "^1.3.0", + "parse5": "^3.0.1", + "reflect-metadata": "^0.1.9", + "vscode-languageclient": "^3.0.3", + "vscode-languageserver": "^3.0.4", "vscode-languageserver-types": "^3.0.3", "vscode-uri": "^1.0.0" } diff --git a/src/client/main.ts b/src/client/main.ts index 01a7ea35..9e483c8f 100644 --- a/src/client/main.ts +++ b/src/client/main.ts @@ -1,5 +1,5 @@ import * as path from 'path'; -import { ExtensionContext, OutputChannel, window, languages } from 'vscode'; +import { ExtensionContext, OutputChannel, window, languages, SnippetString } from 'vscode'; import { LanguageClient, LanguageClientOptions, ServerOptions, TransportKind } from 'vscode-languageclient'; import AureliaCliCommands from './aureliaCLICommands'; import htmlInvalidCasingActionProvider from './htmlInvalidCasingCodeActionProvider'; @@ -20,7 +20,7 @@ export function activate(context: ExtensionContext) { // Register code fix const invalidCasingAction = new htmlInvalidCasingActionProvider(); invalidCasingAction.activate(context.subscriptions); - languages.registerCodeActionsProvider('html', invalidCasingAction); + languages.registerCodeActionsProvider('aurelia-html', invalidCasingAction); // Register Aurelia language server const serverModule = context.asAbsolutePath(path.join('dist', 'src', 'server', 'main.js')); @@ -32,14 +32,14 @@ export function activate(context: ExtensionContext) { const clientOptions: LanguageClientOptions = { diagnosticCollectionName: 'Aurelia', - documentSelector: ['html'], + documentSelector: ['aurelia-html'], initializationOptions: {}, synchronize: { configurationSection: ['aurelia'], }, }; - const client = new LanguageClient('html', 'Aurelia', serverOptions, clientOptions); + const client = new LanguageClient('aurelia-html', 'Aurelia', serverOptions, clientOptions); const disposable = client.start(); context.subscriptions.push(disposable); } diff --git a/src/server/AureliaSettings.ts b/src/server/AureliaSettings.ts new file mode 100644 index 00000000..518cb249 --- /dev/null +++ b/src/server/AureliaSettings.ts @@ -0,0 +1,3 @@ +export default class AureliaSettings { + public quote: string = '"'; +} diff --git a/src/server/CompletionItemFactory.ts b/src/server/CompletionItemFactory.ts new file mode 100644 index 00000000..a655da92 --- /dev/null +++ b/src/server/CompletionItemFactory.ts @@ -0,0 +1,145 @@ +import { autoinject } from 'aurelia-dependency-injection'; +import { CompletionItem, Position } from 'vscode-languageserver-types'; +import AttributeCompletionFactory from './Completions/AttributeCompletionFactory'; +import ElementCompletionFactory from './Completions/ElementCompletionFactory'; +import AttributeValueCompletionFactory from './Completions/AttributeValueCompletionFactory'; +import BindingCompletionFactory from './Completions/BindingCompletionFactory'; +import EmmetCompletionFactory from './Completions/EmmetCompletionFactory'; +import { DocumentParser, TagDefinition, AttributeDefinition } from './DocumentParser'; + +@autoinject() +export default class CompletionItemFactory { + + constructor( + private attributeCompletionFactory: AttributeCompletionFactory, + private elementCompletionFactory: ElementCompletionFactory, + private attributeValueCompletionFactory: AttributeValueCompletionFactory, + private bindingCompletionFactory: BindingCompletionFactory, + private emmetCompletionFactory: EmmetCompletionFactory, + private parser: DocumentParser) { } + + public async create( + triggerCharacter: string, + position: Position, + text: string, + positionNumber: number, + uri: string): Promise> { + + let nodes = await this.parser.parse(text); + let insideTag: TagDefinition = null; + let lastIdx = 0; + + // get insidetag and last index of tag + for(let i = 0; i < nodes.length; i++) { + let node = nodes[i]; + if (!insideTag && positionNumber >= node.startOffset && positionNumber <= node.endOffset) { + insideTag = node; + } + if (node !== insideTag && node.endOffset > positionNumber) { + lastIdx = i; + break; + } + } + + // get open parent tag + let tags = this.getOpenHtmlTags(nodes, lastIdx); + let parentTag = tags[tags.length - 1]; + + // auto complete inside a tag + if (insideTag) { + switch (triggerCharacter) { + case ' ': + return this.attributeCompletionFactory.create(insideTag.name, insideTag.attributes.map(i => i.name)); + case '.': + return this.createBindingCompletion(insideTag, text, positionNumber); + case '"': + case '\'': + return this.createValueCompletion(insideTag, text, positionNumber); + default: + return []; + } + } + + // auto complete others + switch (triggerCharacter) { + case '[': + return this.createEmmetCompletion(text, positionNumber); + case '<': + return this.elementCompletionFactory.create(parentTag); + } + } + + private getOpenHtmlTags(nodes: Array, lastIdx: number) { + let tags: Array = []; + for(let i = 0; i < lastIdx; i++) { + if (nodes[i].startTag) { + tags.push(nodes[i].name); + } else { + var index = tags.indexOf(nodes[i].name); + if (index >= 0) { + tags.splice( index, 1 ); + } + } + } + return tags; + } + + private createValueCompletion(tag: TagDefinition, text: string, position: number) { + let nextCharacter = text.substring(position, position + 1); + if (/['"]/.test(nextCharacter)) { + let attribute; + let elementText = text.substring(tag.startOffset, tag.endOffset); + let tagPosition = position - tag.startOffset; + const attributeRegex = /([\w-]+)\.?\w*\=['"]/g; + let matches; + while (matches = attributeRegex.exec(elementText)) { + if (tagPosition >= matches.index && (tagPosition <= matches.index + matches[0].length)) { + let foundText = matches[1]; + let attributes = tag.attributes.filter(a => a && a.name == foundText); + if (attributes.length) { + attribute = attributes[0]; + break; + } + } + } + if (!attribute) { + return []; + } + return this.attributeValueCompletionFactory.create(tag.name, attribute.name, attribute.binding); + } + } + + private createEmmetCompletion(text: string, position: number) { + const emmetRegex = /^([^<]*?>)*?([\w|-]*)\[$/gm; + let matches = emmetRegex.exec(text.substring(0, position)); + if (!matches) { + return []; + } + let elementName = matches[2]; + console.log(elementName); + return this.emmetCompletionFactory.create(elementName); + } + + private createBindingCompletion(tag: TagDefinition, text: string, position: number) { + let attribute; + let elementText = text.substring(tag.startOffset, tag.endOffset); + let tagPosition = position - tag.startOffset; + const attributeRegex = /([\w\.-]+)(\=['"](.*?)["'])?/g; + let matches; + let foundText = ''; + while (matches = attributeRegex.exec(elementText)) { + if (tagPosition >= matches.index && (tagPosition <= matches.index + matches[1].length)) { + foundText = matches[1]; + let attributes = tag.attributes.filter(a => a.name + (a.binding !== undefined ? '.' : '') == foundText); + if (attributes.length) { + attribute = attributes[0]; + break; + } + } + } + if (!attribute) { + attribute = new AttributeDefinition(foundText.substring(0, foundText.length-1), ''); + } + return this.bindingCompletionFactory.create(tag, attribute, text.substring(position, position + 1)); + } +} diff --git a/src/server/Completions/AttributeCompletionFactory.ts b/src/server/Completions/AttributeCompletionFactory.ts new file mode 100644 index 00000000..cf88a6de --- /dev/null +++ b/src/server/Completions/AttributeCompletionFactory.ts @@ -0,0 +1,40 @@ +import { + CompletionItem, + CompletionItemKind, + InsertTextFormat, + MarkedString } from 'vscode-languageserver-types'; +import { autoinject } from 'aurelia-dependency-injection'; +import ElementLibrary from './Library/_elementLibrary'; +import { GlobalAttributes } from './Library/_elementStructure'; +import BaseAttributeCompletionFactory from './BaseAttributeCompletionFactory'; +import AureliaSettings from './../AureliaSettings'; + +@autoinject() +export default class AureliaAttributeCompletionFactory extends BaseAttributeCompletionFactory { + + constructor(library: ElementLibrary, private settings: AureliaSettings) { super(library); } + + public create(elementName: string, existingAttributes: Array): Array { + + let result:Array = []; + let element = this.getElement(elementName); + + if (element.hasGlobalAttributes) { + this.addAttributes(GlobalAttributes.attributes, result, existingAttributes, this.settings.quote); + } + + if (element.attributes) { + this.addAttributes(element.attributes, result, existingAttributes, this.settings.quote); + } + + if (element.hasGlobalEvents) { + this.addEvents(GlobalAttributes.events, result, existingAttributes, this.settings.quote); + } + + if (element.events) { + this.addEvents(element.events, result, existingAttributes, this.settings.quote); + } + + return result; + } +} diff --git a/src/server/Completions/AttributeValueCompletionFactory.ts b/src/server/Completions/AttributeValueCompletionFactory.ts new file mode 100644 index 00000000..c6f1d830 --- /dev/null +++ b/src/server/Completions/AttributeValueCompletionFactory.ts @@ -0,0 +1,42 @@ +import { + CompletionItem, + CompletionItemKind, + InsertTextFormat } from 'vscode-languageserver-types'; +import { autoinject } from 'aurelia-dependency-injection'; +import ElementLibrary from './Library/_elementLibrary'; +import { GlobalAttributes } from './Library/_elementStructure'; +import BaseAttributeCompletionFactory from './BaseAttributeCompletionFactory'; + +@autoinject() +export default class AttributeCompletionFactory extends BaseAttributeCompletionFactory { + + constructor(library: ElementLibrary) { super(library); } + + public create(elementName: string, attributeName: string, bindingName: string): Array { + + let result:Array = []; + + if (bindingName === undefined || bindingName === null || bindingName === '') { + let element = this.getElement(elementName); + + let attribute = element.attributes.get(attributeName); + if (!attribute) { + attribute = GlobalAttributes.attributes.get(attributeName); + } + + if (attribute && attribute.values) { + for (let [key, value] of attribute.values.entries()) { + result.push({ + documentation: value.documentation, + insertText: key, + insertTextFormat: InsertTextFormat.Snippet, + kind: CompletionItemKind.Property, + label: key, + }); + } + } + } + + return result; + } +} diff --git a/src/server/Completions/BaseAttributeCompletionFactory.ts b/src/server/Completions/BaseAttributeCompletionFactory.ts new file mode 100644 index 00000000..23324c0f --- /dev/null +++ b/src/server/Completions/BaseAttributeCompletionFactory.ts @@ -0,0 +1,106 @@ +import { + CompletionItem, + CompletionItemKind, + InsertTextFormat, + MarkedString } from 'vscode-languageserver-types'; +import { autoinject } from 'aurelia-dependency-injection'; +import ElementLibrary from './Library/_elementLibrary'; +import { BaseElement, SimpleAttribute, BindableAttribute, EmptyAttribute } from './Library/_elementStructure'; + +@autoinject() +export default class BaseAttributeCompletionFactory { + + constructor(protected library: ElementLibrary) { } + + protected getElement(elementName: string) : BaseElement { + let element = this.library.elements[elementName]; + if (!element) { + element = this.library.unknownElement; + } + return element; + } + + protected addAttributes(attributes, result: CompletionItem[], existingAttributes, quote: string) { + + for (let [key, value] of attributes.entries()) { + if (existingAttributes.filter(i => i === key).length || value === null) { + continue; + } + + // remove duplicates (only leave latest addition) + for(let item of result.filter(i => + i.label === key || + i.label === (value.customLabel === null ? (key + '.bind') : value.customLabel))) { + let index = result.indexOf(item, 0); + if (index > -1) { + result.splice(index, 1); + } + } + + if (value instanceof BindableAttribute) { + result.push({ + documentation: MarkedString.fromPlainText(value.documentation).toString(), + detail: 'Bindable Attribute', + insertText: value.customBindingSnippet === null ? `${key}.bind=${quote}$0${quote}`: value.customBindingSnippet.replace('"', quote), + insertTextFormat: InsertTextFormat.Snippet, + kind: CompletionItemKind.Value, + label: value.customLabel === null ? (key + '.bind') : value.customLabel, + }); + } + + if (value instanceof EmptyAttribute) { + result.push({ + detail: 'Empty Custom Attribute', + documentation: MarkedString.fromPlainText(value.documentation).toString(), + insertText: `${key}`, + insertTextFormat: InsertTextFormat.PlainText, + kind: CompletionItemKind.Property, + label: key, + }); + } + + if (value instanceof SimpleAttribute || value instanceof BindableAttribute) { + result.push({ + documentation: MarkedString.fromPlainText(value.documentation).toString(), + detail: 'Attribute', + insertText: `${key}=${quote}$0${quote}`, + insertTextFormat: InsertTextFormat.Snippet, + kind: CompletionItemKind.Property, + label: key, + }); + } + } + return result; + } + + protected addEvents(events, result, existingAttributes, quote: string) { + + for (let [key, value] of events.entries()) { + + if (existingAttributes.filter(i => i === key).length || value === null) { + continue; + } + + // remove exiting items that are doubles + for(let item of result.filter(i => + i.label === key || + i.label === key + (value.bubbles ? `.delegate` : `.trigger`))) { + let index = result.indexOf(item, 0); + if (index > -1) { + result.splice(index, 1); + } + } + + result.push({ + documentation: value.documentation, + detail: 'Event', + insertText: value.bubbles ? `${key}.delegate=${quote}$0${quote}` : `${key}.trigger=${quote}$0${quote}`, + insertTextFormat: InsertTextFormat.Snippet, + kind: CompletionItemKind.Function, + label: key + (value.bubbles ? `.delegate` : `.trigger`), + }); + } + + return result; + } +} diff --git a/src/server/Completions/BindingCompletionFactory.ts b/src/server/Completions/BindingCompletionFactory.ts new file mode 100644 index 00000000..29cc6268 --- /dev/null +++ b/src/server/Completions/BindingCompletionFactory.ts @@ -0,0 +1,101 @@ +import { + CompletionItem, + CompletionItemKind, + InsertTextFormat, MarkedString } from 'vscode-languageserver-types'; +import { autoinject } from 'aurelia-dependency-injection'; +import ElementLibrary from './Library/_elementLibrary'; +import { TagDefinition, AttributeDefinition } from './../DocumentParser'; +import BaseAttributeCompletionFactory from './BaseAttributeCompletionFactory'; +import { GlobalAttributes } from './Library/_elementStructure'; +import AureliaSettings from './../AureliaSettings'; + +@autoinject() +export default class BindingCompletionFactory extends BaseAttributeCompletionFactory { + + constructor(library: ElementLibrary, private settings: AureliaSettings) { super(library); } + + public create(tagDef: TagDefinition, attributeDef: AttributeDefinition, nextChar: string): Array { + + let snippetPrefix = nextChar === '=' ? '' : `=${this.settings.quote}$0${this.settings.quote}`; + let result: Array = []; + + let element = this.getElement(tagDef.name); + if (!element.events.get(attributeDef.name) && !GlobalAttributes.events.get(attributeDef.name)) { + this.setAttributes(element.attributes, attributeDef.name, snippetPrefix, result); + } + + this.setEvents(element.events, attributeDef.name, snippetPrefix, result); + + return result; + } + + private setEvents(events, name, snippetPrefix, result) { + let event = events.get(name); + if (!event) { + event = GlobalAttributes.events.get(name); + } + + if (event) { + if (event.bubbles) { + for(let binding of ['delegate', 'capture']) { + result.push({ + documentation: binding, + insertText: binding + snippetPrefix, + insertTextFormat: InsertTextFormat.Snippet, + kind: CompletionItemKind.Property, + label: `.${binding}=${this.settings.quote}${this.settings.quote}` + }); + } + } + + for (let binding of ['trigger', 'call']) { + result.push({ + documentation: binding, + insertText: binding + snippetPrefix, + insertTextFormat: InsertTextFormat.Snippet, + kind: CompletionItemKind.Property, + label: `.${binding}=${this.settings.quote}${this.settings.quote}` + }); + } + } + } + + private setAttributes(attributes, name, snippetPrefix, result) { + let attribute = attributes.get(name); + if (!attribute) { + attribute = GlobalAttributes.attributes.get(name); + } + + let bindings = this.getDefaultDataBindings(); + for(let binding of bindings) { + result.push({ + documentation: binding.documentation, + insertText: `${binding.name}${snippetPrefix}`, + insertTextFormat: InsertTextFormat.Snippet, + kind: CompletionItemKind.Property, + label: `.${binding.name}=${this.settings.quote}${this.settings.quote}` + }); + } + } + + private getDefaultDataBindings() { + return [ + { + name: 'bind', + documentation: 'automatically chooses the binding mode. Uses two-way binding for form controls and one-way binding for almost everything else' + }, + { + name: 'one-way', + documentation: 'flows data one direction: from the view-model to the view' + }, + { + name: 'two-way', + documentation: 'flows data both ways: from view-model to view and from view to view-model' + }, + { + name: 'one-time', + documentation: 'flows data one direction: from the view-model to the view, only one' + }, + ]; + } +} diff --git a/src/server/Completions/ElementCompletionFactory.ts b/src/server/Completions/ElementCompletionFactory.ts new file mode 100644 index 00000000..1c14eb2a --- /dev/null +++ b/src/server/Completions/ElementCompletionFactory.ts @@ -0,0 +1,68 @@ +import { + CompletionItem, + CompletionItemKind, + InsertTextFormat, MarkedString } from 'vscode-languageserver-types'; +import { autoinject } from 'aurelia-dependency-injection'; +import ElementLibrary from './Library/_elementLibrary'; +import { MozDocElement } from './Library/_elementStructure'; + +@autoinject() +export default class ElementCompletionFactory { + + constructor(private library: ElementLibrary) { } + + public create(parent: string): Array { + + let result: Array = []; + if (parent) { + let previousElement = this.library.elements[parent]; + if (previousElement) { + result.push({ + documentation: MarkedString.fromPlainText(previousElement.documentation).toString(), + detail: 'HTMLElement', + insertText: '/' + parent + '>', + insertTextFormat: InsertTextFormat.PlainText, + kind: CompletionItemKind.Property, + label: ``, + filterText: `/${parent}>` + }); + } + } + + if (parent) { + let parentElementDef = this.library.elements[parent]; + if (parentElementDef.permittedChildren && parentElementDef.permittedChildren.length) { + for(let childName of parentElementDef.permittedChildren) { + result.push({ + documentation: MarkedString.fromPlainText(this.library.elements[childName].documentation).toString(), + detail: 'HTMLElement', + insertText: childName + '>', + insertTextFormat: InsertTextFormat.PlainText, + kind: CompletionItemKind.Property, + label: `<${childName}>`, + filterText: `${childName}>` + }); + } + return result; + } + } + + for(let name in this.library.elements) { + let item = this.library.elements[name]; + // if (item instanceof MozDocElement && item.permittedParents.length) { + // continue; + // } + result.push({ + documentation: MarkedString.fromPlainText(item.documentation).toString(), + detail: 'HTMLElement', + insertText: name + '>', + insertTextFormat: InsertTextFormat.PlainText, + kind: CompletionItemKind.Property, + label: `<${name}>`, + filterText: `${name}>` + }); + } + + return result; + } +} diff --git a/src/server/Completions/EmmetCompletionFactory.ts b/src/server/Completions/EmmetCompletionFactory.ts new file mode 100644 index 00000000..ca8cf751 --- /dev/null +++ b/src/server/Completions/EmmetCompletionFactory.ts @@ -0,0 +1,37 @@ +import { + CompletionItem, + CompletionItemKind, + InsertTextFormat, + MarkedString } from 'vscode-languageserver-types'; +import { autoinject } from 'aurelia-dependency-injection'; +import ElementLibrary from './Library/_elementLibrary'; +import { GlobalAttributes } from './Library/_elementStructure'; +import BaseAttributeCompletionFactory from './BaseAttributeCompletionFactory'; +import AureliaSettings from './../AureliaSettings'; + +@autoinject() +export default class EmmetCompletionFactory extends BaseAttributeCompletionFactory { + + constructor(library: ElementLibrary, private settings: AureliaSettings) { super(library); } + + public create(elementName: string): Array { + let result:Array = []; + let element = this.getElement(elementName); + + if (element.hasGlobalAttributes) { + this.addAttributes(GlobalAttributes.attributes, result, [], this.settings.quote); + } + if (element.attributes) { + this.addAttributes(element.attributes, result, [], this.settings.quote); + } + + if (element.hasGlobalEvents) { + this.addEvents(GlobalAttributes.events, result, [], this.settings.quote); + } + if (element.events) { + this.addEvents(element.events, result, [], this.settings.quote); + } + + return result; + } +} diff --git a/src/server/Completions/Library/_Element.ts b/src/server/Completions/Library/_Element.ts new file mode 100644 index 00000000..46fd35cc --- /dev/null +++ b/src/server/Completions/Library/_Element.ts @@ -0,0 +1,14 @@ +import { BindableAttribute, BaseElement } from './_elementStructure'; + +export default class _Element extends BaseElement { + + public documentation = ``; + + + constructor() { + super(); + this.url =''; + this.attributes.set('', + new BindableAttribute(``)); + } +} diff --git a/src/server/Completions/Library/_elementLibrary.ts b/src/server/Completions/Library/_elementLibrary.ts new file mode 100644 index 00000000..12ed25a9 --- /dev/null +++ b/src/server/Completions/Library/_elementLibrary.ts @@ -0,0 +1,239 @@ +import { singleton } from 'aurelia-dependency-injection'; +import AElement from './aElement'; +import AbbrElement from './abbrElement'; +import InputElement from './inputElement'; +import ComposeElement from './composeElement'; +import AddressElement from './addressElement'; +import AreaElement from './areaElement'; +import ArticleElement from './articleElement'; +import AsideElement from './asideElement'; +import AudioElement from './audioElement'; +import BElement from './bElement'; +import BaseElement from './baseElement'; +import BdiElement from './bdiElement'; +import BdoElement from './bdoElement'; +import BlockquoteElement from './blockquoteElement'; +import BodyElement from './bodyElement'; +import BrElement from './brElement'; +import ButtonElement from './buttonElement'; +import CanvasElement from './canvasElement'; +import CaptionElement from './captionElement'; +import CiteElement from './citeElement'; +import CodeElement from './codeElement'; +import ColElement from './colElement'; +import ColgroupElement from './colgroupElement'; +import DataElement from './dataElement'; +import DatalistElement from './datalistElement'; +import DdElement from './ddElement'; +import DelElement from './delElement'; +import DetailsElement from './detailsElement'; +import DfnElement from './dfnElement'; +import DivElement from './divElement'; +import DlElement from './dlElement'; +import DtElement from './dtElement'; +import EmElement from './emElement'; +import EmbedElement from './embedElement'; +import FieldsetElement from './fieldsetElement'; +import FigcaptonElement from './figcaptionElement'; +import FigureElement from './figureElement'; +import FooterElement from './footerElement'; +import FormElement from './formElement'; +import HElement from './hElement'; +import HeadElement from './headElement'; +import HeaderElement from './headerElement'; +import HrElement from './hrElement'; +import HtmlElement from './htmlElement'; +import IElement from './iElement'; +import IframeElement from './iframeElement'; +import ImgElement from './imgElement'; +import InsElement from './insElement'; +import KdbElement from './kdbElement'; +import LabelElement from './labelElement'; +import LegendElement from './legendElement'; +import LiElement from './liElement'; +import LinkElement from './linkElement'; +import MainElement from './mainElement'; +import MapElement from './mapElement'; +import MarkElement from './markElement'; +import MetaElement from './metaElement'; +import MeterElement from './meterElement'; +import NavElement from './navElement'; +import NoFramesElement from './noframesElement'; +import NoScriptElement from './noScriptElement'; +import ObjectElement from './objectElement'; +import OlElement from './olElement'; +import OptGroupElement from './optgroupElement'; +import OptionElement from './optionElement'; +import OutputElement from './outputElement'; +import PElement from './pElement'; +import ParamElement from './paramElement'; +import PreElement from './preElement'; +import ProgressElement from './progressElement'; +import QElement from './qElement'; +import RpElement from './rpElement'; +import RtElement from './rtElement'; +import RtcElement from './rtcElement'; +import RubyElement from './rubyElement'; +import SElement from './sElement'; +import SampElement from './sampElement'; +import ScriptElement from './scriptElement'; +import SectionElement from './sectionElement'; +import SelectElement from './selectElement'; +import SlotElement from './slotElement'; +import SmallElement from './smallElement'; +import SourceElement from './sourceElement'; +import SpanElement from './spanElement'; +import StrongElement from './strongElement'; +import StyleElement from './styleElement'; +import SubElement from './subElement'; +import SummaryElement from './summaryElement'; +import SupElement from './supElement'; +import TableElement from './tableElement'; +import TBodyElement from './tbodyElement'; +import TdElement from './tdElement'; +import TemplateElement from './templateElement'; +import TextareaElement from './textareaElement'; +import TfootElement from './tfootElement'; +import ThElement from './thElement'; +import TheadElement from './theadElement'; +import TimeElement from './timeElement'; +import TitleElement from './titleElement'; +import TrElement from './trElement'; +import TrackElement from './trackElement'; +import UElement from './uElement'; +import UlElement from './ulElement'; +import VarElement from './varElement'; +import VideoElement from './videoElement'; +import WbrElement from './wbrElement'; +import UnknownElement from './unknownElement'; + +import RequireElement from './requireElement'; + +@singleton() +export default class ElementLibrary { + + public elements = {}; + + public unknownElement = new UnknownElement(); + + constructor() { + this.elements['a'] = new AElement(); + this.elements['abbr'] = new AbbrElement(); + this.elements['address'] = new AddressElement(); + this.elements['area'] = new AreaElement(); + this.elements['article'] = new ArticleElement(); + this.elements['aside'] = new AsideElement(); + this.elements['audio'] = new AudioElement(); + this.elements['b'] = new BElement(); + this.elements['base'] = new BaseElement(); + this.elements['bdi'] = new BdiElement(); + this.elements['bdo'] = new BdoElement(); + this.elements['blockquote'] = new BlockquoteElement(); + this.elements['body'] = new BodyElement(); + this.elements['br'] = new BrElement(); + this.elements['button'] = new ButtonElement(); + this.elements['canvas'] = new CanvasElement(); + this.elements['caption'] = new CaptionElement(); + this.elements['cite'] = new CiteElement(); + this.elements['code'] = new CodeElement(); + this.elements['col'] = new ColElement(); + this.elements['colgroup'] = new ColgroupElement(); + this.elements['data'] = new DataElement(); + this.elements['datalist'] = new DatalistElement(); + this.elements['dd'] = new DdElement(); + this.elements['del'] = new DelElement(); + this.elements['details'] = new DetailsElement(); + this.elements['dfn'] = new DfnElement(); + this.elements['div'] = new DivElement(); + this.elements['dl'] = new DlElement(); + this.elements['dt'] = new DtElement(); + this.elements['em'] = new EmElement(); + this.elements['embed'] = new EmbedElement(); + this.elements['fieldset'] = new FieldsetElement(); + this.elements['figcaption'] = new FigcaptonElement(); + this.elements['figure'] = new FigureElement(); + this.elements['footer'] = new FooterElement(); + this.elements['form'] = new FormElement(); + let header = new HElement(); + this.elements['h1'] = header; + this.elements['h2'] = header; + this.elements['h3'] = header; + this.elements['h4'] = header; + this.elements['h5'] = header; + this.elements['h6'] = header; + this.elements['head'] = new HeadElement(); + this.elements['header'] = new HeaderElement(); + this.elements['hr'] = new HrElement(); + this.elements['html'] = new HtmlElement(); + this.elements['i'] = new IElement(); + this.elements['iframe'] = new IframeElement(); + this.elements['img'] = new ImgElement(); + this.elements['input'] = new InputElement(); + this.elements['ins'] = new InsElement(); + this.elements['kdb'] = new KdbElement(); + this.elements['label'] = new LabelElement(); + this.elements['legend'] = new LegendElement(); + this.elements['li'] = new LiElement(); + this.elements['link'] = new LinkElement(); + this.elements['main'] = new MainElement(); + this.elements['map'] = new MapElement(); + this.elements['mark'] = new MarkElement(); + this.elements['meta'] = new MetaElement(); + this.elements['meter'] = new MeterElement(); + this.elements['nav'] = new NavElement(); + this.elements['noframes'] = new NoFramesElement(); + this.elements['noscript'] = new NoScriptElement(); + this.elements['object'] = new ObjectElement(); + this.elements['ol'] = new OlElement(); + this.elements['optgroup'] = new OptGroupElement(); + this.elements['option'] = new OptionElement(); + this.elements['output'] = new OutputElement(); + this.elements['p'] = new PElement(); + this.elements['param'] = new ParamElement(); + this.elements['pre'] = new PreElement(); + this.elements['progress'] = new ProgressElement(); + this.elements['q'] = new QElement(); + this.elements['rp'] = new RpElement(); + this.elements['rt'] = new RtElement(); + this.elements['rtc'] = new RtcElement(); + this.elements['ruby'] = new RubyElement(); + this.elements['s'] = new SElement(); + this.elements['samp'] = new SampElement(); + this.elements['script'] = new ScriptElement(); + this.elements['section'] = new SectionElement(); + this.elements['select'] = new SelectElement(); + this.elements['slot'] = new SlotElement(); + this.elements['small'] = new SmallElement(); + this.elements['source'] = new SourceElement(); + this.elements['span'] = new SpanElement(); + this.elements['strong'] = new StrongElement(); + this.elements['style'] = new StyleElement(); + this.elements['sub'] = new SubElement(); + this.elements['summary'] = new SummaryElement(); + this.elements['sup'] = new SupElement(); + this.elements['table'] = new TableElement(); + this.elements['tbody'] = new TBodyElement(); + this.elements['td'] = new TdElement(); + this.elements['template'] = new TemplateElement(); + this.elements['textarea'] = new TextareaElement(); + this.elements['tfoot'] = new TfootElement(); + this.elements['th'] = new ThElement(); + this.elements['thead'] = new TheadElement(); + this.elements['time'] = new TimeElement(); + this.elements['title'] = new TitleElement(); + this.elements['tr'] = new TrElement(); + this.elements['track'] = new TrackElement(); + this.elements['u'] = new UElement(); + this.elements['ul'] = new UlElement(); + this.elements['var'] = new VarElement(); + this.elements['video'] = new VideoElement(); + this.elements['wbr'] = new WbrElement(); + + + this.elements['compose'] = new ComposeElement(); + this.elements['require'] = new RequireElement(); + + + } +} + diff --git a/src/server/Completions/Library/_elementStructure.ts b/src/server/Completions/Library/_elementStructure.ts new file mode 100644 index 00000000..12657392 --- /dev/null +++ b/src/server/Completions/Library/_elementStructure.ts @@ -0,0 +1,808 @@ +export class Value { + constructor(public documentation: string = '') { + + } +} + +class BaseAttribute { + constructor( + public documentation: string, + public url: string, + public customLabel: string = null, + public values: Map = new Map()) { } +} + +export class SimpleAttribute extends BaseAttribute { + constructor( + documentation: string, + url: string = null, + customLabel: string = null, + values: Map = new Map()) { + super(documentation, url, customLabel, values); + } +} + +export class EmptyAttribute extends BaseAttribute { + constructor( + documentation: string, + url: string = null, + customLabel: string = null) { + super(documentation, url, customLabel); + } +} + +export class BindableAttribute extends BaseAttribute { + constructor( + documentation: string, + url: string = null, + public customSnippet: string = null, + public customBindingSnippet: string = null, + customLabel: string = null, + values: Map = new Map()) { + super(documentation, url, customLabel, values); + } +} + +export class Event { + constructor( + public documentation: string, + public url: string = null, + public bubbles: boolean = false, + public cancelable: boolean = false + ) { } +} + +export class GlobalAttributes { + public static attributes: Map = new Map([ + [ + 'accesskey', + new BindableAttribute(`Provides a hint for generating a keyboard shortcut for the current element. This attribute consists of a space-separated list of characters. The browser should use the first one that exists on the computer keyboard layout.`, + 'https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/accesskey') + ], + [ + 'class', + new BindableAttribute(`Is a space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method Document.getElementsByClassName().`, + 'https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class') + ], + [ + 'contenteditable', + new BindableAttribute(`Is an enumerated attribute indicating if the element should be editable by the user. If so, the browser modifies its widget to allow editing.`, + 'https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/contenteditable', + null, + null, + null, + new Map([ + ['true', new Value(`or the empty string, which indicates that the element must be editable.`)], + ['fase', new Value(`indicates that the element must not be editable.`)] + ]) + ) + ], + [ + 'contextmenu', + new BindableAttribute(`Is the id of an (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/menu) to use as the contextual menu for this element.`, + 'https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/contextmenu') + ], + [ + 'data-*', + new BindableAttribute(`Forms a class of attributes, called custom data attributes, that allow proprietary information to be exchanged between the HTML and its DOM representation that may be used by scripts. All such custom data are available via the HTMLElement interface of the element the attribute is set on. The HTMLElement.dataset property gives access to them.`, + 'https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/data-*', + 'data-$1="$0"', + 'data-$1.bind="$0"') + ], + ['dir', + new BindableAttribute(`Is an enumerated attribute indicating the directionality of the element's text.`, + 'https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir', + null, + null, + null, + new Map([ + ['ltr', new Value(`means left to right and is to be used for languages that are written from the left to the right (like English)`)], + ['rtl', new Value(`means right to left and is to be used for languages that are written from the right to the left (like Arabic)`)], + ['auto', new Value(`let the user agent decides. It uses a basic algorithm as it parses the characters inside the element until it finds a character with a strong directionality, then apply that directionality to the whole element.`)], + ]) + )], + [ + 'hidden', + new BindableAttribute(`Is a Boolean attribute indicates that the element is not yet, or is no longer, relevant. For example, it can be used to hide elements of the page that can't be used until the login process has been completed. The browser won't render such elements. This attribute must not be used to hide content that could legitimately be shown.`, + 'https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/hidden') + ], + [ + 'id', + new BindableAttribute(`Defines a unique identifier (ID) which must be unique in the whole document. Its purpose is to identify the element when linking (using a fragment identifier), scripting, or styling (with CSS).`, + 'https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id') + ], + [ + 'lang', + new BindableAttribute(`Participates in defining the language of the element, the language that non-editable elements are written in or the language that editable elements should be written in. The tag contains one single entry value in the format defines in the Tags for Identifying Languages (BCP47) IETF document. xml:lang has priority over it.`, + 'https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang') + ], + + [ + 'slot', + new BindableAttribute(`Assigns a slot in a shadow DOM shadow tree to an element: An element with a slot attribute is assigned to the slot created by the element whose name attribute's value matches that slot attribute's value.`, + 'https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/slot') + ], + [ + 'style', + new BindableAttribute(`Contains CSS styling declarations to be applied to the element. Note that it is recommended for styles to be defined in a separate file or files. This attribute and the