Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ private TrivialTemporaryStorageService()

public ITemporaryStorageStreamHandle WriteToTemporaryStorage(Stream stream, CancellationToken cancellationToken)
{
stream.Position = 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if there's a bug here, i'm curious how any VB to C# (or vice versa) tests pass today :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you point me to such tests? I can investigate

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. like TestGotoDefinitionCrossLanguage. If skeletons aren't working, it's uncelar how the VB project could even know about the C# symbol in order to properly go to def to it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debugging through the test on Linux, I can definitely see the diagnostic error BC31519: '{0}' cannot be referenced because it is not a valid assembly. being there, I guess the test just doesn't verify diagnostics. I'm not sure how the go-to-def then works, I guess it doesn't really need the metadata reference, but works differently under the hood?

var newStream = new MemoryStream();
stream.CopyTo(newStream);
return new StreamStorage(newStream);
Expand Down
14 changes: 14 additions & 0 deletions src/Workspaces/CoreTest/WorkspaceTests/AdhocWorkspaceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -592,4 +592,18 @@ public void TestNotGCRootedOnConstruction()
// rooted within the export provider instance.
GC.KeepAlive(exportProvider);
}

[Fact]
public async Task VbReferencingCSharp()
{
var workspace = new AdhocWorkspace();
var csProj = workspace.AddProject("CsProj", LanguageNames.CSharp);
csProj = csProj.WithCompilationOptions(csProj.CompilationOptions.WithOutputKind(OutputKind.DynamicallyLinkedLibrary));
var vbProj = csProj.Solution.AddProject("VbProj", "VbProj", LanguageNames.VisualBasic)
.AddProjectReference(new ProjectReference(csProj.Id));
vbProj = vbProj.WithCompilationOptions(vbProj.CompilationOptions.WithOutputKind(OutputKind.DynamicallyLinkedLibrary));
var comp = (await vbProj.GetCompilationAsync())!;
var diagnostics = comp.GetDiagnostics();
Assert.Empty(diagnostics);
}
}
Loading