Azure / bicep

Bicep is a declarative language for describing and deploying Azure resources
MIT License
3.22k stars 747 forks source link

Use consistent URI <-> FilePath conversion logic #11833

Open anthony-c-martin opened 1 year ago

anthony-c-martin commented 1 year ago

In the language server we use the .GetFileSystemPath() method frequently, which calls the following: https://github.com/OmniSharp/csharp-language-server-protocol/blob/82583557bee2699762e4e03989be22be02e1fb1b/src/Protocol/DocumentUri.Internal.cs#L260-L298

In the core logic, we use Uri.LocalPath.

Similarly, there is different conversion logic from path -> Uri:

shenglol commented 9 months ago

Had an offline discussion on this. The consensus is to maintain a port of DocumentUri in Bicep.Core to ensure consistent URI type conversion logic. In the future, the Omnisharp language server library may get deprecated and replaced by another language server SDK. Maintaining our own copy makes it less expensive for us to do the migration.