From c38bd7be11eb93cbfd82876fc04a57a6a434561c Mon Sep 17 00:00:00 2001 From: Ville Penttinen Date: Sun, 1 Dec 2024 15:26:03 +0200 Subject: [PATCH] chore: Fix formatting --- src/Visp.LanguageServer/LanguageServer.fs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Visp.LanguageServer/LanguageServer.fs b/src/Visp.LanguageServer/LanguageServer.fs index 6028fa5..cd80ecf 100644 --- a/src/Visp.LanguageServer/LanguageServer.fs +++ b/src/Visp.LanguageServer/LanguageServer.fs @@ -28,14 +28,15 @@ let NormalizePath (str: string) = if file.StartsWith('/') then file else "/" + file let denormalizePath (uri: Uri) = - let full = uri.ToString() - let full = full.Replace("file://", "").Replace("%3A", ":") - if full.StartsWith("/") then + let full = uri.ToString().Replace("file://", "") + let probablyWindows = full.IndexOf("%3A") > -1 + let full = full.Replace("%3A", ":") + + if probablyWindows && full.StartsWith("/") then full.Substring(1) else full - let ToFileUri (str: string) = str |> NormalizePath |> (+) "file://" |> Uri