[SourceLink] Use correct encoding for embedded text#57683
[SourceLink] Use correct encoding for embedded text#57683davidwengier merged 9 commits intodotnet:mainfrom
Conversation
src/EditorFeatures/CSharpTest/PdbSourceDocument/PdbSourceDocumentTests.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/CSharpTest/PdbSourceDocument/PdbSourceDocumentTests.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/CSharpTest/PdbSourceDocument/PdbSourceDocumentTests.cs
Outdated
Show resolved
Hide resolved
src/Features/Core/Portable/PdbSourceDocument/PdbSourceDocumentLoaderService.cs
Show resolved
Hide resolved
src/Features/Core/Portable/PdbSourceDocument/PdbSourceDocumentLoaderService.cs
Outdated
Show resolved
Hide resolved
Seems like "from disk" and "from embedded" code paths can converge once the Stream of raw data is available and the encoding can be handled in the same way. In reply to: 965855046 Refers to: src/Features/Core/Portable/PdbSourceDocument/PdbSourceDocumentLoaderService.cs:92 in dbef806. [](commit_id = dbef806, deletion_comment = False) |
src/Features/Core/Portable/PdbSourceDocument/PdbSourceDocumentLoaderService.cs
Outdated
Show resolved
Hide resolved
| Encoding? defaultEncoding = null; | ||
| if (pdbCompilationOptions.TryGetValue("default-encoding", out var encodingString)) | ||
| { | ||
| defaultEncoding = Encoding.GetEncoding(encodingString); |
There was a problem hiding this comment.
If we can't get the encoding, do we bail out? Or try with the default encoding and let the checksum handle if it is wrong?
There was a problem hiding this comment.
Since we own all the involved bits it should be fine to let an exception be exceptional here. We put the wrong information in the pdb
src/Features/Core/Portable/PdbSourceDocument/PdbSourceDocumentMetadataAsSourceFileProvider.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/CSharpTest/PdbSourceDocument/PdbSourceDocumentTests.cs
Outdated
Show resolved
Hide resolved
src/Features/Core/Portable/PdbSourceDocument/PdbSourceDocumentMetadataAsSourceFileProvider.cs
Outdated
Show resolved
Hide resolved
src/Features/Core/Portable/PdbSourceDocument/PdbSourceDocumentMetadataAsSourceFileProvider.cs
Show resolved
Hide resolved
src/Features/Core/Portable/PdbSourceDocument/PdbSourceDocumentMetadataAsSourceFileProvider.cs
Outdated
Show resolved
Hide resolved
src/Features/Core/Portable/PdbSourceDocument/PdbSourceDocumentMetadataAsSourceFileProvider.cs
Outdated
Show resolved
Hide resolved
src/Features/Core/Portable/PdbSourceDocument/PdbSourceDocumentLoaderService.cs
Show resolved
Hide resolved
|
Ping @ryzngard @jasonmalinowski anything blocking here? Now that the debugger work is in I'd love to keep this moving to support source link, but that need vs-deps changes and I don't really know how to do that without conflicts, but I'm pretty sure an open pr won't help :) |
Fixes #57350
There is a minor code move here, so commit-by-commit is probably easiest.