Closed Andrew-D-Wilson closed 10 months ago
I got the same issue, if there is any solution hope it lands here
Possibly related to #8383
@Andrew-D-Wilson when you are building Bicep, are you using the VSCode "Build ARM Template" command, or are you using Azure CLI or Bicep CLI?
@anthony-c-martin , I can build the ARM templates with Bicep CLI I can Build the ARM templates with Azure CLI
I cant build with VSCode "Build ARM Templates"
The file is also indicated as having errors when opened in VSCode:
To me this looks like a bug in OmniSharp's DocumentUri.ToUri()
, which we use to convert from the LSP URI to a .NET URI:
If we have a file path containing %20
, the URI is correctly presented to the language server by VSCode containing escaped %2520
. This appears to be correctly represented in documentUri
(see screenshot). When we call documentUri.ToUri()
, this appears to remove the escaping and instead represents the Uri with %20
- meaning this is considered to be a space instead of a legitimate %20
when the path is converted into a file system path using uri.LocalPath
.
I added a test to repro this issue: https://github.com/Azure/bicep/blob/cccaa80002cd8dfaadee0f136b297a9f8032e6d4/src/Bicep.LangServer.IntegrationTests/TextDocumentSyncTests.cs#L109
Is there any ETA on when this may be fixed please?
same issue here by the way, once the repo name or the local folder contains a %20 Bicep is not able to reference the child module, just tested on Mac and Linux
in folder with %20
in folder without %20
I did some investigation, and this does seem to be an upstream bug in the Omnisharp LSP package: https://github.com/OmniSharp/csharp-language-server-protocol/issues/1005. I'll be submitting a temp fix to the Bicep repo soon before the upstream bug is acknowledged and fixed.
Bicep version v0.13.1
Describe the bug When working in a Git repository that's name contains spaces, the bicep 'module' then errors.
Such that if the cloned folder is demo%20repo, the error is as follows: An error occurred reading file. Could not find a part of the path 'c:\src\demo repo\Bicep-Templates\storage-account.bicep'.
This also prevents building into ARM.
To Reproduce Steps to reproduce the behavior: