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

Improved the logic of adding default assembly references for Desktop CLR CSX scripts #898

Merged
merged 5 commits into from
Jul 7, 2017

Conversation

filipw
Copy link
Member

@filipw filipw commented Jun 27, 2017

This PR improves the way we are adding default assembly references for Desktop CLR CSX scripts. We need to make sure we add references to all assemblies type forwarders might point to when working with a Desktop CLR script (for .NET Core scripts, all references should be provided via the project model).

The main difference was so far we references mscorlib.dll and System.Core.dll but missed System.dll.

Fixes dotnet/vscode-csharp#1581

commonReferences.Add(reference);
}

Assembly FromName(string assemblyName)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not use an IAssemblyLoader?

Copy link
Member Author

Choose a reason for hiding this comment

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

and here I was, so happy that I used a local function... 😋
you are right though

I also noticed it needs a rebase

Copy link
Member

@david-driscoll david-driscoll left a comment

Choose a reason for hiding this comment

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

Is there any point of adding any unit tests at all?

@filipw
Copy link
Member Author

filipw commented Jun 27, 2017

Is there any point of adding any unit tests at all?

Good point.
I'll check - let's hold off on the merge.

I think we should be able to have a test based on using the Regex type (dotnet/vscode-csharp#1581) that would fail on the old OmniSharp code and would work here.

@filipw
Copy link
Member Author

filipw commented Jun 27, 2017

Actually the test infrastructure has it's own logic for default references, that's why this issue never showed up in tests before
https://github.com/OmniSharp/omnisharp-roslyn/blob/dev/tests/TestUtility/TestHelpers.cs#L26

I think this should be good to merge for now then.
In the future we can eliminate that little duplication of default references between the test infrastructure with the project system.

@david-driscoll
Copy link
Member

Sounds good to me. @DustinCampbell ?

@DustinCampbell
Copy link
Contributor

Fine by me!

@filipw filipw changed the base branch from dev to master July 5, 2017 20:07
@filipw
Copy link
Member Author

filipw commented Jul 7, 2017

everything is green. I think this is good to merge - no reason to keep it hanging around anymore

@filipw filipw merged commit cbd7040 into OmniSharp:master Jul 7, 2017
@filipw filipw deleted the bugfix/vscode-1581 branch July 7, 2017 09:10
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