Skip to content
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

support extern alias and add unit test #1409

Merged
merged 5 commits into from
Mar 11, 2019

Conversation

itn3000
Copy link
Contributor

@itn3000 itn3000 commented Feb 22, 2019

This PR will fix project compilation error using extern alias.
related on dotnet/vscode-csharp#2342

Aliases description can be referred in the following links.

@@ -233,8 +238,13 @@ public static ProjectData Create(MSB.Execution.ProjectInstance projectInstance)
{
references.Add(fullPath);
}
var aliases = referencePathItem.GetMetadataValue("Aliases");
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

add MetadataNames.Aliases = nameof(Aliases), thanks.

@@ -104,5 +104,25 @@ public async Task NetStandardAndNetCoreApp_has_correct_property_values()
Assert.Equal("AnyCPU", projectFileInfo.Platform);
}
}

[Fact]
public async Task ExternAlias()
Copy link
Member

Choose a reason for hiding this comment

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

this test is failing at the moment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

forget to add test assets to build.json, now fixed.

@itn3000
Copy link
Contributor Author

itn3000 commented Feb 28, 2019

CI test was failed, I will fix it

Copy link
Member

@filipw filipw left a comment

Choose a reason for hiding this comment

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

LGTM

@seanmars
Copy link

seanmars commented Aug 7, 2019

I'm using the latest version of VS Code and make the "omnisharp.path": "latest".
But still get The extern alias 'xxxx' was not specified in a /reference option (CS0430)

@filipw
Copy link
Member

filipw commented Aug 7, 2019

you can see the test project file here https://github.com/OmniSharp/omnisharp-roslyn/pull/1409/files#diff-2d3349e50030a4adcbf62d5602dcf874
is your setup similar? and if not, can you share a sample csproj file or a full repro?

@itn3000 itn3000 deleted the support-extern-alias branch August 7, 2019 07:04
@seanmars
Copy link

seanmars commented Aug 7, 2019

There is my sample -> https://github.com/seanmars/omnisharp-roslyn-alias-test

It's fine to build, but in vs code always got error information like below image.
https://github.com/seanmars/omnisharp-roslyn-alias-test/blob/master/20190807_145935.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants