Initial commit

This commit is contained in:
2018-11-25 22:19:02 +01:00
commit 474bd3c2f7
27 changed files with 3175 additions and 0 deletions

82
Client/out/extension.js Normal file
View File

@@ -0,0 +1,82 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
const vscode = require("vscode");
const languageClient = require("vscode-languageclient");
const path = require("path");
const fs = require("fs");
// Defines the search path of your language server DLL. (.NET Core)
const languageServerPaths = [
"server/DemoLanguageServer.dll",
"../UpsilonLanguageServer/UpsilonLanguageServer/bin/Debug/netcoreapp2.1/UpsilonLanguageServer.dll"
];
function activateLanguageServer(context) {
// The server is implemented in an executable application.
let serverModule = null;
for (let p of languageServerPaths) {
p = context.asAbsolutePath(p);
// console.log(p);
if (fs.existsSync(p)) {
serverModule = p;
break;
}
}
if (!serverModule)
throw new URIError("Cannot find the language server module.");
let workPath = path.dirname(serverModule);
console.log(`Use ${serverModule} as server module.`);
console.log(`Work path: ${workPath}.`);
// If the extension is launched in debug mode then the debug server options are used
// Otherwise the run options are used
let serverOptions = {
run: {
command: "dotnet",
args: [serverModule],
options: { cwd: workPath }
},
debug: {
command: "dotnet",
args: [serverModule, "--debug"],
options: { cwd: workPath }
}
};
// Options to control the language client
let clientOptions = {
// Register the server for plain text documents
documentSelector: [
{
language: "upsilon",
scheme: "file"
}
],
synchronize: {
// Synchronize the setting section 'languageServerExample' to the server
configurationSection: "upsilonLanguageServer",
// Notify the server about file changes to '.clientrc files contain in the workspace
fileEvents: [
vscode.workspace.createFileSystemWatcher("**/.clientrc"),
vscode.workspace.createFileSystemWatcher("**/.yup"),
vscode.workspace.createFileSystemWatcher("**/.lua")
]
}
};
// Create the language client and start the client.
let client = new languageClient.LanguageClient("upsilonLanguageServer", "Upsilon Language Server", serverOptions, clientOptions);
let disposable = client.start();
// Push the disposable to the context's subscriptions so that the
// client can be deactivated on extension deactivation
context.subscriptions.push(disposable);
}
// this method is called when your extension is activated
// your extension is activated the very first time the command is executed
function activate(context) {
console.log("Upsilon extension is now activated.");
activateLanguageServer(context);
}
exports.activate = activate;
// this method is called when your extension is deactivated
function deactivate() { }
exports.deactivate = deactivate;
6;
//# sourceMappingURL=extension.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,6DAA6D;AAC7D,8EAA8E;AAE9E,iCAAiC;AACjC,wDAAwD;AACxD,6BAA6B;AAC7B,yBAAyB;AAEzB,mEAAmE;AACnE,MAAM,mBAAmB,GAAG;IAC1B,+BAA+B;IAC/B,kGAAkG;CACnG,CAAC;AAEF,SAAS,sBAAsB,CAAC,OAAgC;IAC9D,0DAA0D;IAC1D,IAAI,YAAY,GAAW,IAAI,CAAC;IAChC,KAAK,IAAI,CAAC,IAAI,mBAAmB,EAAE;QACjC,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;QAC9B,kBAAkB;QAClB,IAAI,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE;YACpB,YAAY,GAAG,CAAC,CAAC;YACjB,MAAM;SACP;KACF;IACD,IAAI,CAAC,YAAY;QACf,MAAM,IAAI,QAAQ,CAAC,yCAAyC,CAAC,CAAC;IAChE,IAAI,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IAC1C,OAAO,CAAC,GAAG,CAAC,OAAO,YAAY,oBAAoB,CAAC,CAAC;IACrD,OAAO,CAAC,GAAG,CAAC,cAAc,QAAQ,GAAG,CAAC,CAAC;IAEvC,oFAAoF;IACpF,qCAAqC;IACrC,IAAI,aAAa,GAAiC;QAChD,GAAG,EAAE;YACH,OAAO,EAAE,QAAQ;YACjB,IAAI,EAAE,CAAC,YAAY,CAAC;YACpB,OAAO,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE;SAC3B;QACD,KAAK,EAAE;YACL,OAAO,EAAE,QAAQ;YACj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