From 902c948f092cdc8ace3ebac3cc5fced8422c89e1 Mon Sep 17 00:00:00 2001 From: Erik Lieben Date: Sat, 5 Nov 2016 14:10:47 +0100 Subject: [PATCH] style(tslint): resolve all tslint errors/ warnings --- dist/src/client/main.js | 4 +- dist/src/client/main.js.map | 2 +- .../aureliaLanguageService.js | 2 +- .../aureliaLanguageService.js.map | 2 +- .../parser/aureliaTagProvider.js | 13 +- .../parser/aureliaTagProvider.js.map | 2 +- .../parser/aureliaTags.js | 8 +- .../parser/aureliaTags.js.map | 2 +- .../parser/htmlParser.js | 30 +- .../parser/htmlParser.js.map | 2 +- .../parser/htmlScanner.js | 17 +- .../parser/htmlScanner.js.map | 2 +- .../parser/models.js.map | 2 +- .../services/htmlCompletion.js | 31 +- .../services/htmlCompletion.js.map | 2 +- .../services/htmlValidation.js | 24 +- .../services/htmlValidation.js.map | 2 +- dist/src/server/languageModelCache.js | 13 +- dist/src/server/languageModelCache.js.map | 2 +- dist/src/server/main.js | 4 +- dist/src/server/main.js.map | 2 +- src/client/main.ts | 48 +- .../aureliaLanguageService.ts | 22 +- .../parser/aureliaTagProvider.ts | 44 +- .../parser/aureliaTags.ts | 36 +- .../parser/htmlParser.ts | 279 +++--- .../parser/htmlScanner.ts | 848 +++++++++--------- .../aurelia-languageservice/parser/models.ts | 14 +- .../services/htmlCompletion.ts | 290 +++--- .../services/htmlValidation.ts | 205 ++--- src/server/languageModelCache.ts | 140 +-- src/server/main.ts | 30 +- test/syntax.html/as-element.test.ts | 22 +- test/syntax.html/databinding.test.ts | 6 +- test/syntax.html/if.test.ts | 2 +- test/syntax.html/invoke.test.ts | 4 +- test/syntax.html/replace-part.test.ts | 22 +- test/syntax.html/replaceable.test.ts | 4 +- test/syntax.html/route-href.test.ts | 4 +- test/syntax.html/show.test.ts | 4 +- test/syntax.html/test.utils.ts | 6 +- test/syntax.html/view-model.test.ts | 6 +- test/syntax.html/view.test.ts | 8 +- tslint.json | 3 +- 44 files changed, 1135 insertions(+), 1080 deletions(-) diff --git a/dist/src/client/main.js b/dist/src/client/main.js index 82653b40..bb972707 100644 --- a/dist/src/client/main.js +++ b/dist/src/client/main.js @@ -14,8 +14,8 @@ function activate(context) { 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 }, - debug: { module: serverModule, transport: vscode_languageclient_1.TransportKind.ipc, options: debugOptions } }; const clientOptions = { diagnosticCollectionName: 'Aurelia', @@ -23,7 +23,7 @@ function activate(context) { initializationOptions: {}, synchronize: { configurationSection: ['aurelia'], - } + }, }; const client = new vscode_languageclient_1.LanguageClient('html', 'Aurelia', serverOptions, clientOptions); const disposable = client.start(); diff --git a/dist/src/client/main.js.map b/dist/src/client/main.js.map index 4118e122..6176b754 100644 --- a/dist/src/client/main.js.map +++ b/dist/src/client/main.js.map @@ -1 +1 @@ -{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../src/client/main.ts"],"names":[],"mappings":";AAAA,MAAY,IAAI,WAAM,MAAM,CAAC,CAAA;AAC7B,yBAAmE,QAAQ,CAAC,CAAA;AAC5E,wCAAoF,uBAAuB,CAAC,CAAA;AAC5G,qCAA+B,sBAAsB,CAAC,CAAA;AAEtD,IAAI,aAA4B,CAAC;AAEjC,kBAAyB,OAAyB;IAEjD,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;IAE/E,mCAAmC;IACnC,MAAM,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,I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AAa,CAAC,CAAC;IAE1C,wBAAwB;IACxB,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,4BAAkB,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC,CAAC;IAE/E,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;AA7Be,gBAAQ,WA6BvB,CAAA"} \ No newline at end of file diff --git a/dist/src/server/aurelia-languageservice/aureliaLanguageService.js b/dist/src/server/aurelia-languageservice/aureliaLanguageService.js index 3a413f46..7ec30aec 100644 --- a/dist/src/server/aurelia-languageservice/aureliaLanguageService.js +++ b/dist/src/server/aurelia-languageservice/aureliaLanguageService.js @@ -7,7 +7,7 @@ function getLanguageService() { return { doComplete: htmlCompletion_1.doComplete, doValidation: validation.doValidation.bind(validation), - parseHTMLDocument: document => htmlParser_1.parse(document.getText()) + parseHTMLDocument: document => htmlParser_1.parse(document.getText()), }; } exports.getLanguageService = getLanguageService; diff --git a/dist/src/server/aurelia-languageservice/aureliaLanguageService.js.map b/dist/src/server/aurelia-languageservice/aureliaLanguageService.js.map index 0dd39f3e..1ad75388 100644 --- a/dist/src/server/aurelia-languageservice/aureliaLanguageService.js.map +++ b/dist/src/server/aurelia-languageservice/aureliaLanguageService.js.map @@ -1 +1 @@ -{"version":3,"file":"aureliaLanguageService.js","sourceRoot":"","sources":["../../../../src/server/aurelia-languageservice/aureliaLanguageService.ts"],"names":[],"mappings":";AAAA,6BAAsB,qBAAqB,CAAC,CAAA;AAC5C,iCAA2B,2BAA2B,CAAC,CAAA;AACvD,iCAA+B,2BAA2B,CAAC,CAAA;AAoB3D;IACC,MAAM,UAAU,GAAG,IAAI,+BAAc,EAAE,CAAC;IACxC,MAAM,CAAC;QACN,uCAAU;QACV,YAAY,EAAE,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC;QACtD,iBAAiB,EAAE,QAAQ,IAAI,kBAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;KACxD,CAAC;AACH,CAAC;AAPe,0BAAkB,qBAOjC,CAAA"} \ No newline at end of file +{"version":3,"file":"aureliaLanguageService.js","sourceRoot":"","sources":["../../../../src/server/aurelia-languageservice/aureliaLanguageService.ts"],"names":[],"mappings":";AAAA,6BAAsB,qBAAqB,CAAC,CAAA;AAC5C,iCAA2B,2BAA2B,CAAC,CAAA;AACvD,iCAA+B,2BAA2B,CAAC,CAAA;AAoB3D;IACE,MAAM,UAAU,GAAG,IAAI,+BAAc,EAAE,CAAC;IACxC,MAAM,CAAC;QACL,uCAAU;QACV,YAAY,EAAE,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC;QACtD,iBAAiB,EAAE,QAAQ,IAAI,kBAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;KACzD,CAAC;AACJ,CAAC;AAPe,0BAAkB,qBAOjC,CAAA"} \ No newline at end of file diff --git a/dist/src/server/aurelia-languageservice/parser/aureliaTagProvider.js b/dist/src/server/aurelia-languageservice/parser/aureliaTagProvider.js index e14fd1f9..45bd1282 100644 --- a/dist/src/server/aurelia-languageservice/parser/aureliaTagProvider.js +++ b/dist/src/server/aurelia-languageservice/parser/aureliaTagProvider.js @@ -2,9 +2,6 @@ const aureliaTags_1 = require('./aureliaTags'); function getAureliaTagProvider() { return { - getId: () => 'aurelia', - isApplicable: (languageId) => languageId === 'html', - collectTags: (collector) => collectTagsDefault(collector, aureliaTags_1.AURELIA_TAGS), collectAttributes: (tag, collector) => { if (tag) { let tagWithAttributes = aureliaTags_1.AURELIA_TAGS[tag]; @@ -24,8 +21,12 @@ function getAureliaTagProvider() { } } }, + 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; @@ -44,7 +45,9 @@ function addAttributes(attributes, collector) { } function collectTagsDefault(collector, tagSet) { for (let tag in tagSet) { - collector(tag, tagSet[tag].label); + if (tagSet.hasOwnProperty(tag)) { + collector(tag, tagSet[tag].label); + } } } //# sourceMappingURL=aureliaTagProvider.js.map \ No newline at end of file diff --git a/dist/src/server/aurelia-languageservice/parser/aureliaTagProvider.js.map b/dist/src/server/aurelia-languageservice/parser/aureliaTagProvider.js.map index 5fd7a570..d9f2b80b 100644 --- a/dist/src/server/aurelia-languageservice/parser/aureliaTagProvider.js.map +++ b/dist/src/server/aurelia-languageservice/parser/aureliaTagProvider.js.map @@ -1 +1 @@ -{"version":3,"file":"aureliaTagProvider.js","sourceRoot":"","sources":["../../../../../src/server/aurelia-language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OAAO,CAAC,CAAC,CAAC;YACvB,SAAS,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACjC,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC,CAAC;YACvC,SAAS,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAClC,CAAC;QAED,EAAE,CAAC,CAAC,SAAS,CAAC,YAAY,IAAI,SAAS,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;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,MAAe;IAC3F,GAAG,CAAC,CAAC,IAAI,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC;QACxB,SAAS,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;AACF,CAAC"} \ No newline at end of file +{"version":3,"file":"aureliaTagProvider.js","sourceRoot":"","sources":["../../../../../src/server/aurelia-languageservice/parser/aureliaTagProvider.ts"],"names":[],"mappings":";AACA,8BAA4F,eAAe,CAAC,CAAA;AAG5G;IACE,MAAM,CAAC;QACL,iBAAiB,EAAE,CAAC,GAAW,EAAE,SAAoD;YACnF,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;gBACR,IAAI,iBAAiB,GAAG,0BAAY,CAAC,GAAG,CAAC,CAAC;gBAC1C,IAAI,UAAU,GAAG,gCAAkB,CAAC,GAAG,CAAC,CAAC;gBAEzC,EAAE,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC;oBACtB,aAAa,CAAC,iBAAiB,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;gBACzD,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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 index 292e9164..0b948284 100644 --- a/dist/src/server/aurelia-languageservice/parser/aureliaTags.js +++ b/dist/src/server/aurelia-languageservice/parser/aureliaTags.js @@ -13,7 +13,7 @@ exports.AURELIA_TAGS = { 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')]) + new models_1.HTMLAttributeSpecification('slot')]), }; const defaultBindings = ['bind', 'one-way', 'two-way', 'one-time']; exports.AURELIA_ATTRIBUTES = { @@ -22,12 +22,12 @@ exports.AURELIA_ATTRIBUTES = { '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) + 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) + new models_1.HTMLAttributeSpecification('model', defaultBindings, true, false), ], 'template': [ new models_1.HTMLAttributeSpecification('replaceable', [], false, false), @@ -36,7 +36,7 @@ exports.AURELIA_ATTRIBUTES = { 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)] + 'slot': [new models_1.HTMLAttributeSpecification('name', defaultBindings, true, true)], }; exports.AURELIA_GLOBAL_ATTRIBUTES = [ new models_1.HTMLAttributeSpecification('repeat.for', [], true, false), diff --git a/dist/src/server/aurelia-languageservice/parser/aureliaTags.js.map b/dist/src/server/aurelia-languageservice/parser/aureliaTags.js.map index 59dd01c3..81a08ee4 100644 --- a/dist/src/server/aurelia-languageservice/parser/aureliaTags.js.map +++ b/dist/src/server/aurelia-languageservice/parser/aureliaTags.js.map @@ -1 +1 @@ -{"version":3,"file":"aureliaTags.js","sourceRoot":"","sources":["../../../../../src/server/aurelia-languageservice/parser/aureliaTags.ts"],"names":[],"mappings":";AAAA,yBAAoG,UAAU,CAAC,CAAA;AAElG,oBAAY,GAAY;IACnC,SAAS,EAAG,IAAI,6BAAoB,CAAC,gGAAgG,EAAE;QACrI,IAAI,mCAA0B,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC;QACvD,IAAI,mCAA0B,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,CAAE,CAAC;IAC1D,aAAa,EAAE,IAAI,6BAAoB,CAAC,oCAAoC,EAAE;QAC5E,IAAI,mCAA0B,CAAC,MAAM,CAAC;QACtC,IAAI,mCAA0B,CAAC,aAAa,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC;QAC9D,IAAI,mCAA0B,CAAE,mBAAmB,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC;QACrE,IAAI,mCAA0B,CAAC,cAAc,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,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B,KAAK,EAAE,YAAY;IACnB,QAAQ,EAAE,YAAY;IACtB,IAAI,EAAE,YAAY;IAClB,UAAU,EAAE,YAAY;IACxB,QAAQ,EAAE,YAAY;IACtB,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,CAAA"} \ No newline at end of file +{"version":3,"file":"aureliaTags.js","sourceRoot":"","sources":["../../../../../src/server/aurelia-languageservice/parser/aureli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AAE,YAAY;IACpB,QAAQ,EAAE,YAAY;IACtB,KAAK,EAAE,YAAY;IACnB,SAAS,EAAE,YAAY;IACvB,KAAK,EAAE,YAAY;IACnB,OAAO,EAAE,YAAY;IACrB,OAAO,EAAE,YAAY;IACrB,IAAI,EAAE,YAAY;IAClB,UAAU,EAAE,YAAY;IACxB,UAAU,EAAE,YAAY;IACxB,OAAO,EAAE,YAAY;IACrB,IAAI,EAAE,YAAY;IAClB,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,YAAY;IACpB,OAAO,EAAE,YAAY;IACrB,IAAI,EAAE,YAAY;IAClB,OAAO,EAAE,YAAY;IACrB,GAAG,EAAE,YAAY;IACjB,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,YAAY;IACnB,OAAO,EAAE,YAAY;IACrB,KAAK,EAAE,YAAY;CACpB,CAAC"} \ No newline at end of file diff --git a/dist/src/server/aurelia-languageservice/parser/htmlParser.js b/dist/src/server/aurelia-languageservice/parser/htmlParser.js index b0ca0d96..509fab17 100644 --- a/dist/src/server/aurelia-languageservice/parser/htmlParser.js +++ b/dist/src/server/aurelia-languageservice/parser/htmlParser.js @@ -45,6 +45,7 @@ function parse(text) { 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); @@ -98,14 +99,15 @@ function parse(text) { curr = curr.parent; } return { - roots: htmlDocument.children, + findNodeAt: htmlDocument.findNodeAt.bind(htmlDocument), findNodeBefore: htmlDocument.findNodeBefore.bind(htmlDocument), - findNodeAt: htmlDocument.findNodeAt.bind(htmlDocument) + roots: htmlDocument.children, }; } exports.parse = parse; function findFirst(array, p) { - let low = 0, high = array.length; + let low = 0; + let high = array.length; if (high === 0) { return 0; // no children } @@ -121,8 +123,10 @@ function findFirst(array, p) { return low; } function binarySearch(array, key, comparator) { - let low = 0, high = array.length - 1; + 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) { @@ -137,7 +141,23 @@ function binarySearch(array, key, comparator) { } return -(low + 1); } -exports.EMPTY_ELEMENTS = ['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'menuitem', 'meta', 'param', 'source', 'track', 'wbr']; +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; } diff --git a/dist/src/server/aurelia-languageservice/parser/htmlParser.js.map b/dist/src/server/aurelia-languageservice/parser/htmlParser.js.map index 308d57e8..b8c513f5 100644 --- a/dist/src/server/aurelia-languageservice/parser/htmlParser.js.map +++ b/dist/src/server/aurelia-languageservice/parser/htmlParser.js.map @@ -1 +1 @@ -{"version":3,"file":"htmlParser.js","sourceRoot":"","sources":["../../../../../src/server/aurelia-languageservice/parser/htmlParser.ts"],"names":[],"mappings":";AAAA,8BAAyC,eAAe,CAAC,CAAA;AAEzD;IAIC,YAAmB,KAAa,EAAS,GAAW,EAAS,QAAgB,EAAS,MAAY;QAA/E,UAAK,GAAL,KAAK,CAAQ;QAAS,QAAG,GAAH,GAAG,CAAQ;QAAS,aAAQ,GAAR,QAAQ,CAAQ;QAAS,WAAM,GAAN,MAAM,CAAM;IAElG,CAAC;IACD,IAAW,UAAU,KAAW,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1D,IAAW,SAAS,KAAW,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM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OAAO;IACP,IAAI;IACJ,KAAK;IACL,OAAO;IACP,QAAQ;IACR,MAAM;IACN,UAAU;IACV,MAAM;IACN,OAAO;IACP,QAAQ;IACR,OAAO;IACP,KAAK,CAAC,CAAC;AAET,wBAAwB,CAAS;IAC/B,MAAM,CAAC,CAAC,IAAI,YAAY,CAAC,sBAAc,EAAE,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,EAAU,EAAE,EAAU,KAAK,EAAE,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACnH,CAAC;AACD,mBAAmB,EAAU,EAAE,EAAU;IACvC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,EAAE,CAAC,WAAW,EAAE,CAAC;AAC3D,CAAC"} \ No newline at end of file diff --git a/dist/src/server/aurelia-languageservice/parser/htmlScanner.js b/dist/src/server/aurelia-languageservice/parser/htmlScanner.js index 9d56e090..f5492688 100644 --- a/dist/src/server/aurelia-languageservice/parser/htmlScanner.js +++ b/dist/src/server/aurelia-languageservice/parser/htmlScanner.js @@ -107,6 +107,7 @@ class MultiLineStream { 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) { @@ -159,7 +160,7 @@ const _TAB = '\t'.charCodeAt(0); })(exports.ScannerState || (exports.ScannerState = {})); var ScannerState = exports.ScannerState; const htmlScriptContents = { - 'text/x-handlebars-template': true + 'text/x-handlebars-template': true, }; function createScanner(input, initialOffset = 0, initialState = ScannerState.WithinContent) { let stream = new MultiLineStream(input, initialOffset); @@ -188,6 +189,7 @@ function createScanner(input, initialOffset = 0, initialState = ScannerState.Wit 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); @@ -200,6 +202,7 @@ function createScanner(input, initialOffset = 0, initialState = ScannerState.Wit return finishToken(offset, TokenType.EOS); } let errorMessage; + // tslint:disable-next-line:switch-default switch (state) { case ScannerState.WithinComment: if (stream.advanceIfChars([_MIN, _MIN, _RAN])) { @@ -406,14 +409,14 @@ function createScanner(input, initialOffset = 0, initialState = ScannerState.Wit return finishToken(offset, TokenType.Unknown, errorMessage); } return { - scan, - getTokenType: () => tokenType, - getTokenOffset: () => tokenOffset, - getTokenLength: () => stream.pos() - tokenOffset, + getScannerState: () => state, getTokenEnd: () => stream.pos(), + getTokenError: () => tokenError, + getTokenLength: () => stream.pos() - tokenOffset, + getTokenOffset: () => tokenOffset, getTokenText: () => stream.getSource().substring(tokenOffset, stream.pos()), - getScannerState: () => state, - getTokenError: () => tokenError + getTokenType: () => tokenType, + scan, }; } exports.createScanner = createScanner; diff --git a/dist/src/server/aurelia-languageservice/parser/htmlScanner.js.map b/dist/src/server/aurelia-languageservice/parser/htmlScanner.js.map index 46246f96..4484cb36 100644 --- a/dist/src/server/aurelia-languageservice/parser/htmlScanner.js.map +++ b/dist/src/server/aurelia-languageservice/parser/htmlScanner.js.map @@ -1 +1 @@ -{"version":3,"file":"htmlScanner.js","sourceRoot":"","sources":["../../../../../src/server/aurelia-languageservice/parser/htmlScanner.ts"],"names":[],"mappings":";AAAA,WAAY,SAAS;IACpB,+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,8CAA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AW;QAChD,WAAW,EAAE,MAAM,MAAM,CAAC,GAAG,EAAE;QAC/B,YAAY,EAAE,MAAM,MAAM,CAAC,SAAS,EAAE,CAAC,SAAS,CAAC,WAAW,EAAE,MAAM,CAAC,GAAG,EAAE,CAAC;QAC3E,eAAe,EAAE,MAAM,KAAK;QAC5B,aAAa,EAAE,MAAM,UAAU;KAC/B,CAAC;AACH,CAAC;AAhQe,qBAAa,gBAgQ5B,CAAA"} \ No newline at end of file +{"version":3,"file":"htmlScanner.js","sourceRoot":"","sources":["../../../../../src/server/aurelia-languageservice/parser/htmlScanner.ts"],"names":[],"mappings":";AAAA,WAAY,SAAS;IACnB,+DAAe,CAAA;IACf,+CAAO,CAAA;IACP,2DAAa,CAAA;IACb,yDAAY,CAAA;IACZ,2DAAa,CAAA;IACb,mEAAiB,CAAA;IACjB,iDAAQ,CAAA;IACR,qDAAU,CAAA;IACV,uDAAW,CAAA;IACX,6CAAM,CAAA;IACN,gEAAe,CAAA;IACf,4DAAa,CAAA;IACb,8DAAc,CAAA;IACd,gEAAe,CAAA;IACf,gDAAO,CAAA;IACP,4DAAa,CAAA;IACb,gDAAO,CAAA;IACP,sDAAU,CAAA;IACV,gDAAO,CAAA;IACP,8CAAM,CAAA;IACN,8CAAM,CAAA;IACN,wCAAG,CAAA;AACL,CAAC,EAvBW,iBAAS,KAAT,iBAAS,QAuBpB;AAvBD,IAAY,SAAS,GAAT,iBAuBX,CAAA;AAED;IAME,YAAY,MAAc,EAAE,QAAgB;QAC1C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAEM,GAAG;QACR,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,QAAQ,CAAC;IACnC,CAAC;IAEM,SAAS;QACd,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;IACrB,C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AAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;gBAC/C,CAAC;gBACD,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC,mCAAmC;YAC5D,KAAK,YAAY,CAAC,mBAAmB;gBACnC,MAAM,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;gBACvC,KAAK,GAAG,YAAY,CAAC,aAAa,CAAC;gBACnC,EAAE,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;oBAC1B,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;gBAC/C,CAAC;gBACD,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC,mCAAmC;QAC9D,CAAC;QAED,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAClB,KAAK,GAAG,YAAY,CAAC,aAAa,CAAC;QACnC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAC9D,CAAC;IACD,MAAM,CAAC;QACL,eAAe,EAAE,MAAM,KAAK;QAC5B,WAAW,EAAE,MAAM,MAAM,CAAC,GAAG,EAAE;QAC/B,aAAa,EAAE,MAAM,UAAU;QAC/B,cAAc,EAAE,MAAM,MAAM,CAAC,GAAG,EAAE,GAAG,WAAW;QAChD,cAAc,EAAE,MAAM,WAAW;QACjC,YAAY,EAAE,MAAM,MAAM,CAAC,SAAS,EAAE,CAAC,SAAS,CAAC,WAAW,EAAE,MAAM,CAAC,GAAG,EAAE,CAAC;QAC3E,YAAY,EAAE,MAAM,SAAS;QAC7B,IAAI;KACL,CAAC;AACJ,CAAC;AAlQe,qBAAa,gBAkQ5B,CAAA"} \ No newline at end of file diff --git a/dist/src/server/aurelia-languageservice/parser/models.js.map b/dist/src/server/aurelia-languageservice/parser/models.js.map index cb498280..5f079319 100644 --- a/dist/src/server/aurelia-languageservice/parser/models.js.map +++ b/dist/src/server/aurelia-languageservice/parser/models.js.map @@ -1 +1 @@ -{"version":3,"file":"models.js","sourceRoot":"","sources":["../../../../../src/server/aurelia-languageservice/parser/models.ts"],"names":[],"mappings":";AASA;IACE,YAAmB,IAAY,EAAS,YAAY,GAAG,EAAE,EAAS,OAAO,GAAG,IAAI,EAAS,gBAAgB,GAAG,IAAI;QAA7F,SAAI,GAAJ,IAAI,CAAQ;QAAS,iBAAY,GAAZ,YAAY,CAAK;QAAS,YAAO,GAAP,OAAO,CAAO;QAAS,qBAAgB,GAAhB,gBAAgB,CAAO;IAAI,CAAC;AACvH,CAAC;AAFY,kCAA0B,6BAEtC,CAAA;AACD;IACC,YAAmB,KAAa,EAAS,UAAU,GAAiC,EAAE;QAAnE,UAAK,GAAL,KAAK,CAAQ;QAAS,eAAU,GAAV,UAAU,CAAmC;IAAI,CAAC;AAC5F,CAAC;AAFY,4BAAoB,uBAEhC,CAAA"} \ No newline at end of file +{"version":3,"file":"models.js","sourceRoot":"","sources":["../../../../../src/server/aurelia-languageservice/parser/models.ts"],"names":[],"mappings":";AASA;IACE,YAAmB,IAAY,EAAS,YAAY,GAAG,EAAE,EAAS,OAAO,GAAG,IAAI,EAAS,gBAAgB,GAAG,IAAI;QAA7F,SAAI,GAAJ,IAAI,CAAQ;QAAS,iBAAY,GAAZ,YAAY,CAAK;QAAS,YAAO,GAAP,OAAO,CAAO;QAAS,qBAAgB,GAAhB,gBAAgB,CAAO;IAAI,CAAC;AACvH,CAAC;AAFY,kCAA0B,6BAEtC,CAAA;AACD;IACE,YAAmB,KAAa,EAAS,UAAU,GAAiC,EAAE;QAAnE,UAAK,GAAL,KAAK,CAAQ;QAAS,eAAU,GAAV,UAAU,CAAmC;IAAI,CAAC;AAC7F,CAAC;AAFY,4BAAoB,uBAEhC,CAAA"} \ No newline at end of file diff --git a/dist/src/server/aurelia-languageservice/services/htmlCompletion.js b/dist/src/server/aurelia-languageservice/services/htmlCompletion.js index f3be0b89..1df67877 100644 --- a/dist/src/server/aurelia-languageservice/services/htmlCompletion.js +++ b/dist/src/server/aurelia-languageservice/services/htmlCompletion.js @@ -9,7 +9,7 @@ function doComplete(document, position, htmlDocument, quotes) { let tagProvider = aureliaTagProvider_1.getAureliaTagProvider(); let result = { isIncomplete: false, - items: [] + items: [], }; let offset = document.offsetAt(position); let node = htmlDocument.findNodeBefore(offset); @@ -22,16 +22,19 @@ function doComplete(document, position, htmlDocument, quotes) { if (replaceStart > offset) { replaceStart = offset; } - return { start: document.positionAt(replaceStart), end: document.positionAt(replaceEnd) }; + 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({ - label: tag, - kind: 10 /* Property */, documentation: label, - textEdit: { newText: tag, range: range } + kind: 10 /* Property */, + label: tag, + textEdit: { newText: tag, range: range }, }); }); return result; @@ -49,9 +52,9 @@ function doComplete(document, position, htmlDocument, quotes) { codeSnippet = codeSnippet + value; } result.items.push({ - label: attribute, kind: type === 'handler' ? 3 /* Function */ : 12 /* Value */, - textEdit: { newText: codeSnippet, range: range } + label: attribute, + textEdit: { newText: codeSnippet, range: range }, }); }); return result; @@ -76,10 +79,10 @@ function doComplete(document, position, htmlDocument, quotes) { tagProvider.collectValues(currentTag, currentAttributeName, (value) => { let codeSnippet = addQuotes ? quote + value + quote : value; result.items.push({ - label: value, filterText: codeSnippet, kind: 11 /* Unit */, - textEdit: { newText: codeSnippet, range: range } + label: value, + textEdit: { newText: codeSnippet, range: range }, }); }); return result; @@ -94,6 +97,7 @@ function doComplete(document, position, htmlDocument, quotes) { 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) { @@ -125,6 +129,7 @@ function doComplete(document, position, htmlDocument, quotes) { 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(); @@ -147,16 +152,16 @@ exports.doComplete = doComplete; function isWhiteSpace(s) { return /^\s*$/.test(s); } -function isWhiteSpaceOrQuote(s) { - return /^[\s"]*$/.test(s); -} +// function isWhiteSpaceOrQuote(s: string): boolean { +// 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; + return token === expectedToken; } function getWordStart(s, offset, limit) { while (offset > limit && !isWhiteSpace(s[offset - 1])) { diff --git a/dist/src/server/aurelia-languageservice/services/htmlCompletion.js.map b/dist/src/server/aurelia-languageservice/services/htmlCompletion.js.map index 4a454d50..e7d4e9db 100644 --- a/dist/src/server/aurelia-languageservice/services/htmlCompletion.js.map +++ b/dist/src/server/aurelia-languageservice/services/htmlCompletion.js.map @@ -1 +1 @@ -{"version":3,"file":"htmlCompletion.js","sourceRoot":"","sources":["../../../../../src/server/aurelia-languageservice/services/htmlCompletion.ts"],"names":[],"mappings":";AAEA,8BAAuD,uBACvD,CAAC,CAD6E;AAC9E,qCAAsC,8BAEtC,CAAC,CAFmE;AAUpE,oBAA2B,QAAsB,EAAE,QAAkB,EAAE,YAA0B,EAAE,MAAc;IAE/G,IAAI,KAAK,GAAG,GAAG,CAAC;IAChB,EAAE,CAAC,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC;QACxB,KAAK,GAAG,IAAI,CAAC;IACf,CAAC;IAED,IAAI,WAAW,GAAG,0CAAqB,EAAE,CAAC;IAC3C,IAAI,MAAM,GAAmB;QAC5B,YAAY,EAAE,KAAK;QACnB,KAAK,EAAE,EAAE;KACT,CAAC;IACD,IAAI,MAAM,GAAG,QAAQ,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IACrC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC3B,CAAC;AAED,sBAAsB,CAAS,EAAE,MAAa,EAAE,WAAyB,EAAE,aAAwB;IAClG,IAAI,OAAO,GAAG,2BAAa,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;IACpD,IAAI,KAAK,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAC3B,OAAO,KAAK,KAAK,uBAAS,CAAC,UAAU,EAAE,CAAC;QACvC,KAAK,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IACxB,CAAC;IACD,MAAM,CAAC,KAAK,IAAI,aAAa,CAAC;AAC/B,CAAC;AAED,sBAAsB,CAAS,EAAE,MAAc,EAAE,KAAa;IAC7D,OAAO,MAAM,GAAG,KAAK,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,GAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACrD,MAAM,EAAE,CAAC;IACV,CAAC;IACD,MAAM,CAAC,MAAM,CAAC;AACf,CAAC;AAED,oBAAoB,CAAS,EAAE,MAAc,EAAE,KAAa;IAC3D,OAAO,MAAM,GAAG,KAAK,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;QACnD,MAAM,EAAE,CAAC;IACV,CAAC;IACD,MAAM,CAAC,MAAM,CAAC;AACf,CAAC"} \ No newline at end of file +{"version":3,"file":"htmlCompletion.js","sourceRoot":"","sources":["../../../../../src/server/aurelia-languageservice/services/htmlCompletion.ts"],"names":[],"mappings":";AAEA,8BAAuD,uBAAuB,CAAC,CAAA;AAC/E,qCAAsC,8BAA8B,CAAC,CAAA;AAUrE,oBAA2B,QAAsB,EAAE,QAAkB,EAAE,YAA0B,EAAE,MAAc;IAE/G,IAAI,KAAK,GAAG,GAAG,CAAC;IAChB,EAAE,CAAC,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC;QACxB,KAAK,GAAG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AAC,IAAI,EAAE,CAAC;IACzB,CAAC;IAED,MAAM,CAAC,MAAM,CAAC;AAChB,CAAC;AA5Je,kBAAU,aA4JzB,CAAA;AAED,sBAAsB,CAAS;IAC7B,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACzB,CAAC;AAED,qDAAqD;AACrD,+BAA+B;AAC/B,IAAI;AAEJ,sBAAsB,CAAS,EAAE,MAAc,EAAE,WAAyB,EAAE,aAAwB;IAClG,IAAI,OAAO,GAAG,2BAAa,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;IACpD,IAAI,KAAK,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAC3B,OAAO,KAAK,KAAK,uBAAS,CAAC,UAAU,EAAE,CAAC;QACtC,KAAK,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC;IACD,MAAM,CAAC,KAAK,KAAK,aAAa,CAAC;AACjC,CAAC;AAED,sBAAsB,CAAS,EAAE,MAAc,EAAE,KAAa;IAC5D,OAAO,MAAM,GAAG,KAAK,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACtD,MAAM,EAAE,CAAC;IACX,CAAC;IACD,MAAM,CAAC,MAAM,CAAC;AAChB,CAAC;AAED,oBAAoB,CAAS,EAAE,MAAc,EAAE,KAAa;IAC1D,OAAO,MAAM,GAAG,KAAK,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;QAClD,MAAM,EAAE,CAAC;IACX,CAAC;IACD,MAAM,CAAC,MAAM,CAAC;AAChB,CAAC"} \ No newline at end of file diff --git a/dist/src/server/aurelia-languageservice/services/htmlValidation.js b/dist/src/server/aurelia-languageservice/services/htmlValidation.js index f12ba475..03a63060 100644 --- a/dist/src/server/aurelia-languageservice/services/htmlValidation.js +++ b/dist/src/server/aurelia-languageservice/services/htmlValidation.js @@ -11,16 +11,16 @@ const vscode_languageserver_types_1 = require('vscode-languageserver-types'); const htmlScanner_1 = require('../parser/htmlScanner'); exports.DiagnosticCodes = { InvalidCasing: 'invalid-casing', - InvalidMethod: 'invalid-method' + InvalidMethod: 'invalid-method', }; exports.DiagnosticSource = 'Aurelia'; const kebabCaseValidationRegex = /(.*)\.(bind|one-way|two-way|one-time|call|delegate|trigger)/; -const methodRegex = /\"(.*)\(/; -function kebabToCamel(s) { - return s.replace(/(\-\w)/g, m => m[1].toUpperCase()); -} +// const methodRegex = /\"(.*)\(/; +// function kebabToCamel(s: string) { +// return s.replace(/(\-\w)/g, m => m[1].toUpperCase()); +// } function camelToKebab(s) { - return s.replace(/\.?([A-Z])/g, (x, y) => "-" + y.toLowerCase()).replace(/^-/, ""); + return s.replace(/\.?([A-Z])/g, (x, y) => '-' + y.toLowerCase()).replace(/^-/, ''); } class HTMLValidation { constructor() { @@ -33,25 +33,27 @@ class HTMLValidation { } doValidation(document, htmlDocument) { return __awaiter(this, void 0, void 0, function* () { - if (!this.validationEnabled) + 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(), - length: scanner.getTokenLength() }; break; case htmlScanner_1.TokenType.AttributeValue: attr.value = scanner.getTokenText(); - yield this._validateAttribute(attr, document, diagnostics); + yield this.validateAttribute(attr, document, diagnostics); break; } token = scanner.scan(); @@ -59,7 +61,7 @@ class HTMLValidation { return Promise.resolve(diagnostics); }); } - _validateAttribute(attr, document, diagnostics) { + validateAttribute(attr, document, diagnostics) { return __awaiter(this, void 0, void 0, function* () { let match = kebabCaseValidationRegex.exec(attr.name); if (match && match.length) { @@ -78,7 +80,7 @@ class HTMLValidation { message: message, range: range, severity: serverity, - source: exports.DiagnosticSource + source: exports.DiagnosticSource, }; if (code !== undefined) { diagnostic.code = code; diff --git a/dist/src/server/aurelia-languageservice/services/htmlValidation.js.map b/dist/src/server/aurelia-languageservice/services/htmlValidation.js.map index 79661efe..c827a972 100644 --- a/dist/src/server/aurelia-languageservice/services/htmlValidation.js.map +++ b/dist/src/server/aurelia-languageservice/services/htmlValidation.js.map @@ -1 +1 @@ -{"version":3,"file":"htmlValidation.js","sourceRoot":"","sources":["../../../../../src/server/aurelia-languageservice/services/htmlValidation.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;AAGb,8CAAmG,6BAA6B,CAAC,CAAA;AAGjI,8BAAuD,uBACvD,CAAC,CAD6E;AAKjE,uBAAe,GAAG;IAC9B,aAAa,EAAE,gBAAmC;IAClD,aAAa,EAAE,gBAAmC;CAClD,CAAA;AAEY,wBAAgB,GAAG,SAAS,CAAC;AAS1C,MAAM,wBAAwB,GAAG,6DAA6D,CAAC;AAC/F,MAAM,WAAW,GAAG,UAAU,CAAC;AAE/B,sBAAsB,CAAS;IAC9B,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AACtD,CAAC;AAED,sBAAsB,CAAS;IAC9B,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;AACpF,CAAC;AAED;IAGC;QACC,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAC/B,CAAC;IAEM,SAAS,CAAC,GAAqB;QACrC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YACT,IAAI,CAAC,iBAAiB,GAAG,GAAG,CAAC,QAAQ,CAAC;QACvC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I,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,IAAI,GAAgC,SAAS,EAC7C,SAAS,GAAuB,aAAwB;QACtD,MAAM,KAAK,GAAG,mCAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAC3G,MAAM,UAAU,GAAgB;YAC9B,OAAO,EAAE,OAAO;YAChB,KAAK,EAAE,KAAK;YACZ,QAAQ,EAAE,SAAS;YACnB,MAAM,EAAE,wBAAgB;SACzB,CAAC;QAEF,EAAE,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC;YACvB,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC;QACzB,CAAC;QACD,MAAM,CAAC,UAAU,CAAC;IACtB,CAAC;AACH,CAAC;AAjFY,sBAAc,iBAiF1B,CAAA"} \ No newline at end of file diff --git a/dist/src/server/languageModelCache.js b/dist/src/server/languageModelCache.js index bb2fb4f3..90d76891 100644 --- a/dist/src/server/languageModelCache.js +++ b/dist/src/server/languageModelCache.js @@ -34,10 +34,13 @@ function getLanguageModelCache(maxEntries, cleanupIntervalTimeInSec, parse) { let oldestTime = Number.MAX_VALUE; let oldestUri = null; for (let uri in languageModels) { - let languageModelInfo = languageModels[uri]; - if (languageModelInfo.cTime < oldestTime) { - oldestUri = uri; - oldestTime = languageModelInfo.cTime; + 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) { @@ -61,7 +64,7 @@ function getLanguageModelCache(maxEntries, cleanupIntervalTimeInSec, parse) { languageModels = {}; nModels = 0; } - } + }, }; } exports.getLanguageModelCache = getLanguageModelCache; diff --git a/dist/src/server/languageModelCache.js.map b/dist/src/server/languageModelCache.js.map index 12602a93..88500022 100644 --- a/dist/src/server/languageModelCache.js.map +++ b/dist/src/server/languageModelCache.js.map @@ -1 +1 @@ -{"version":3,"file":"languageModelCache.js","sourceRoot":"","sources":["../../../src/server/languageModelCache.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAUb,+BAAyC,UAAkB,EAAE,wBAAgC,EAAE,KAAoC;IAClI,IAAI,cAAc,GAAgG,EAAE,CAAC;IACrH,IAAI,OAAO,GAAG,CAAC,CAAC;IAEhB,IAAI,eAAe,GAAG,KAAK,CAAC,CAAC;IAC7B,EAAE,CAAC,CAAC,wBAAwB,GAAG,CAAC,CAAC,CAAC,CAAC;QAClC,eAAe,GAAG,WAAW,CAAC;YAC7B,IAAI,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,wBAAwB,GAAG,IAAI,CAAC;YAC9D,IAAI,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YACvC,GAAG,CAAC,CAAC,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC;gBACtB,IAAI,iBAAiB,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;gBAC5C,EAAE,CAAC,CAAC,iBAAiB,CAAC,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC;oBAC1C,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;oBAC3B,OAAO,EAAE,CAAC;gBACX,CAAC;YACF,CAAC;QACF,CAAC,EAAE,wBAAwB,GAAG,IAAI,CAAC,CAAC;IACrC,CAAC;IAED,MAAM,CAAC;QACN,GAAG,CAAC,QAAsB;YACzB,IAAI,OA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C;oBACjC,OAAO,EAAE,CAAC;gBACX,CAAC;YACF,CAAC;YACD,MAAM,CAAC,aAAa,CAAC;QAEtB,CAAC;QACD,iBAAiB,CAAC,QAAsB;YACvC,IAAI,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC;YACvB,EAAE,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBACzB,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;gBAC3B,OAAO,EAAE,CAAC;YACX,CAAC;QACF,CAAC;QACD,OAAO;YACN,EAAE,CAAC,CAAC,OAAO,eAAe,KAAK,WAAW,CAAC,CAAC,CAAC;gBAC5C,aAAa,CAAC,eAAe,CAAC,CAAC;gBAC/B,eAAe,GAAG,KAAK,CAAC,CAAC;gBACzB,cAAc,GAAG,EAAE,CAAC;gBACpB,OAAO,GAAG,CAAC,CAAC;YACb,CAAC;QACF,CAAC;KACD,CAAC;AACH,CAAC;AApEe,6BAAqB,wBAoEpC,CAAA"} \ No newline at end of file +{"version":3,"file":"languageModelCache.js","sourceRoot":"","sources":["../../../src/server/languageModelCache.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAUb,+BACE,UAAkB,EAClB,wBAAgC,EAChC,KAAoC;IAClC,IAAI,cAAc,GAAgG,EAAE,CAAC;IACrH,IAAI,OAAO,GAAG,CAAC,CAAC;IAEhB,IAAI,eAAe,GAAG,KAAK,CAAC,CAAC;IAC7B,EAAE,CAAC,CAAC,wBAAwB,GAAG,CAAC,CAAC,CAAC,CAAC;QACjC,eAAe,GAAG,WAAW,CAAC;YAC5B,IAAI,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,wBAAwB,GAAG,IAAI,CAAC;YAC9D,IAAI,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YACvC,GAAG,CAAC,CAAC,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC;gBACrB,IAAI,iBAAiB,GAAG,cAAc,CAAC,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,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;wBACvC,gDAAgD;wBAChD,IAAI,iBAAiB,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;wBAC5C,EAAE,CAAC,CAAC,iBAAiB,CAAC,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC;4BACzC,SAAS,GAAG,GAAG,CAAC;4BAChB,UAAU,GAAG,iBAAiB,CAAC,KAAK,CAAC;wBACvC,CAAC;oBACH,CAAC;gBACH,CAAC;gBACD,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;oBACd,OAAO,cAAc,CAAC,SAAS,CAAC,CAAC;oBACjC,OAAO,EAAE,CAAC;gBACZ,CAAC;YACH,CAAC;YACD,MAAM,CAAC,aAAa,CAAC;QAEvB,CAAC;QACD,iBAAiB,CAAC,QAAsB;YACtC,IAAI,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC;YACvB,EAAE,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBACxB,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;gBAC3B,OAAO,EAAE,CAAC;YACZ,CAAC;QACH,CAAC;QACD,OAAO;YACL,EAAE,CAAC,CAAC,OAAO,eAAe,KAAK,WAAW,CAAC,CAAC,CAAC;gBAC3C,aAAa,CAAC,eAAe,CAAC,CAAC;gBAC/B,eAAe,GAAG,KAAK,CAAC,CAAC;gBACzB,cAAc,GAAG,EAAE,CAAC;gBACpB,OAAO,GAAG,CAAC,CAAC;YACd,CAAC;QACH,CAAC;KACF,CAAC;AACN,CAAC;AA1Ee,6BAAqB,wBA0EpC,CAAA"} \ No newline at end of file diff --git a/dist/src/server/main.js b/dist/src/server/main.js index 9bfa4253..5b5caa97 100644 --- a/dist/src/server/main.js +++ b/dist/src/server/main.js @@ -27,9 +27,9 @@ connection.onInitialize((params) => { workspacePath = params.rootPath; return { capabilities: { + completionProvider: { resolveProvider: false, triggerCharacters: ['.', '<'] }, textDocumentSync: documents.syncKind, - completionProvider: { resolveProvider: false, triggerCharacters: ['.', '<'] } - } + }, }; }); let aureliaSettings; diff --git a/dist/src/server/main.js.map b/dist/src/server/main.js.map index 7fde7f66..af447edd 100644 --- a/dist/src/server/main.js.map +++ b/dist/src/server/main.js.map @@ -1 +1 @@ -{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../src/server/main.ts"],"names":[],"mappings":";;;;;;;;;AAAA,wCAAiG,uBAAuB,CAAC,CAAA;AACzH,yCAAiD,kDAAkD,CAAC,CAAA;AACpG,qCAAsC,sBAAsB,CAAC,CAAA;AAE7D,IAAI,UAAU,GAAgB,wCAAgB,EAAE,CAAC;AACjD,OAAO,CAAC,GAAG,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AAC9D,OAAO,CAAC,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AAElE,IAAI,SAAS,GAAkB,IAAI,qCAAa,EAAE,CAAC;AACnD,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AAE7B,IAAI,aAAa,GAAG,0CAAqB,CAAe,EAAE,EAAE,EAAE,EAAE,QAAQ,IAAI,2CAAkB,EAAE,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC9H,SAAS,CAAC,UAAU,CAAC,CAAC;IACrB,aAAa,CAAC,iBAAiB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;AAC7C,CAAC,CAAC,CAAC;AAEH,UAAU,CAAC,UAAU,CAAC;IACrB,aAAa,CAAC,OAAO,EAAE,CAAC;AACzB,CAAC,CAAC,CAAC;AAEH,IAAI,aAAqB,CAAC;AAE1B,UAAU,CAAC,YAAY,CAAC,CAAC,MAAwB;IAChD,aAAa,GAAG,MAAM,CAAC,QAAQ,CAAC;IAChC,MAAM,CAAC;QACN,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CAAC,OAAO,CAAC,CAAC;AAEzF,IAAI,eAAe,GAAG,2CAAkB,EAAE,CAAC;AAE3C,SAAS,CAAC,kBAAkB,CAAC,CAAM,MAAM;IACvC,IAAI,YAAY,GAAG,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACtD,MAAM,WAAW,GAAG,MAAM,eAAe,CAAC,YAAY,CAAC,MAAM,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IACtF,UAAU,CAAC,eAAe,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,WAAW,EAAE,CAAC,CAAC;AACxE,CAAC,CAAA,CAAC,CAAC;AAEH,UAAU,CAAC,YAAY,CAAC,oBAAoB;IAC1C,IAAI,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,oBAAoB,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IACpE,IAAI,YAAY,GAAG,aAAa,CAAC,GAAG,CAAC,QAAQ,CAAC,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/src/client/main.ts b/src/client/main.ts index 53fe0ac9..c283b458 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 } from 'vscode'; import { LanguageClient, LanguageClientOptions, ServerOptions, TransportKind } from 'vscode-languageclient'; import AureliaCliCommands from './aureliaCLICommands'; @@ -7,31 +7,31 @@ let outputChannel: OutputChannel; export function activate(context: ExtensionContext) { - // Create default output channel - outputChannel = window.createOutputChannel('aurelia'); - context.subscriptions.push(outputChannel); + // Create default output channel + outputChannel = window.createOutputChannel('aurelia'); + context.subscriptions.push(outputChannel); - // Register CLI commands - context.subscriptions.push(AureliaCliCommands.registerCommands(outputChannel)); + // Register CLI commands + context.subscriptions.push(AureliaCliCommands.registerCommands(outputChannel)); - // Register Aurelia language server - const serverModule = context.asAbsolutePath(path.join('dist', 'src', 'server', 'main.js')); - const debugOptions = { execArgv: ['--nolazy', '--debug=6004'] }; - const serverOptions: ServerOptions = { - run: { module: serverModule, transport: TransportKind.ipc }, - debug: { module: serverModule, transport: TransportKind.ipc, options: debugOptions } - }; + // Register Aurelia language server + const serverModule = context.asAbsolutePath(path.join('dist', 'src', 'server', 'main.js')); + const debugOptions = { execArgv: ['--nolazy', '--debug=6004'] }; + const serverOptions: ServerOptions = { + debug: { module: serverModule, options: debugOptions, transport: TransportKind.ipc }, + run: { module: serverModule, transport: TransportKind.ipc }, + }; - const clientOptions: LanguageClientOptions = { - diagnosticCollectionName: 'Aurelia', - documentSelector: ['html'], - initializationOptions: {}, - synchronize: { - configurationSection: ['aurelia'], - } - }; + const clientOptions: LanguageClientOptions = { + diagnosticCollectionName: 'Aurelia', + documentSelector: ['html'], + initializationOptions: {}, + synchronize: { + configurationSection: ['aurelia'], + }, + }; - const client = new LanguageClient('html', 'Aurelia', serverOptions, clientOptions); - const disposable = client.start(); - context.subscriptions.push(disposable); + const client = new LanguageClient('html', 'Aurelia', serverOptions, clientOptions); + const disposable = client.start(); + context.subscriptions.push(disposable); } diff --git a/src/server/aurelia-languageservice/aureliaLanguageService.ts b/src/server/aurelia-languageservice/aureliaLanguageService.ts index 01c5b5e9..d9b385f4 100644 --- a/src/server/aurelia-languageservice/aureliaLanguageService.ts +++ b/src/server/aurelia-languageservice/aureliaLanguageService.ts @@ -7,24 +7,24 @@ import { HTMLDocument } from './parser/htmlParser'; export { HTMLDocument } from './parser/htmlParser'; export interface CompletionConfiguration { - [provider: string]: boolean; + [provider: string]: boolean; } export interface LanguageSettings { - validate?: boolean; + validate?: boolean; } export interface LanguageService { - doComplete(document: TextDocument, position: Position, htmlDocument: HTMLDocument, quotes: string): CompletionList; - doValidation(document: TextDocument, htmlDocument: HTMLDocument): Thenable; - parseHTMLDocument(document: TextDocument): HTMLDocument; + doComplete(document: TextDocument, position: Position, htmlDocument: HTMLDocument, quotes: string): CompletionList; + doValidation(document: TextDocument, htmlDocument: HTMLDocument): Thenable; + parseHTMLDocument(document: TextDocument): HTMLDocument; } export function getLanguageService(): LanguageService { - const validation = new HTMLValidation(); - return { - doComplete, - doValidation: validation.doValidation.bind(validation), - parseHTMLDocument: document => parse(document.getText()) - }; + const validation = new HTMLValidation(); + return { + doComplete, + doValidation: validation.doValidation.bind(validation), + parseHTMLDocument: document => parse(document.getText()), + }; } diff --git a/src/server/aurelia-languageservice/parser/aureliaTagProvider.ts b/src/server/aurelia-languageservice/parser/aureliaTagProvider.ts index 4c91a77a..1ffe3cd3 100644 --- a/src/server/aurelia-languageservice/parser/aureliaTagProvider.ts +++ b/src/server/aurelia-languageservice/parser/aureliaTagProvider.ts @@ -1,20 +1,17 @@ -import { IHTMLTagProvider } from '../services/htmlCompletion'; +import { HTMLTagProvider } from '../services/htmlCompletion'; import { AURELIA_ATTRIBUTES, AURELIA_TAGS, AURELIA_GLOBAL_ATTRIBUTES, AURELIA_EVENTS } from './aureliaTags'; -import { HTMLAttributeSpecification, ITagSet } from './models'; +import { HTMLAttributeSpecification, TagSet } from './models'; -export function getAureliaTagProvider(): IHTMLTagProvider { - return { - getId: () => 'aurelia', - isApplicable: (languageId) => languageId === 'html', - collectTags: (collector: (tag: string, label: string) => void) => collectTagsDefault(collector, AURELIA_TAGS), - collectAttributes: (tag: string, collector: (attribute: string, type: string) => void) => { +export function getAureliaTagProvider(): HTMLTagProvider { + return { + collectAttributes: (tag: string, collector: (attribute: string, type: string) => void) => { if (tag) { let tagWithAttributes = AURELIA_TAGS[tag]; let attributes = AURELIA_ATTRIBUTES[tag]; if (tagWithAttributes) { addAttributes(tagWithAttributes.attributes, collector); - } else if (attributes) { + } else if (attributes) { addAttributes(attributes, collector); } else { addAttributes(AURELIA_GLOBAL_ATTRIBUTES, collector); @@ -24,11 +21,15 @@ export function getAureliaTagProvider(): IHTMLTagProvider { if (tagWithEvents) { addAttributes(tagWithEvents, collector); } - } - }, - collectValues: (tag: string, attribute: string, collector: (value: string) => void) => { - } - }; + } + }, + collectTags: (collector: (tag: string, label: string) => void) => collectTagsDefault(collector, AURELIA_TAGS), + // tslint:disable-next-line:no-empty + collectValues: (tag: string, attribute: string, collector: (value: string) => void) => { + }, + getId: () => 'aurelia', + isApplicable: (languageId) => languageId === 'html', + }; } function addAttributes(attributes: Array, collector) { @@ -37,18 +38,19 @@ function addAttributes(attributes: Array, collector) if (!attribute.hasBody) { collector(attribute.name, 'v'); } else if (!attribute.defaultAttribute) { - collector(attribute.name, null); + collector(attribute.name, null); } if (attribute.dataBindings && attribute.dataBindings.length) { attribute.dataBindings.forEach(binding => collector(attribute.name + '.' + binding, null)); - } + } }); } -function collectTagsDefault(collector: (tag: string, label: string) => void, tagSet: ITagSet): void { - for (let tag in tagSet) { - collector(tag, tagSet[tag].label); - } +function collectTagsDefault(collector: (tag: string, label: string) => void, tagSet: TagSet): void { + for (let tag in tagSet) { + if (tagSet.hasOwnProperty(tag)) { + collector(tag, tagSet[tag].label); + } + } } - diff --git a/src/server/aurelia-languageservice/parser/aureliaTags.ts b/src/server/aurelia-languageservice/parser/aureliaTags.ts index 7c784531..f3f41614 100644 --- a/src/server/aurelia-languageservice/parser/aureliaTags.ts +++ b/src/server/aurelia-languageservice/parser/aureliaTags.ts @@ -1,11 +1,11 @@ -import { ITagSet, HTMLTagSpecification, HTMLAttributeSpecification, IAttributeSet, IEventSet } from './models'; +import { TagSet, HTMLTagSpecification, HTMLAttributeSpecification, AttributeSet, EventSet } from './models'; -export const AURELIA_TAGS: ITagSet = { +export const AURELIA_TAGS: TagSet = { 'require' : new HTMLTagSpecification(`"import" or "require" various resources into a view. Equivalent of the ES 2015 "import" syntax`, [ - new HTMLAttributeSpecification('from', [], true, false), + new HTMLAttributeSpecification('from', [], true, false), new HTMLAttributeSpecification('as', [], true, false) ]), 'router-view': new HTMLTagSpecification(`Placeholder for the router content`, [ - new HTMLAttributeSpecification('name'), + new HTMLAttributeSpecification('name'), new HTMLAttributeSpecification('layout-view', [], true, false), new HTMLAttributeSpecification( 'layout-view-model', [], true, false), new HTMLAttributeSpecification('layout-model', [], true, false)]), @@ -13,23 +13,23 @@ export const AURELIA_TAGS: ITagSet = { new HTMLAttributeSpecification('view', [], true, false)]), 'slot': new HTMLTagSpecification(`Shadow DOM slot element, Aurelia will project the element's content in to the element.`, [ new HTMLAttributeSpecification('name'), - new HTMLAttributeSpecification('slot')]) + new HTMLAttributeSpecification('slot')]), }; const defaultBindings = ['bind', 'one-way', 'two-way', 'one-time']; -export const AURELIA_ATTRIBUTES: IAttributeSet = { +export const AURELIA_ATTRIBUTES: AttributeSet = { 'select' : [ new HTMLAttributeSpecification('matcher', defaultBindings, true, false) ], 'option' : [ new HTMLAttributeSpecification('model', defaultBindings, true, false) ], 'input' : [ - new HTMLAttributeSpecification('value', defaultBindings, true, true), - new HTMLAttributeSpecification('checked' ,defaultBindings, true, true), - new HTMLAttributeSpecification('model', defaultBindings, true, false) + new HTMLAttributeSpecification('value', defaultBindings, true, true), + new HTMLAttributeSpecification('checked', defaultBindings, true, true), + new HTMLAttributeSpecification('model', defaultBindings, true, false), ], 'compose' : [ new HTMLAttributeSpecification('view', defaultBindings, true, false), new HTMLAttributeSpecification('view-model', defaultBindings, true, false), - new HTMLAttributeSpecification('model', defaultBindings, true, false) + new HTMLAttributeSpecification('model', defaultBindings, true, false), ], 'template': [ new HTMLAttributeSpecification('replaceable', [], false, false), @@ -38,8 +38,8 @@ export const AURELIA_ATTRIBUTES: IAttributeSet = { new HTMLAttributeSpecification('containerless', [], false, false), ], 'a': [ new HTMLAttributeSpecification('route-href', defaultBindings, true, false)], - 'slot': [ new HTMLAttributeSpecification('name', defaultBindings, true, true) ] -} + 'slot': [ new HTMLAttributeSpecification('name', defaultBindings, true, true) ], +}; export const AURELIA_GLOBAL_ATTRIBUTES: Array = [ new HTMLAttributeSpecification('repeat.for', [], true, false), @@ -72,11 +72,11 @@ const globalEvents = [ new HTMLAttributeSpecification('abort', actionRedirectOptionsNonBubbling), new HTMLAttributeSpecification('load', actionRedirectOptionsNonBubbling), new HTMLAttributeSpecification('unload', actionRedirectOptionsNonBubbling), - + // Focus Events new HTMLAttributeSpecification('blur', actionRedirectOptionsNonBubbling), new HTMLAttributeSpecification('focus', ['call', 'trigger', 'bind', 'one-way', 'two-way', 'one-time']), - + // CSS Animation Events new HTMLAttributeSpecification('animationstart', actionRedirectOptions), new HTMLAttributeSpecification('animationend', actionRedirectOptions), @@ -98,7 +98,7 @@ const globalEvents = [ // Keyboard Events new HTMLAttributeSpecification('keydown', actionRedirectOptions), new HTMLAttributeSpecification('keypress', actionRedirectOptions), - new HTMLAttributeSpecification('keyup', actionRedirectOptions), + new HTMLAttributeSpecification('keyup', actionRedirectOptions), // Mouse Events new HTMLAttributeSpecification('mouseenter', actionRedirectOptionsNonBubbling), @@ -135,7 +135,7 @@ const globalEvents = [ new HTMLAttributeSpecification('close', actionRedirectOptions), ]; -export const AURELIA_EVENTS: IEventSet = { +export const AURELIA_EVENTS: EventSet = { 'a': globalEvents, 'abbr': globalEvents, 'address': globalEvents, @@ -177,7 +177,7 @@ export const AURELIA_EVENTS: IEventSet = { new HTMLAttributeSpecification('reset', actionRedirectOptions), new HTMLAttributeSpecification('submit', actionRedirectOptions), new HTMLAttributeSpecification('change', actionRedirectOptions), - new HTMLAttributeSpecification('input', actionRedirectOptions), + new HTMLAttributeSpecification('input', actionRedirectOptions), ], 'header': globalEvents, 'hr': globalEvents, @@ -239,4 +239,4 @@ export const AURELIA_EVENTS: IEventSet = { 'var': globalEvents, 'video': globalEvents, 'wbr': globalEvents, -} +}; diff --git a/src/server/aurelia-languageservice/parser/htmlParser.ts b/src/server/aurelia-languageservice/parser/htmlParser.ts index b21fa309..60ffe74b 100644 --- a/src/server/aurelia-languageservice/parser/htmlParser.ts +++ b/src/server/aurelia-languageservice/parser/htmlParser.ts @@ -1,158 +1,177 @@ import { TokenType, createScanner } from './htmlScanner'; export class Node { - public tag: string; - public closed: boolean; - public endTagStart: number; - constructor(public start: number, public end: number, public children: Node[], public parent: Node) { + public tag: string; + public closed: boolean; + public endTagStart: number; + constructor(public start: number, public end: number, public children: Node[], public parent: Node) { - } - public get firstChild(): Node { return this.children[0]; } - public get lastChild(): Node { return this.children.length ? this.children[this.children.length - 1] : void 0; } + } + public get firstChild(): Node { return this.children[0]; } + public get lastChild(): Node { return this.children.length ? this.children[this.children.length - 1] : void 0; } - public findNodeBefore(offset: number): Node { - 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; - } + public findNodeBefore(offset: number): Node { + 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; + } - public findNodeAt(offset: number): Node { - 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; - } + public findNodeAt(offset: number): Node { + 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; + } } export interface HTMLDocument { - roots: Node[]; - findNodeBefore(offset: number): Node; - findNodeAt(offset: number): Node; + roots: Node[]; + findNodeBefore(offset: number): Node; + findNodeAt(offset: number): Node; } export function parse(text: string): HTMLDocument { - let scanner = createScanner(text); + let scanner = createScanner(text); - let htmlDocument = new Node(0, text.length, [], null); - let curr = htmlDocument; - let endTagStart: number = -1; - let token = scanner.scan(); - while (token !== TokenType.EOS) { - switch (token) { - case TokenType.StartTagOpen: - let child = new Node(scanner.getTokenOffset(), text.length, [], curr); - curr.children.push(child); - curr = child; - break; - case TokenType.StartTag: - curr.tag = scanner.getTokenText(); - break; - case 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 TokenType.EndTagOpen: - endTagStart = scanner.getTokenOffset(); - break; - case 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 TokenType.StartTagSelfClose: - if (curr !== htmlDocument) { - curr.closed = true; - curr.end = scanner.getTokenEnd(); - curr = curr.parent; - } - break; - case 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 { - roots: htmlDocument.children, - findNodeBefore: htmlDocument.findNodeBefore.bind(htmlDocument), - findNodeAt: htmlDocument.findNodeAt.bind(htmlDocument) - }; + let htmlDocument = new Node(0, text.length, [], null); + let curr = htmlDocument; + let endTagStart: number = -1; + let token = scanner.scan(); + while (token !== TokenType.EOS) { + // tslint:disable-next-line:switch-default + switch (token) { + case TokenType.StartTagOpen: + let child = new Node(scanner.getTokenOffset(), text.length, [], curr); + curr.children.push(child); + curr = child; + break; + case TokenType.StartTag: + curr.tag = scanner.getTokenText(); + break; + case 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 TokenType.EndTagOpen: + endTagStart = scanner.getTokenOffset(); + break; + case 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 TokenType.StartTagSelfClose: + if (curr !== htmlDocument) { + curr.closed = true; + curr.end = scanner.getTokenEnd(); + curr = curr.parent; + } + break; + case 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, + }; } function findFirst(array: T[], p: (x: T) => boolean): number { - let low = 0, 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; + 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: T[], key: T, comparator: (op1: T, op2: T) => number): number { - let low = 0, - high = array.length - 1; + let low = 0; + let high = array.length - 1; - while (low <= high) { - 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); + 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); } -export const EMPTY_ELEMENTS: string[] = ['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'menuitem', 'meta', 'param', 'source', 'track', 'wbr']; +export const EMPTY_ELEMENTS: string[] = [ + 'area', + 'base', + 'br', + 'col', + 'embed', + 'hr', + 'img', + 'input', + 'keygen', + 'link', + 'menuitem', + 'meta', + 'param', + 'source', + 'track', + 'wbr']; function isEmptyElement(e: string): boolean { - return e && binarySearch(EMPTY_ELEMENTS, e.toLowerCase(), (s1: string, s2: string) => s1.localeCompare(s2)) >= 0; + return e && binarySearch(EMPTY_ELEMENTS, e.toLowerCase(), (s1: string, s2: string) => s1.localeCompare(s2)) >= 0; } function isSameTag(t1: string, t2: string): boolean { - return t1 && t2 && t1.toLowerCase() === t2.toLowerCase(); + return t1 && t2 && t1.toLowerCase() === t2.toLowerCase(); } diff --git a/src/server/aurelia-languageservice/parser/htmlScanner.ts b/src/server/aurelia-languageservice/parser/htmlScanner.ts index 69a93bd8..88ce3e19 100644 --- a/src/server/aurelia-languageservice/parser/htmlScanner.ts +++ b/src/server/aurelia-languageservice/parser/htmlScanner.ts @@ -1,156 +1,157 @@ export enum TokenType { - StartCommentTag, - Comment, - EndCommentTag, - StartTagOpen, - StartTagClose, - StartTagSelfClose, - StartTag, - EndTagOpen, - EndTagClose, - EndTag, - DelimiterAssign, - AttributeName, - AttributeValue, - StartDoctypeTag, - Doctype, - EndDoctypeTag, - Content, - Whitespace, - Unknown, - Script, - Styles, - EOS + StartCommentTag, + Comment, + EndCommentTag, + StartTagOpen, + StartTagClose, + StartTagSelfClose, + StartTag, + EndTagOpen, + EndTagClose, + EndTag, + DelimiterAssign, + AttributeName, + AttributeValue, + StartDoctypeTag, + Doctype, + EndDoctypeTag, + Content, + Whitespace, + Unknown, + Script, + Styles, + EOS } class MultiLineStream { - private source: string; - private len: number; - private position: number; - - constructor(source: string, position: number) { - this.source = source; - this.len = source.length; - this.position = position; - } - - public eos(): boolean { - return this.len <= this.position; - } - - public getSource(): string { - return this.source; - } - - public pos(): number { - return this.position; - } - - public goBackTo(pos: number): void { - this.position = pos; - } - - public goBack(n: number): void { - this.position -= n; - } - - public advance(n: number): void { - this.position += n; - } - - public goToEnd(): void { - this.position = this.source.length; - } - - public nextChar(): number { - return this.source.charCodeAt(this.position++) || 0; - } - - public peekChar(n: number = 0): number { - return this.source.charCodeAt(this.position + n) || 0; - } - - public advanceIfChar(ch: number): boolean { - if (ch === this.source.charCodeAt(this.position)) { - this.position++; - return true; - } - return false; - } - - public advanceIfChars(ch: number[]): boolean { - let i: number; - if (this.position + ch.length > this.source.length) { - return false; - } - for (i = 0; i < ch.length; i++) { - if (this.source.charCodeAt(this.position + i) !== ch[i]) { - return false; - } - } - this.advance(i); - return true; - } - - public advanceIfRegExp(regex: RegExp): string { - let str = this.source.substr(this.position); - let match = str.match(regex); - if (match) { - this.position = this.position + match.index + match[0].length; - return match[0]; - } - return ''; - } - - public advanceUntilRegExp(regex: RegExp): string { - let str = this.source.substr(this.position); - let match = str.match(regex); - if (match) { - this.position = this.position + match.index; - return match[0]; - } - return ''; - } - - public advanceUntilChar(ch: number): boolean { - while (this.position < this.source.length) { - if (this.source.charCodeAt(this.position) === ch) { - return true; - } - this.advance(1); - } - return false; - } - - public advanceUntilChars(ch: number[]): boolean { - while (this.position + ch.length <= this.source.length) { - let i = 0; - 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; - } - - public skipWhitespace(): boolean { - let n = this.advanceWhileChar(ch => { - return ch === _WSP || ch === _TAB || ch === _NWL || ch === _LFD || ch === _CAR; - }); - return n > 0; - } - - public advanceWhileChar(condition: (ch: number) => boolean): number { - let posNow = this.position; - while (this.position < this.len && condition(this.source.charCodeAt(this.position))) { - this.position++; - } - return this.position - posNow; - } + private source: string; + private len: number; + private position: number; + + constructor(source: string, position: number) { + this.source = source; + this.len = source.length; + this.position = position; + } + + public eos(): boolean { + return this.len <= this.position; + } + + public getSource(): string { + return this.source; + } + + public pos(): number { + return this.position; + } + + public goBackTo(pos: number): void { + this.position = pos; + } + + public goBack(n: number): void { + this.position -= n; + } + + public advance(n: number): void { + this.position += n; + } + + public goToEnd(): void { + this.position = this.source.length; + } + + public nextChar(): number { + return this.source.charCodeAt(this.position++) || 0; + } + + public peekChar(n: number = 0): number { + return this.source.charCodeAt(this.position + n) || 0; + } + + public advanceIfChar(ch: number): boolean { + if (ch === this.source.charCodeAt(this.position)) { + this.position++; + return true; + } + return false; + } + + public advanceIfChars(ch: number[]): boolean { + let i: number; + if (this.position + ch.length > this.source.length) { + return false; + } + for (i = 0; i < ch.length; i++) { + if (this.source.charCodeAt(this.position + i) !== ch[i]) { + return false; + } + } + this.advance(i); + return true; + } + + public advanceIfRegExp(regex: RegExp): string { + let str = this.source.substr(this.position); + let match = str.match(regex); + if (match) { + this.position = this.position + match.index + match[0].length; + return match[0]; + } + return ''; + } + + public advanceUntilRegExp(regex: RegExp): string { + let str = this.source.substr(this.position); + let match = str.match(regex); + if (match) { + this.position = this.position + match.index; + return match[0]; + } + return ''; + } + + public advanceUntilChar(ch: number): boolean { + while (this.position < this.source.length) { + if (this.source.charCodeAt(this.position) === ch) { + return true; + } + this.advance(1); + } + return false; + } + + public advanceUntilChars(ch: number[]): boolean { + while (this.position + ch.length <= this.source.length) { + 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; + } + + public skipWhitespace(): boolean { + let n = this.advanceWhileChar(ch => { + return ch === _WSP || ch === _TAB || ch === _NWL || ch === _LFD || ch === _CAR; + }); + return n > 0; + } + + public advanceWhileChar(condition: (ch: number) => boolean): number { + let posNow = this.position; + while (this.position < this.len && condition(this.source.charCodeAt(this.position))) { + this.position++; + } + return this.position - posNow; + } } const _BNG = '!'.charCodeAt(0); const _MIN = '-'.charCodeAt(0); @@ -166,290 +167,291 @@ const _LFD = '\f'.charCodeAt(0); const _WSP = ' '.charCodeAt(0); const _TAB = '\t'.charCodeAt(0); - export enum ScannerState { - WithinContent, - AfterOpeningStartTag, - AfterOpeningEndTag, - WithinDoctype, - WithinTag, - WithinEndTag, - WithinComment, - WithinScriptContent, - WithinStyleContent, - AfterAttributeName, - BeforeAttributeValue + WithinContent, + AfterOpeningStartTag, + AfterOpeningEndTag, + WithinDoctype, + WithinTag, + WithinEndTag, + WithinComment, + WithinScriptContent, + WithinStyleContent, + AfterAttributeName, + BeforeAttributeValue } export interface Scanner { - scan(): TokenType; - getTokenType(): TokenType; - getTokenOffset(): number; - getTokenLength(): number; - getTokenEnd(): number; - getTokenText(): string; - getTokenError(): string; - getScannerState(): ScannerState; + scan(): TokenType; + getTokenType(): TokenType; + getTokenOffset(): number; + getTokenLength(): number; + getTokenEnd(): number; + getTokenText(): string; + getTokenError(): string; + getScannerState(): ScannerState; } const htmlScriptContents = { - 'text/x-handlebars-template': true + 'text/x-handlebars-template': true, }; export function createScanner(input: string, initialOffset = 0, initialState: ScannerState = ScannerState.WithinContent): Scanner { - let stream = new MultiLineStream(input, initialOffset); - let state = initialState; - let tokenOffset: number = 0; - let tokenType: number = void 0; - let tokenError: string; - - let hasSpaceAfterTag: boolean; - let lastTag: string; - let lastAttributeName: string; - let lastTypeValue: string; - - function nextElementName(): string { - return stream.advanceIfRegExp(/^[_:\w][_:\w-.\d]*/).toLowerCase(); - } - - function nextAttributeName(): string { - return stream.advanceIfRegExp(/^[^\s"'>/=\x00-\x0F\x7F\x80-\x9F]*/).toLowerCase(); - } - - function finishToken(offset: number, type: TokenType, errorMessage?: string): TokenType { - tokenType = type; - tokenOffset = offset; - tokenError = errorMessage; - return type; - } - - function scan(): TokenType { - let offset = stream.pos(); - let oldState = state; - let token = internalScan(); - if (token !== TokenType.EOS && offset === stream.pos()) { - 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(): TokenType { - let offset = stream.pos(); - if (stream.eos()) { - return finishToken(offset, TokenType.EOS); - } - let errorMessage; - - 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])) { // |<\/?script\s*\/?>?/i); - if (match.length === 0) { - stream.goToEnd(); - return finishToken(offset, TokenType.Script); - } else if (match === '') { - sciptState = 1; - } else if (match[1] !== '/') { // state, + getTokenEnd: () => stream.pos(), + getTokenError: () => tokenError, + getTokenLength: () => stream.pos() - tokenOffset, + getTokenOffset: () => tokenOffset, + getTokenText: () => stream.getSource().substring(tokenOffset, stream.pos()), + getTokenType: () => tokenType, + scan, + }; } diff --git a/src/server/aurelia-languageservice/parser/models.ts b/src/server/aurelia-languageservice/parser/models.ts index 3a2cab64..d30b98ba 100644 --- a/src/server/aurelia-languageservice/parser/models.ts +++ b/src/server/aurelia-languageservice/parser/models.ts @@ -1,15 +1,15 @@ -export interface ITagSet { - [tag: string]: HTMLTagSpecification; +export interface TagSet { + [tag: string]: HTMLTagSpecification; } -export interface IAttributeSet { - [tag: string]: Array; +export interface AttributeSet { + [tag: string]: Array; } -export interface IEventSet { - [tag: string]: Array; +export interface EventSet { + [tag: string]: Array; } export class HTMLAttributeSpecification { constructor(public name: string, public dataBindings = [], public hasBody = true, public defaultAttribute = true) { } } export class HTMLTagSpecification { - constructor(public label: string, public attributes: HTMLAttributeSpecification[] = []) { } + constructor(public label: string, public attributes: HTMLAttributeSpecification[] = []) { } } diff --git a/src/server/aurelia-languageservice/services/htmlCompletion.ts b/src/server/aurelia-languageservice/services/htmlCompletion.ts index ffae55d6..8cbb39cc 100644 --- a/src/server/aurelia-languageservice/services/htmlCompletion.ts +++ b/src/server/aurelia-languageservice/services/htmlCompletion.ts @@ -1,199 +1,201 @@ import { TextDocument, Position, CompletionList, CompletionItemKind, Range } from 'vscode-languageserver-types'; import { HTMLDocument } from '../parser/htmlParser'; -import { TokenType, createScanner, ScannerState } from '../parser/htmlScanner' -import { getAureliaTagProvider } from '../parser/aureliaTagProvider' - -export interface IHTMLTagProvider { - getId(): string; - isApplicable(languageId: string); - collectTags(collector: (tag: string, label: string) => void): void; - collectAttributes(tag: string, collector: (attribute: string, type: string) => void): void; - collectValues(tag: string, attribute: string, collector: (value: string) => void): void; +import { TokenType, createScanner, ScannerState } from '../parser/htmlScanner'; +import { getAureliaTagProvider } from '../parser/aureliaTagProvider'; + +export interface HTMLTagProvider { + getId(): string; + isApplicable(languageId: string); + collectTags(collector: (tag: string, label: string) => void): void; + collectAttributes(tag: string, collector: (attribute: string, type: string) => void): void; + collectValues(tag: string, attribute: string, collector: (value: string) => void): void; } export function doComplete(document: TextDocument, position: Position, htmlDocument: HTMLDocument, quotes: string): CompletionList { - let quote = '"'; + let quote = '"'; if (quotes === 'single') { quote = '\''; } let tagProvider = getAureliaTagProvider(); - let result: CompletionList = { - isIncomplete: false, - items: [] - }; + let result: CompletionList = { + isIncomplete: false, + items: [], + }; let offset = document.offsetAt(position); - let node = htmlDocument.findNodeBefore(offset); + let node = htmlDocument.findNodeBefore(offset); let text = document.getText(); - let scanner = createScanner(text, node.start); - let currentTag: string; - let currentAttributeName: string; + let currentAttributeName: string; let token = scanner.scan(); function getReplaceRange(replaceStart: number, replaceEnd: number = offset): Range { - if (replaceStart > offset) { - replaceStart = offset; - } - return { start: document.positionAt(replaceStart), end: document.positionAt(replaceEnd) }; - } - - function collectOpenTagSuggestions(afterOpenBracket: number, tagNameEnd?: number): CompletionList { - let range = getReplaceRange(afterOpenBracket, tagNameEnd); + if (replaceStart > offset) { + replaceStart = offset; + } + return { + end: document.positionAt(replaceEnd), + start: document.positionAt(replaceStart), + }; + } + + function collectOpenTagSuggestions(afterOpenBracket: number, tagNameEnd?: number): CompletionList { + let range = getReplaceRange(afterOpenBracket, tagNameEnd); tagProvider.collectTags((tag, label) => { result.items.push({ - label: tag, - kind: CompletionItemKind.Property, documentation: label, - textEdit: { newText: tag, range: range } + kind: CompletionItemKind.Property, + label: tag, + textEdit: { newText: tag, range: range }, }); - }); - return result; - } - - function collectTagSuggestions(tagStart: number, tagEnd: number): CompletionList { - collectOpenTagSuggestions(tagStart, tagEnd); - return result; - } - - function collectAttributeNameSuggestions(nameStart: number, nameEnd: number = offset): CompletionList { - let range = getReplaceRange(nameStart, nameEnd); - let value = isFollowedBy(text, nameEnd, ScannerState.AfterAttributeName, TokenType.DelimiterAssign) ? '' : '=' + quote + '{{}}' + quote; + }); + return result; + } + + function collectTagSuggestions(tagStart: number, tagEnd: number): CompletionList { + collectOpenTagSuggestions(tagStart, tagEnd); + return result; + } + + function collectAttributeNameSuggestions(nameStart: number, nameEnd: number = offset): CompletionList { + let range = getReplaceRange(nameStart, nameEnd); + let value = isFollowedBy(text, nameEnd, ScannerState.AfterAttributeName, TokenType.DelimiterAssign) ? '' : '=' + quote + '{{}}' + quote; tagProvider.collectAttributes(currentTag, (attribute, type) => { let codeSnippet = attribute; if (type !== 'v' && value.length) { codeSnippet = codeSnippet + value; } result.items.push({ - label: attribute, kind: type === 'handler' ? CompletionItemKind.Function : CompletionItemKind.Value, - textEdit: { newText: codeSnippet, range: range } + label: attribute, + textEdit: { newText: codeSnippet, range: range }, }); }); - return result; - } - - function collectAttributeValueSuggestions(valueStart: number, valueEnd?: number): CompletionList { - let range: Range; - let addQuotes: boolean; - if (offset > valueStart && offset <= valueEnd && text[valueStart] === quote) { - // inside attribute - if (valueEnd > offset && text[valueEnd-1] === quote) { - valueEnd--; - } - let wsBefore = getWordStart(text, offset, valueStart + 1); - let wsAfter = getWordEnd(text, offset, valueEnd); - range = getReplaceRange(wsBefore, wsAfter); - addQuotes = false - } else { - range = getReplaceRange(valueStart, valueEnd); - addQuotes = true; - } + return result; + } + + function collectAttributeValueSuggestions(valueStart: number, valueEnd?: number): CompletionList { + let range: Range; + let addQuotes: boolean; + if (offset > valueStart && offset <= valueEnd && text[valueStart] === quote) { + // inside attribute + if (valueEnd > offset && text[valueEnd - 1] === quote) { + valueEnd--; + } + let wsBefore = getWordStart(text, offset, valueStart + 1); + let wsAfter = getWordEnd(text, offset, valueEnd); + range = getReplaceRange(wsBefore, wsAfter); + addQuotes = false; + } else { + range = getReplaceRange(valueStart, valueEnd); + addQuotes = true; + } tagProvider.collectValues(currentTag, currentAttributeName, (value) => { let codeSnippet = addQuotes ? quote + value + quote : value; result.items.push({ - label: value, filterText: codeSnippet, kind: CompletionItemKind.Unit, - textEdit: { newText: codeSnippet, range: range } + label: value, + textEdit: { newText: codeSnippet, range: range }, }); }); - return result; - } - - function scanNextForEndPos(nextToken: TokenType) : number { - if (offset === scanner.getTokenEnd()) { - token = scanner.scan(); - if (token === nextToken && scanner.getTokenOffset() === offset) { - return scanner.getTokenEnd(); - } - } - return offset; - } + return result; + } + function scanNextForEndPos(nextToken: TokenType): number { + if (offset === scanner.getTokenEnd()) { + token = scanner.scan(); + if (token === nextToken && scanner.getTokenOffset() === offset) { + return scanner.getTokenEnd(); + } + } + return offset; + } while (token !== TokenType.EOS && scanner.getTokenOffset() <= offset) { - switch (token) { - case TokenType.StartTagOpen: - if (scanner.getTokenEnd() === offset) { - let endPos = scanNextForEndPos(TokenType.StartTag); - return collectTagSuggestions(offset, endPos); - } - break; - case TokenType.StartTag: - if (scanner.getTokenOffset() <= offset && offset <= scanner.getTokenEnd()) { - return collectOpenTagSuggestions(scanner.getTokenOffset(), scanner.getTokenEnd()); - } - currentTag = scanner.getTokenText(); - break; - case TokenType.AttributeName: - if (scanner.getTokenOffset() <= offset && offset <= scanner.getTokenEnd()) { - return collectAttributeNameSuggestions(scanner.getTokenOffset(), scanner.getTokenEnd()); - } - currentAttributeName = scanner.getTokenText(); - break; - case TokenType.DelimiterAssign: - if (scanner.getTokenEnd() === offset) { - return collectAttributeValueSuggestions(scanner.getTokenEnd()); - } - break; - case TokenType.AttributeValue: - if (scanner.getTokenOffset() <= offset && offset <= scanner.getTokenEnd()) { - return collectAttributeValueSuggestions(scanner.getTokenOffset(), scanner.getTokenEnd()); - } - break; - case TokenType.Whitespace: - if (offset <= scanner.getTokenEnd()) { - switch (scanner.getScannerState()) { - case ScannerState.AfterOpeningStartTag: - let startPos = scanner.getTokenOffset(); - let endTagPos = scanNextForEndPos(TokenType.StartTag); - return collectTagSuggestions(startPos, endTagPos); - case ScannerState.WithinTag: - case ScannerState.AfterAttributeName: - return collectAttributeNameSuggestions(scanner.getTokenEnd()); - case ScannerState.BeforeAttributeValue: - return collectAttributeValueSuggestions(scanner.getTokenEnd()); - } - } - break; - } - token = scanner.scan(); - } - - return result; + // tslint:disable-next-line:switch-default + switch (token) { + case TokenType.StartTagOpen: + if (scanner.getTokenEnd() === offset) { + let endPos = scanNextForEndPos(TokenType.StartTag); + return collectTagSuggestions(offset, endPos); + } + break; + case TokenType.StartTag: + if (scanner.getTokenOffset() <= offset && offset <= scanner.getTokenEnd()) { + return collectOpenTagSuggestions(scanner.getTokenOffset(), scanner.getTokenEnd()); + } + currentTag = scanner.getTokenText(); + break; + case TokenType.AttributeName: + if (scanner.getTokenOffset() <= offset && offset <= scanner.getTokenEnd()) { + return collectAttributeNameSuggestions(scanner.getTokenOffset(), scanner.getTokenEnd()); + } + currentAttributeName = scanner.getTokenText(); + break; + case TokenType.DelimiterAssign: + if (scanner.getTokenEnd() === offset) { + return collectAttributeValueSuggestions(scanner.getTokenEnd()); + } + break; + case TokenType.AttributeValue: + if (scanner.getTokenOffset() <= offset && offset <= scanner.getTokenEnd()) { + return collectAttributeValueSuggestions(scanner.getTokenOffset(), scanner.getTokenEnd()); + } + break; + case TokenType.Whitespace: + if (offset <= scanner.getTokenEnd()) { + // tslint:disable-next-line:switch-default + switch (scanner.getScannerState()) { + case ScannerState.AfterOpeningStartTag: + let startPos = scanner.getTokenOffset(); + let endTagPos = scanNextForEndPos(TokenType.StartTag); + return collectTagSuggestions(startPos, endTagPos); + case ScannerState.WithinTag: + case ScannerState.AfterAttributeName: + return collectAttributeNameSuggestions(scanner.getTokenEnd()); + case ScannerState.BeforeAttributeValue: + return collectAttributeValueSuggestions(scanner.getTokenEnd()); + } + } + break; + } + token = scanner.scan(); + } + + return result; } function isWhiteSpace(s: string): boolean { - return /^\s*$/.test(s); + return /^\s*$/.test(s); } -function isWhiteSpaceOrQuote(s: string): boolean { - return /^[\s"]*$/.test(s); -} +// function isWhiteSpaceOrQuote(s: string): boolean { +// return /^[\s"]*$/.test(s); +// } -function isFollowedBy(s: string, offset:number, intialState: ScannerState, expectedToken: TokenType) { - let scanner = createScanner(s, offset, intialState); - let token = scanner.scan(); - while (token === TokenType.Whitespace) { - token = scanner.scan(); - } - return token == expectedToken; +function isFollowedBy(s: string, offset: number, intialState: ScannerState, expectedToken: TokenType) { + let scanner = createScanner(s, offset, intialState); + let token = scanner.scan(); + while (token === TokenType.Whitespace) { + token = scanner.scan(); + } + return token === expectedToken; } function getWordStart(s: string, offset: number, limit: number): number { - while (offset > limit && !isWhiteSpace(s[offset-1])) { - offset--; - } - return offset; + while (offset > limit && !isWhiteSpace(s[offset - 1])) { + offset--; + } + return offset; } function getWordEnd(s: string, offset: number, limit: number): number { - while (offset < limit && !isWhiteSpace(s[offset])) { - offset++; - } - return offset; + while (offset < limit && !isWhiteSpace(s[offset])) { + offset++; + } + return offset; } diff --git a/src/server/aurelia-languageservice/services/htmlValidation.ts b/src/server/aurelia-languageservice/services/htmlValidation.ts index 1f0fe057..87e07f88 100644 --- a/src/server/aurelia-languageservice/services/htmlValidation.ts +++ b/src/server/aurelia-languageservice/services/htmlValidation.ts @@ -1,129 +1,114 @@ 'use strict'; -//import { commands } from 'vscode'; -import { Files } from 'vscode-languageserver'; -import { Diagnostic, DiagnosticSeverity, Range, SymbolInformation, SymbolKind, TextDocument } from 'vscode-languageserver-types'; -import { LanguageSettings } from "../aureliaLanguageService"; +import { Diagnostic, DiagnosticSeverity, Range, TextDocument } from 'vscode-languageserver-types'; +import { LanguageSettings } from '../aureliaLanguageService'; import { HTMLDocument } from '../parser/htmlParser'; -import { TokenType, createScanner, ScannerState } from '../parser/htmlScanner' -import * as fs from 'fs'; -import * as path from 'path'; +import { TokenType, createScanner } from '../parser/htmlScanner'; export type DiagnosticCodes = 'invalid-casing' | 'invalid-method'; export const DiagnosticCodes = { - InvalidCasing: 'invalid-casing' as DiagnosticCodes, - InvalidMethod: 'invalid-method' as DiagnosticCodes -} + InvalidCasing: 'invalid-casing' as DiagnosticCodes, + InvalidMethod: 'invalid-method' as DiagnosticCodes, +}; export const DiagnosticSource = 'Aurelia'; interface Attribute { - name: string; - start: number; - length: number; - value?: string; + name: string; + start: number; + length: number; + value?: string; } const kebabCaseValidationRegex = /(.*)\.(bind|one-way|two-way|one-time|call|delegate|trigger)/; -const methodRegex = /\"(.*)\(/; +// const methodRegex = /\"(.*)\(/; -function kebabToCamel(s: string) { - return s.replace(/(\-\w)/g, m => m[1].toUpperCase()); -} +// function kebabToCamel(s: string) { +// return s.replace(/(\-\w)/g, m => m[1].toUpperCase()); +// } function camelToKebab(s: string) { - return s.replace(/\.?([A-Z])/g, (x, y) => "-" + y.toLowerCase()).replace(/^-/, ""); + return s.replace(/\.?([A-Z])/g, (x, y) => '-' + y.toLowerCase()).replace(/^-/, ''); } export class HTMLValidation { - private validationEnabled: boolean; - - constructor() { - this.validationEnabled = true; - } - - public configure(raw: LanguageSettings) { - if (raw) { - this.validationEnabled = raw.validate; - } - } - - async doValidation(document: TextDocument, htmlDocument: HTMLDocument): Promise { - if (!this.validationEnabled) return Promise.resolve([]); - - const text = document.getText(); - const scanner = createScanner(text, htmlDocument.roots[0].start); - - const diagnostics: Diagnostic[] = []; - - let attr; - let token = scanner.scan(); - while (token !== TokenType.EOS) { - switch (token) { - case TokenType.AttributeName: - attr = { - name: scanner.getTokenText(), - start: scanner.getTokenOffset(), - length: scanner.getTokenLength() - }; - break; - case TokenType.AttributeValue: - attr.value = scanner.getTokenText(); - await this._validateAttribute(attr, document, diagnostics); - break; - } - token = scanner.scan(); - } - - return Promise.resolve(diagnostics); - } - - private async _validateAttribute(attr: Attribute, document: TextDocument, diagnostics: Diagnostic[]) { - 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}'`, - DiagnosticCodes.InvalidCasing)); - } - - // if (op === 'call' || op === 'trigger' || op === 'delegate') { - // match = methodRegex.exec(attr.value); - // const method = match[1]; - - // const parseFilename = path.parse(Files.uriToFilePath(document.uri)); - // let codeBehindFilename = path.join(parseFilename.dir, `${parseFilename.name}.ts`); - - // if (!fs.existsSync(codeBehindFilename)) { - // codeBehindFilename = path.join(parseFilename.dir, `${parseFilename.name}.js`); - // if (!fs.existsSync(codeBehindFilename)) return Promise.resolve(); - // } - - // // Can't access vscode commands here -- do we really need to talk directly to the typescript language service? - // const symbols = await >commands.executeCommand('vscode.executeDocumentSymbolProvider', Uri.file(codeBehindFilename)); - // if (!symbols.some(s => (s.kind === SymbolKind.Function || s.kind === SymbolKind.Method) && s.name === method)) { - // diagnostics.push(this.toDiagnostic(attr, document, `'${method}' is missing from ${kebabToCamel(prop)}`)); - // } - // } - } - - return Promise.resolve(); - } - - private toDiagnostic(attr: Attribute, document: TextDocument, message: string, code: DiagnosticCodes | undefined = undefined, serverity: DiagnosticSeverity = DiagnosticSeverity.Error): Diagnostic { - const range = Range.create(document.positionAt(attr.start), document.positionAt(attr.start + attr.length)); - const diagnostic = { - message: message, - range: range, - severity: serverity, - source: DiagnosticSource - }; - - if (code !== undefined) { - diagnostic.code = code; - } - return diagnostic; - } + private validationEnabled: boolean; + + constructor() { + this.validationEnabled = true; + } + + public configure(raw: LanguageSettings) { + if (raw) { + this.validationEnabled = raw.validate; + } + } + + public async doValidation(document: TextDocument, htmlDocument: HTMLDocument): Promise { + if (!this.validationEnabled) { + return Promise.resolve([]); + } + + const text = document.getText(); + const scanner = createScanner(text, htmlDocument.roots[0].start); + + const diagnostics: Diagnostic[] = []; + + let attr; + let token = scanner.scan(); + while (token !== TokenType.EOS) { + // tslint:disable-next-line:switch-default + switch (token) { + case TokenType.AttributeName: + attr = { + length: scanner.getTokenLength(), + name: scanner.getTokenText(), + start: scanner.getTokenOffset(), + }; + break; + case TokenType.AttributeValue: + attr.value = scanner.getTokenText(); + await this.validateAttribute(attr, document, diagnostics); + break; + } + token = scanner.scan(); + } + + return Promise.resolve(diagnostics); + } + + private async validateAttribute(attr: Attribute, document: TextDocument, diagnostics: Diagnostic[]) { + 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}'`, + DiagnosticCodes.InvalidCasing)); + } + } + + return Promise.resolve(); + } + + private toDiagnostic( + attr: Attribute, + document: TextDocument, + message: string, + code: DiagnosticCodes | undefined = undefined, + serverity: DiagnosticSeverity = DiagnosticSeverity.Error): Diagnostic { + const range = Range.create(document.positionAt(attr.start), document.positionAt(attr.start + attr.length)); + const diagnostic = { + message: message, + range: range, + severity: serverity, + source: DiagnosticSource, + }; + + if (code !== undefined) { + diagnostic.code = code; + } + return diagnostic; + } } diff --git a/src/server/languageModelCache.ts b/src/server/languageModelCache.ts index 3022c55b..2891d611 100644 --- a/src/server/languageModelCache.ts +++ b/src/server/languageModelCache.ts @@ -3,77 +3,83 @@ import { TextDocument } from 'vscode-languageserver'; export interface LanguageModelCache { - get(document: TextDocument): T; - onDocumentRemoved(document: TextDocument): void; - dispose(): void; + get(document: TextDocument): T; + onDocumentRemoved(document: TextDocument): void; + dispose(): void; } -export function getLanguageModelCache(maxEntries: number, cleanupIntervalTimeInSec: number, parse: (document: TextDocument) => T): LanguageModelCache { - let languageModels: { [uri: string]: { version: number, languageId: string, cTime: number, languageModel: T } } = {}; - let nModels = 0; +export function getLanguageModelCache( + maxEntries: number, + cleanupIntervalTimeInSec: number, + parse: (document: TextDocument) => T): LanguageModelCache { + let languageModels: { [uri: string]: { version: number, languageId: string, cTime: number, languageModel: T } } = {}; + 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); - } + 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: TextDocument): T { - 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++; - } + return { + get(document: TextDocument): T { + 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) { - let languageModelInfo = languageModels[uri]; - if (languageModelInfo.cTime < oldestTime) { - oldestUri = uri; - oldestTime = languageModelInfo.cTime; - } - } - if (oldestUri) { - delete languageModels[oldestUri]; - nModels--; - } - } - return languageModel; + 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: TextDocument) { - let uri = document.uri; - if (languageModels[uri]) { - delete languageModels[uri]; - nModels--; - } - }, - dispose() { - if (typeof cleanupInterval !== 'undefined') { - clearInterval(cleanupInterval); - cleanupInterval = void 0; - languageModels = {}; - nModels = 0; - } - } - }; + }, + onDocumentRemoved(document: TextDocument) { + let uri = document.uri; + if (languageModels[uri]) { + delete languageModels[uri]; + nModels--; + } + }, + dispose() { + if (typeof cleanupInterval !== 'undefined') { + clearInterval(cleanupInterval); + cleanupInterval = void 0; + languageModels = {}; + nModels = 0; + } + }, + }; } diff --git a/src/server/main.ts b/src/server/main.ts index a98d4ea9..886f8ec1 100644 --- a/src/server/main.ts +++ b/src/server/main.ts @@ -11,23 +11,23 @@ documents.listen(connection); let htmlDocuments = getLanguageModelCache(10, 60, document => getLanguageService().parseHTMLDocument(document)); documents.onDidClose(e => { - htmlDocuments.onDocumentRemoved(e.document); + htmlDocuments.onDocumentRemoved(e.document); }); connection.onShutdown(() => { - htmlDocuments.dispose(); + htmlDocuments.dispose(); }); let workspacePath: string; connection.onInitialize((params: InitializeParams): InitializeResult => { - workspacePath = params.rootPath; - return { - capabilities: { - textDocumentSync: documents.syncKind, - completionProvider: { resolveProvider: false, triggerCharacters: ['.', '<'] } - } - }; + workspacePath = params.rootPath; + return { + capabilities: { + completionProvider: { resolveProvider: false, triggerCharacters: ['.', '<'] }, + textDocumentSync: documents.syncKind, + }, + }; }); let aureliaSettings; @@ -36,15 +36,15 @@ connection.onDidChangeConfiguration(change => aureliaSettings = change.settings. let languageService = getLanguageService(); documents.onDidChangeContent(async change => { - let htmlDocument = htmlDocuments.get(change.document); - const diagnostics = await languageService.doValidation(change.document, htmlDocument); - connection.sendDiagnostics({ uri: change.document.uri, diagnostics }); + let htmlDocument = htmlDocuments.get(change.document); + const diagnostics = await 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); + let document = documents.get(textDocumentPosition.textDocument.uri); + let htmlDocument = htmlDocuments.get(document); + return languageService.doComplete(document, textDocumentPosition.position, htmlDocument, aureliaSettings.autocomplete.quotes); }); connection.listen(); diff --git a/test/syntax.html/as-element.test.ts b/test/syntax.html/as-element.test.ts index 1f5c937c..fc7afc3c 100644 --- a/test/syntax.html/as-element.test.ts +++ b/test/syntax.html/as-element.test.ts @@ -1,5 +1,5 @@ import { assert } from 'chai'; -import { getTokenOnCharRange, hasScope, tokenizeLine, writeOut } from './test.utils'; +import { getTokenOnCharRange, hasScope, tokenizeLine } from './test.utils'; describe('The Aurelia HTML syntax as-element attribute', () => { @@ -57,7 +57,7 @@ describe('The Aurelia HTML syntax as-element attribute', () => { let token = getTokenOnCharRange(lineToken, 12, 22); assert.isOk(!hasScope(token.scopes, scope)); - }); + }); it(`must not tokenize class='as-element' attribute body with scope "as-element.attribute.html.au"`, () => { @@ -71,7 +71,7 @@ describe('The Aurelia HTML syntax as-element attribute', () => { let token = getTokenOnCharRange(lineToken, 12, 22); assert.isOk(!hasScope(token.scopes, scope)); - }); + }); it(`must not tokenize (someas-element)="item-template" attribute body with scope "as-element.attribute.html.au"`, () => { @@ -85,7 +85,7 @@ describe('The Aurelia HTML syntax as-element attribute', () => { let token = getTokenOnCharRange(lineToken, 10, 24); assert.isOk(!hasScope(token.scopes, scope)); - }); + }); it(`must not tokenize (someas-element)='item-template' attribute body with scope "as-element.attribute.html.au"`, () => { @@ -99,7 +99,7 @@ describe('The Aurelia HTML syntax as-element attribute', () => { let token = getTokenOnCharRange(lineToken, 10, 24); assert.isOk(!hasScope(token.scopes, scope)); - }); + }); it(`must not tokenize (as-elementsome)="item-template" attribute body with scope "as-element.attribute.html.au"`, () => { @@ -113,7 +113,7 @@ describe('The Aurelia HTML syntax as-element attribute', () => { let token = getTokenOnCharRange(lineToken, 10, 24); assert.isOk(!hasScope(token.scopes, scope)); - }); + }); it(`must not tokenize (as-elementsome)='item-template' attribute body with scope "as-element.attribute.html.au"`, () => { @@ -127,7 +127,7 @@ describe('The Aurelia HTML syntax as-element attribute', () => { let token = getTokenOnCharRange(lineToken, 10, 24); assert.isOk(!hasScope(token.scopes, scope)); - }); + }); it(`must not tokenize (as-element-some)="item-template" attribute body with scope "as-element.attribute.html.au"`, () => { @@ -141,7 +141,7 @@ describe('The Aurelia HTML syntax as-element attribute', () => { let token = getTokenOnCharRange(lineToken, 10, 25); assert.isOk(!hasScope(token.scopes, scope)); - }); + }); it(`must not tokenize (as-element-some)='item-template' attribute body with scope "as-element.attribute.html.au"`, () => { @@ -155,7 +155,7 @@ describe('The Aurelia HTML syntax as-element attribute', () => { let token = getTokenOnCharRange(lineToken, 10, 25); assert.isOk(!hasScope(token.scopes, scope)); - }); + }); it(`must not tokenize (some-as-element)="item-template" attribute body with scope "as-element.attribute.html.au"`, () => { @@ -169,7 +169,7 @@ describe('The Aurelia HTML syntax as-element attribute', () => { let token = getTokenOnCharRange(lineToken, 10, 25); assert.isOk(!hasScope(token.scopes, scope)); - }); + }); it(`must not tokenize (some-as-element)='item-template' attribute body with scope "as-element.attribute.html.au"`, () => { @@ -184,5 +184,5 @@ describe('The Aurelia HTML syntax as-element attribute', () => { assert.isOk(!hasScope(token.scopes, scope)); }); - + }); diff --git a/test/syntax.html/databinding.test.ts b/test/syntax.html/databinding.test.ts index bba324ee..efa05cfb 100644 --- a/test/syntax.html/databinding.test.ts +++ b/test/syntax.html/databinding.test.ts @@ -1,5 +1,5 @@ import { assert } from 'chai'; -import { getTokenOnCharRange, hasScope, tokenizeLine, writeOut } from './test.utils'; +import { getTokenOnCharRange, hasScope, tokenizeLine } from './test.utils'; describe('The Aurelia HTML syntax databinding attributes', () => { @@ -85,7 +85,7 @@ describe('The Aurelia HTML syntax databinding attributes', () => { let token = getTokenOnCharRange(lineToken, 8, 17); assert.isOk(!hasScope(token.scopes, scope)); - }); + }); it(`must not tokenize a="x.(bind)='x'; x" attribute with scope "databinding.attribute.html.au"`, () => { @@ -99,7 +99,7 @@ describe('The Aurelia HTML syntax databinding attributes', () => { let token = getTokenOnCharRange(lineToken, 8, 21); assert.isOk(!hasScope(token.scopes, scope)); - }); + }); it(`must not tokenize a="x.(one-way)" attribute with scope "databinding.attribute.html.au"`, () => { diff --git a/test/syntax.html/if.test.ts b/test/syntax.html/if.test.ts index cc0be43f..a6f061eb 100644 --- a/test/syntax.html/if.test.ts +++ b/test/syntax.html/if.test.ts @@ -253,6 +253,6 @@ describe(`The Aurelia HTML syntax if attribute`, () => { let token = getTokenOnCharRange(lineToken, 8, 16); assert.isOk(!hasScope(token.scopes, scope)); - }); + }); }); diff --git a/test/syntax.html/invoke.test.ts b/test/syntax.html/invoke.test.ts index e8cb3085..038f287d 100644 --- a/test/syntax.html/invoke.test.ts +++ b/test/syntax.html/invoke.test.ts @@ -43,7 +43,7 @@ describe('The Aurelia HTML syntax invoke attributes', () => { let token = getTokenOnCharRange(lineToken, 17, 30); assert.isOk(hasScope(token.scopes, scope)); - }); + }); it('must not tokenize invokes in attribute body with scope "invoke.attribute.html.au"', () => { @@ -57,7 +57,7 @@ describe('The Aurelia HTML syntax invoke attributes', () => { let token = getTokenOnCharRange(lineToken, 6, 29); assert.isOk(hasScope(token.scopes, scope)); - }); + }); it('must tokenize delegate attribute with scope "invoke.attribute.html.au"', () => { diff --git a/test/syntax.html/replace-part.test.ts b/test/syntax.html/replace-part.test.ts index 8aaba4d6..f95841e7 100644 --- a/test/syntax.html/replace-part.test.ts +++ b/test/syntax.html/replace-part.test.ts @@ -1,5 +1,5 @@ import { assert } from 'chai'; -import { getTokenOnCharRange, hasScope, tokenizeLine, writeOut } from './test.utils'; +import { getTokenOnCharRange, hasScope, tokenizeLine } from './test.utils'; describe('The Aurelia HTML syntax replace-part attribute', () => { @@ -57,7 +57,7 @@ describe('The Aurelia HTML syntax replace-part attribute', () => { let token = getTokenOnCharRange(lineToken, 12, 24); assert.isOk(!hasScope(token.scopes, scope)); - }); + }); it(`must not tokenize class='replace-part' attribute body with scope "replace-part.attribute.html.au"`, () => { @@ -71,7 +71,7 @@ describe('The Aurelia HTML syntax replace-part attribute', () => { let token = getTokenOnCharRange(lineToken, 12, 24); assert.isOk(!hasScope(token.scopes, scope)); - }); + }); it(`must not tokenize (somereplace-part)="item-template" attribute body with scope "replace-part.attribute.html.au"`, () => { @@ -85,7 +85,7 @@ describe('The Aurelia HTML syntax replace-part attribute', () => { let token = getTokenOnCharRange(lineToken, 10, 26); assert.isOk(!hasScope(token.scopes, scope)); - }); + }); it(`must not tokenize (somereplace-part)='item-template' attribute body with scope "replace-part.attribute.html.au"`, () => { @@ -99,7 +99,7 @@ describe('The Aurelia HTML syntax replace-part attribute', () => { let token = getTokenOnCharRange(lineToken, 10, 26); assert.isOk(!hasScope(token.scopes, scope)); - }); + }); it(`must not tokenize (replace-partsome)="item-template" attribute body with scope "replace-part.attribute.html.au"`, () => { @@ -113,7 +113,7 @@ describe('The Aurelia HTML syntax replace-part attribute', () => { let token = getTokenOnCharRange(lineToken, 10, 26); assert.isOk(!hasScope(token.scopes, scope)); - }); + }); it(`must not tokenize (replace-partsome)='item-template' attribute body with scope "replace-part.attribute.html.au"`, () => { @@ -127,7 +127,7 @@ describe('The Aurelia HTML syntax replace-part attribute', () => { let token = getTokenOnCharRange(lineToken, 10, 26); assert.isOk(!hasScope(token.scopes, scope)); - }); + }); it(`must not tokenize (replace-part-some)="item-template" attribute body with scope "replace-part.attribute.html.au"`, () => { @@ -141,7 +141,7 @@ describe('The Aurelia HTML syntax replace-part attribute', () => { let token = getTokenOnCharRange(lineToken, 10, 27); assert.isOk(!hasScope(token.scopes, scope)); - }); + }); it(`must not tokenize (replace-part-some)='item-template' attribute body with scope "replace-part.attribute.html.au"`, () => { @@ -155,7 +155,7 @@ describe('The Aurelia HTML syntax replace-part attribute', () => { let token = getTokenOnCharRange(lineToken, 10, 27); assert.isOk(!hasScope(token.scopes, scope)); - }); + }); it(`must not tokenize (some-replace-part)="item-template" attribute body with scope "replace-part.attribute.html.au"`, () => { @@ -169,7 +169,7 @@ describe('The Aurelia HTML syntax replace-part attribute', () => { let token = getTokenOnCharRange(lineToken, 10, 27); assert.isOk(!hasScope(token.scopes, scope)); - }); + }); it(`must not tokenize (some-replace-part)='item-template' attribute body with scope "replace-part.attribute.html.au"`, () => { @@ -184,5 +184,5 @@ describe('The Aurelia HTML syntax replace-part attribute', () => { assert.isOk(!hasScope(token.scopes, scope)); }); - + }); diff --git a/test/syntax.html/replaceable.test.ts b/test/syntax.html/replaceable.test.ts index b00ab728..b596f89f 100644 --- a/test/syntax.html/replaceable.test.ts +++ b/test/syntax.html/replaceable.test.ts @@ -85,7 +85,7 @@ describe('The Aurelia HTML syntax replaceable attribute', () => { let token = getTokenOnCharRange(lineToken, 10, 21); assert.isOk(hasScope(token.scopes, scope)); - }); + }); it(`must not tokenize class="replaceable" attribute body with scope "replaceable.attribute.html.au"`, () => { @@ -295,6 +295,6 @@ describe('The Aurelia HTML syntax replaceable attribute', () => { let token = getTokenOnCharRange(lineToken, 5, 20); assert.isOk(!hasScope(token.scopes, scope)); - }); + }); }); diff --git a/test/syntax.html/route-href.test.ts b/test/syntax.html/route-href.test.ts index f17a5ae9..fe387486 100644 --- a/test/syntax.html/route-href.test.ts +++ b/test/syntax.html/route-href.test.ts @@ -1,5 +1,5 @@ import { assert } from 'chai'; -import { getTokenOnCharRange, hasScope, tokenizeLine, writeOut } from './test.utils'; +import { getTokenOnCharRange, hasScope, tokenizeLine } from './test.utils'; describe('The Aurelia HTML syntax route-href attribute', () => { @@ -127,7 +127,7 @@ describe('The Aurelia HTML syntax route-href attribute', () => { let token = getTokenOnCharRange(lineToken, 3, 17); assert.isOk(!hasScope(token.scopes, scope)); - }); + }); it(`must not tokenize a="route-href" attribute with scope "route-href.attribute.html.au"`, () => { diff --git a/test/syntax.html/show.test.ts b/test/syntax.html/show.test.ts index 8cbc53f0..d75efd90 100644 --- a/test/syntax.html/show.test.ts +++ b/test/syntax.html/show.test.ts @@ -1,5 +1,5 @@ import { assert } from 'chai'; -import { getTokenOnCharRange, hasScope, tokenizeLine, writeOut } from './test.utils'; +import { getTokenOnCharRange, hasScope, tokenizeLine } from './test.utils'; describe('The Aurelia HTML syntax show attribute', () => { @@ -127,7 +127,7 @@ describe('The Aurelia HTML syntax show attribute', () => { let token = getTokenOnCharRange(lineToken, 5, 13); assert.isOk(!hasScope(token.scopes, scope)); - }); + }); it(`must not tokenize a="show" attribute with scope "show.attribute.html.au"`, () => { diff --git a/test/syntax.html/test.utils.ts b/test/syntax.html/test.utils.ts index 360ac12c..80dbbdf8 100644 --- a/test/syntax.html/test.utils.ts +++ b/test/syntax.html/test.utils.ts @@ -23,9 +23,11 @@ export function hasScope(scopes: Array, scope: string) { } export function writeOut(lineToken, text) { - for(let lt of lineToken.tokens) { + for (let lt of lineToken.tokens) { + // tslint:disable-next-line:no-console console.log(`${lt.startIndex} - ${lt.endIndex} => ${text.substring(lt.startIndex, lt.endIndex)}`); - for(let s of lt.scopes) { + for (let s of lt.scopes) { + // tslint:disable-next-line:no-console console.log(`- ${s}`); } } diff --git a/test/syntax.html/view-model.test.ts b/test/syntax.html/view-model.test.ts index 990fafd5..945da604 100644 --- a/test/syntax.html/view-model.test.ts +++ b/test/syntax.html/view-model.test.ts @@ -99,7 +99,7 @@ describe(`The Aurelia HTML syntax view-model attribute`, () => { let token = getTokenOnCharRange(lineToken, 5, 19); assert.isOk(!hasScope(token.scopes, scope)); - }); + }); it(`must tokenize (foo-view-model)="foo" attribute with scope "attribute.html.au"`, () => { @@ -113,7 +113,7 @@ describe(`The Aurelia HTML syntax view-model attribute`, () => { let token = getTokenOnCharRange(lineToken, 5, 19); assert.isOk(!hasScope(token.scopes, scope)); - }); + }); it(`must tokenize a="(view-model)" attribute with scope "attribute.html.au"`, () => { @@ -127,6 +127,6 @@ describe(`The Aurelia HTML syntax view-model attribute`, () => { let token = getTokenOnCharRange(lineToken, 8, 18); assert.isOk(!hasScope(token.scopes, scope)); - }); + }); }); diff --git a/test/syntax.html/view.test.ts b/test/syntax.html/view.test.ts index 25dd9ef6..dfa050c1 100644 --- a/test/syntax.html/view.test.ts +++ b/test/syntax.html/view.test.ts @@ -72,7 +72,7 @@ describe('The Aurelia HTML syntax view attribute', () => { assert.isOk(hasScope(token.scopes, scope)); }); - + it(`must not tokenize class='(view)' with scope "view.attribute.html.au"`, () => { // arrange @@ -143,7 +143,7 @@ describe('The Aurelia HTML syntax view attribute', () => { }); - it(`must not tokenize some-view="" with scope "view.attribute.html.au"`, () => { + it(`must not tokenize some-view="" with scope "view.attribute.html.au"`, () => { // arrange let scope = 'meta.tag.inline.any.html'; @@ -197,7 +197,7 @@ describe('The Aurelia HTML syntax view attribute', () => { let token = getTokenOnCharRange(lineToken, 9, 18); assert.isOk(hasScope(token.scopes, scope)); - }); + }); it('must tokenize (view).ref="foo"> attribute with scope "view.attribute.html.au"', () => { @@ -253,6 +253,6 @@ describe('The Aurelia HTML syntax view attribute', () => { let token = getTokenOnCharRange(lineToken, 9, 13); assert.isOk(hasScope(token.scopes, scope)); - }); + }); }); diff --git a/tslint.json b/tslint.json index dcd060a6..0f9339ce 100644 --- a/tslint.json +++ b/tslint.json @@ -2,7 +2,8 @@ "extends": "tslint:recommended", "rules": { "quotemark": [true, "single", "avoid-escape"], - "max-line-length": [true, 150] + "max-line-length": [true, 150], + "interface-name": [true, "never-prefix"] }, "rulesDirectory": [ ]