diff --git a/package.json b/package.json index 688cdcfc175bde205be5325a5c5f6702c35ee59b..592baab2d6f615f0627475fbd484841ed1a14d8e 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 3405ef7fd1b2fe970ca942642ef4c1e11619a3d7..7d7c96cab9fd602f1a610229769b2a3a9e9c3df2 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'