Initial code commit
This commit is contained in:
30
dist/worker/LanguageServiceWorker.js
vendored
Normal file
30
dist/worker/LanguageServiceWorker.js
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var LanguageService_1 = require("../language-service/LanguageService");
|
||||
var CosmosDBSqlLexer_1 = require("../cosmosdb-sql/generated/CosmosDBSqlLexer");
|
||||
var CosmosDBSqlParser_1 = require("../cosmosdb-sql/generated/CosmosDBSqlParser");
|
||||
var CosmosDBSqlKeywords_1 = require("../cosmosdb-sql/grammar/CosmosDBSqlKeywords");
|
||||
var ParseReason;
|
||||
(function (ParseReason) {
|
||||
ParseReason[ParseReason["GetCompletionWords"] = 1] = "GetCompletionWords";
|
||||
ParseReason[ParseReason["GetErrors"] = 2] = "GetErrors";
|
||||
})(ParseReason || (ParseReason = {}));
|
||||
var LanguageServiceWorker;
|
||||
(function (LanguageServiceWorker) {
|
||||
// Respond to message from parent thread
|
||||
onmessage = function (event) {
|
||||
var code = event.data.code;
|
||||
var reason = event.data.reason;
|
||||
var parseResults = [];
|
||||
var languageService = new LanguageService_1.LanguageService(CosmosDBSqlLexer_1.CosmosDBSqlLexer, CosmosDBSqlParser_1.CosmosDBSqlParser, CosmosDBSqlKeywords_1.CosmosDBSqlKeywords.keywordsRegisteredForCompletion);
|
||||
if (reason == ParseReason.GetCompletionWords) {
|
||||
parseResults = languageService.getCompletionWords(code);
|
||||
}
|
||||
else if (reason == ParseReason.GetErrors) {
|
||||
parseResults = languageService.getSyntaxErrors(code);
|
||||
}
|
||||
postMessage(parseResults, undefined);
|
||||
close();
|
||||
};
|
||||
})(LanguageServiceWorker = exports.LanguageServiceWorker || (exports.LanguageServiceWorker = {}));
|
||||
//# sourceMappingURL=LanguageServiceWorker.js.map
|
||||
1
dist/worker/LanguageServiceWorker.js.map
vendored
Normal file
1
dist/worker/LanguageServiceWorker.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"LanguageServiceWorker.js","sourceRoot":"","sources":["../../src/worker/LanguageServiceWorker.ts"],"names":[],"mappings":";;AAAA,uEAAsE;AACtE,+EAA8E;AAC9E,iFAAgF;AAChF,mFAAkF;AAElF,IAAK,WAGJ;AAHD,WAAK,WAAW;IACZ,yEAAsB,CAAA;IACtB,uDAAa,CAAA;AACjB,CAAC,EAHI,WAAW,KAAX,WAAW,QAGf;AAED,IAAc,qBAAqB,CAmBlC;AAnBD,WAAc,qBAAqB;IAC/B,wCAAwC;IACxC,SAAS,GAAG,UAAC,KAAmB;QAC5B,IAAM,IAAI,GAAW,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;QACrC,IAAM,MAAM,GAAY,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC;QAE1C,IAAI,YAAY,GAAG,EAAE,CAAC;QAEtB,IAAI,eAAe,GAAG,IAAI,iCAAe,CAAC,mCAAgB,EAAE,qCAAiB,EAAE,yCAAmB,CAAC,+BAA+B,CAAC,CAAC;QAEpI,IAAI,MAAM,IAAI,WAAW,CAAC,kBAAkB,EAAE;YAC1C,YAAY,GAAG,eAAe,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;SAC3D;aAAM,IAAI,MAAM,IAAI,WAAW,CAAC,SAAS,EAAE;YACxC,YAAY,GAAG,eAAe,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;SACxD;QAED,WAAW,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;QACrC,KAAK,EAAE,CAAC;IACZ,CAAC,CAAC;AACN,CAAC,EAnBa,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAmBlC"}
|
||||
29
dist/worker/webpack.config.js
vendored
Normal file
29
dist/worker/webpack.config.js
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
"use strict";
|
||||
module.exports = {
|
||||
entry: {
|
||||
LanguageServiceWorker: './LanguageServiceWorker.ts'
|
||||
},
|
||||
mode: 'production',
|
||||
target: 'web',
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.ts$/,
|
||||
use: 'ts-loader',
|
||||
exclude: /node_modules/
|
||||
}
|
||||
]
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.ts', '.js']
|
||||
},
|
||||
output: {
|
||||
globalObject: 'this',
|
||||
path: __dirname + "/dist",
|
||||
filename: '[name].js',
|
||||
library: '[name]',
|
||||
libraryTarget: 'umd'
|
||||
},
|
||||
node: { fs: "empty" }
|
||||
};
|
||||
//# sourceMappingURL=webpack.config.js.map
|
||||
1
dist/worker/webpack.config.js.map
vendored
Normal file
1
dist/worker/webpack.config.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"webpack.config.js","sourceRoot":"","sources":["../../src/worker/webpack.config.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,MAAM,CAAC,OAAO,GAAG;IACb,KAAK,EAAE;QACH,qBAAqB,EAAE,4BAA4B;KACtD;IACD,IAAI,EAAE,YAAY;IAClB,MAAM,EAAE,KAAK;IACb,MAAM,EAAE;QACJ,KAAK,EAAE;YACH;gBACI,IAAI,EAAE,OAAO;gBACb,GAAG,EAAE,WAAW;gBAChB,OAAO,EAAE,cAAc;aAC1B;SACJ;KACJ;IACD,OAAO,EAAE;QACL,UAAU,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;KAC7B;IACD,MAAM,EAAE;QACJ,YAAY,EAAE,MAAM;QACpB,IAAI,EAAE,SAAS,GAAG,OAAO;QACzB,QAAQ,EAAE,WAAW;QACrB,OAAO,EAAE,QAAQ;QACjB,aAAa,EAAE,KAAK;KACvB;IACD,IAAI,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE;CACxB,CAAC"}
|
||||
Reference in New Issue
Block a user