Skip to content

Commit

Permalink
fixed issue with path
Browse files Browse the repository at this point in the history
  • Loading branch information
Nimaoth committed Mar 10, 2024
1 parent 71b4317 commit 517213b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/servers/languages_server.nim
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import std/[os, osproc, asynchttpserver, strutils, strformat, uri, asyncfile, json, sequtils]
import misc/[custom_async, util, myjsonutils]
import misc/[custom_async, util, myjsonutils, custom_logger]
import router, server_utils

logCategory "languages-server"

var processes: seq[Process] = @[]

proc callback(req: Request): Future[void] {.async.} =
Expand Down Expand Up @@ -29,10 +31,11 @@ proc callback(req: Request): Future[void] {.async.} =
let reqBody = parseJson(req.body)
let executablePath = reqBody["path"].str
let additionalArgs = reqBody["args"].jsonTo seq[string]
let proxyPath = getCurrentDir() / "tools/lsp-ws.exe"
let proxyPath = getAppDir() / "lsp-ws.exe"

let directories = hostedFolders.mapIt(fmt"{it.path}").join(";")
let args = @[fmt"--port:{port}", fmt"--exe:{executablePath}", fmt"--log:lsp-ws-{port}.log", fmt"--workspace:{workspaceName}", fmt"--directories:{directories}", "--"] & additionalArgs
log lvlInfo, fmt"Starting language server process {proxyPath} with args '{args}'"
let process = startProcess(proxyPath, args=args, options={poUsePath, poDaemon})

{.gcsafe.}:
Expand Down

0 comments on commit 517213b

Please sign in to comment.