From 4153f25c86e229ffd49e9133aecd11feaae2dee6 Mon Sep 17 00:00:00 2001 From: SeeBasTStick <sebastian.stock@hhu.de> Date: Mon, 18 May 2020 10:14:55 +0200 Subject: [PATCH] fix: added simpler option to set proB path --- package.json | 5 +++++ server/src/server.ts | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 688cdcf..592baab 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,11 @@ ], "default": "off", "description": "Traces the communication between VS Code and the language server." + }, + "languageServerExample.probHome":{ + "type":"string", + "default":"~/prob_prolog/probcli.sh", + "description": "Path to ProB executable" } } } diff --git a/server/src/server.ts b/server/src/server.ts index 3405ef7..7d7c96c 100644 --- a/server/src/server.ts +++ b/server/src/server.ts @@ -90,12 +90,13 @@ connection.onInitialized(() => { // The example settings interface ExampleSettings { maxNumberOfProblems: number; + probHome : string; } // The global settings, used when the `workspace/configuration` request is not supported by the client. // Please note that this is not the case when using this server with the client provided in this example // but could happen with other clients. -const defaultSettings: ExampleSettings = { maxNumberOfProblems: 1000 }; +const defaultSettings: ExampleSettings = { maxNumberOfProblems: 1000, probHome: "/home/sebastian/prob_prolog/probcli.sh" }; let globalSettings: ExampleSettings = defaultSettings; // Cache the settings of all open documents @@ -149,12 +150,14 @@ documents.onDidChangeContent(change => { async function validateTextDocument(textDocument: TextDocument): Promise<void> { // In this simple example we get the settings for every validate run. let settings = await getDocumentSettings(textDocument.uri); - + let pathy:path.ParsedPath = path.parse(URI.parse(textDocument.uri).path); let dic:string = pathy.dir + + console.log(settings.probHome) - let probCliHome:string = '/home/sebastian/prob_prolog/probcli.sh' + let probCliHome:string = settings.probHome//'/home/sebastian/prob_prolog/probcli.sh' let ndjson:string = 'NDJSON_ERROR_LOG_FILE ' let errorPath:string = dic+'/_error.json' -- GitLab