From 07761656899a8fea916b5c0767b1bb8b629c2b16 Mon Sep 17 00:00:00 2001 From: Jazzpirate Date: Wed, 5 Jul 2023 10:16:34 +0200 Subject: [PATCH] fix --- src/mmt-lsp/src/info/kwarc/mmt/lsp/Server.scala | 2 +- src/mmt-stex/src/info/kwarc/mmt/stex/lsp/Server.scala | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/mmt-lsp/src/info/kwarc/mmt/lsp/Server.scala b/src/mmt-lsp/src/info/kwarc/mmt/lsp/Server.scala index fbb9d0063..e0a16b120 100644 --- a/src/mmt-lsp/src/info/kwarc/mmt/lsp/Server.scala +++ b/src/mmt-lsp/src/info/kwarc/mmt/lsp/Server.scala @@ -426,7 +426,7 @@ object LSPServer { def URItoVSCode(s : String) : String = URLEncoder.encode(s.replace("+","%2B"),"UTF-8") def VSCodeToURI(s: String): String = { val dec = URLDecoder.decode(s,"UTF-8") - if (dec.startsWith("file:///")) { + if (dec.startsWith("file:///") && dec(9) == ':') { dec.take(8) + dec(8).toUpper + dec.drop(9) } else { dec diff --git a/src/mmt-stex/src/info/kwarc/mmt/stex/lsp/Server.scala b/src/mmt-stex/src/info/kwarc/mmt/stex/lsp/Server.scala index 0f1687863..6f8f8cb90 100644 --- a/src/mmt-stex/src/info/kwarc/mmt/stex/lsp/Server.scala +++ b/src/mmt-stex/src/info/kwarc/mmt/stex/lsp/Server.scala @@ -596,11 +596,10 @@ class STeXLSPServer(style:RunStyle) extends LSPServer(classOf[STeXClient]) with result.getCapabilities.setWorkspace(wsc) result.getCapabilities.setWorkspaceSymbolProvider(true) if (params.getWorkspaceFolders != null) { - params.getWorkspaceFolders.asScala - .flatMap(workspaceFolder => LSPServer.VSCodeToFile(workspaceFolder.getUri)) - .foreach { - case f if f.exists() => workspacefolders ::= f - } + params.getWorkspaceFolders.asScala.foreach {w => + val file = LSPServer.VSCodeToFile(w.getUri) + if (file.exists(_.exists())) workspacefolders ::= file.get + } } }