[Bug] Models with "@" in their name don't work correctly (codefixes) #3236
Labels
bug
Issue identified by VS Code Team member as probable bug
help wanted
Issues identified as good community contribution opportunities
Reproducible in vscode.dev or in VS Code Desktop?
Reproducible in the monaco editor playground?
Monaco Editor Playground Code
Reproduction Steps
Paste code in playground
Actual (Problematic) Behavior
The expected warning for
"export let data: string = 4;"
doesn't show up ("can't assign number to string")Expected Behavior
Show the codefix warning
Additional Context
There was a related issue fixed in #3057 (#2295). However, I suspect it fixes the issue at the wrong level.
The demo shows that code fixes and possibly other functionality as well still don't work for models with an "@" (or other would-be-encoded characters) in their path.
In the case of code fixes, you can see it goes wrong in the function
getSourceFileByPath
:filesByName
contains the files without escaped characters, but the "path" passed in fromprovideCodeActions
is based onresource.toString()
, which would return an encoded version of the Uri.I suspect this issue affects more code paths than just for code completions, and maybe a decision should be made on whether to always call
resource.toString(true)
(skipEncoding) for all calls to model.uri.toString?The text was updated successfully, but these errors were encountered: