Subject: Re: bug#58790: Eglot URI parsing bug when using clojure-lsp server

From: Richard Copley <[email-masked]>
Date: Wed, 23 Nov 2022 11:55:00 +0000

On 22/11/2022 14:30, Michael Albinus wrote:
> João Távora <[email-masked]> writes:
> 
> Hi João,
> 
>>      Both seem to be OK, although I'm not sure that it is the right
>>      approach in eglot--path-to-uri just to concat "file://" and the
>>      file-local-name part of a remote file name.
>>
>> Can you describe a case where this would be problematic? Remember
>> that, from the point of view of the server, the file is always local.
>> That's regardless of whether eglot invoked the server remotely or
>> locally.
> 
> Got it.
> 
> Best regards, Michael.

Hi All,

For file names with a Windows drive letter and forward slashes (as 
emitted by CMAKE_EXPORT_COMPILE_COMMANDS), the drive letter is 
misinterpreted as a URL type, leading to repeated errors,
   "clangd only supports 'file' URI scheme for workspace files".

(let ((path "c:/projects/awesome-project/source/main.cpp"))
   (message "type %s, url %s"
            (url-type (url-generic-parse-url path))
            (eglot--path-to-uri path)))

;; => "type c, url c:/projects/awesome-project/source/main.cpp"