-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SourceLink] Go To Def tab improvements #57995
Changes from 1 commit
8f660a9
d58a322
7de55b4
696d3d1
0f6c361
3357d6d
679d6e7
3eb26c2
a3368a1
2b6c31a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2948,4 +2948,12 @@ Zero-width positive lookbehind assertions are typically used at the beginning of | |
<data name="Silent" xml:space="preserve"> | ||
<value>Silent</value> | ||
</data> | ||
<data name="embedded" xml:space="preserve"> | ||
<value>embedded</value> | ||
<comment>Embedded is a technical term for "Embedded source", where souce files are embedded into the PDB</comment> | ||
</data> | ||
<data name="external" xml:space="preserve"> | ||
<value>external</value> | ||
<comment>External means "external source", meaning source files that are not part of the current solution</comment> | ||
Comment on lines
+2956
to
+2957
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we really need to tag this specially, if it's opening a file on your machine? Like does this get strange if you then want to edit that file like a local file, or add that missing project to your solution? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or are we taking the on-disk file and copying it to a temp folder? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, you were right, this is a file on your machine.. but we open it readonly, and if you were to edit it, then we wouldn't find it because the checksum wouldn't match. If we didn't tag it specifically, what would we say? I don't think it should look like a normal file, because its not in the solution, so lots of things don't work like normal (and as mentioned, its readonly). I don't think the tab should say "from metadata", because its the real source. So "external" is the best I could come up with. "local" I guess could work? |
||
</data> | ||
</root> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -164,13 +164,12 @@ internal sealed class PdbSourceDocumentMetadataAsSourceFileProvider : IMetadataA | |
var navigateLocation = await MetadataAsSourceHelpers.GetLocationInGeneratedSourceAsync(symbolId, document, cancellationToken).ConfigureAwait(false); | ||
var navigateDocument = navigateProject.GetDocument(navigateLocation.SourceTree); | ||
|
||
// TODO: "from metadata" is technically correct, but could be confusing. From PDB? From Source? https://github.com/dotnet/roslyn/issues/55834 | ||
var documentName = string.Format( | ||
"{0} [{1}]", | ||
navigateDocument!.Name, | ||
FeaturesResources.from_metadata); | ||
sourceFileInfos[0]!.SourceDescription); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does it mean for sourceFileInfos to be an array here? If the first is significant/special, can we extract that out to a local (that's also been null-suppressed once) rather than duplicating it everywhere? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately for now, the first is not special, but whilst GoToDef supports multiple locations, MetadataAsSoruce doesn't, so there is some refactoring of things that needs to happen I haven't started to look at yet. A local is probably a good idea |
||
|
||
return new MetadataAsSourceFile(documentPath, navigateLocation, documentName, navigateDocument.FilePath); | ||
return new MetadataAsSourceFile(documentPath, navigateLocation, documentName, sourceDocuments[0].FilePath); | ||
} | ||
|
||
private static ProjectInfo? CreateProjectInfo(Workspace workspace, Project project, ImmutableDictionary<string, string> pdbCompilationOptions, string assemblyName) | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On behalf of the translation teams, thank you for adding comments like this. 😄