提交 33fd5f80 编写于 作者: C Cyrus Najmabadi

Merge branch 'master' into allTaggerChangesIncludingDiagnostics

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft Open Technologies, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<packages>
<package id="Microsoft.Net.Compilers" version="1.0.0-rc3-20150616-02" targetFramework="net45" />
<package id="Microsoft.Net.RoslynDiagnostics" version="1.0.0-rc3-20150616-02" targetFramework="net45" />
<package id="Microsoft.Net.Compilers" version="1.1.0-beta1-20150727-01" targetFramework="net45" />
<package id="Microsoft.Net.RoslynDiagnostics" version="1.1.0-beta1-20150727-01" targetFramework="net45" />
<package id="System.Collections.Immutable" version="1.1.36" targetFramework="net45" />
<package id="System.Reflection.Metadata" version="1.1.0-alpha-00008" targetFramework="net45" />
<package id="Microsoft.DiaSymReader.Native" version="1.1.0-alpha1" />
......@@ -10,4 +10,6 @@
<package id="FakeSign" version="0.9.2" targetFramework="net45" />
<package id="dnx-coreclr-win-x86" version="1.0.0-beta5-12101" />
<package id="dnx-mono" version="1.0.0-beta5-12101" />
<package id="xunit.runner.console" version="2.1.0-beta3-build3029" />
<package id="xunit.runner.msbuild" version="2.1.0-beta3-build3029" />
</packages>
......@@ -4,7 +4,7 @@
ToolsVersion="12.0">
<UsingTask
AssemblyFile="packages\xunit.runners.2.0.0-alpha-build2576\tools\xunit.runner.msbuild.dll"
AssemblyFile="packages/xunit.runner.msbuild.2.1.0-beta3-build3029/build/portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS/xunit.runner.msbuild.dll"
TaskName="Xunit.Runner.MSBuild.xunit" />
<!-- At the moment Jenkins runs on a machine without any build of Visual Studio 2015. Hence we must
......@@ -21,7 +21,6 @@
</PropertyGroup>
<Target Name="RestorePackages">
<Exec Command="&quot;$(MSBuildThisFileDirectory)\.nuget\Nuget.exe&quot; install xunit.runners -pre -version 2.0.0-alpha-build2576 -outputdirectory packages"/>
<Exec Command="&quot;$(MSBuildThisFileDirectory)\.nuget\Nuget.exe&quot; restore &quot;$(RoslynSolution)&quot;" />
</Target>
......@@ -77,7 +76,7 @@
Binaries\$(Configuration)\Roslyn.Services.Editor.CSharp.UnitTests.dll;" />
</ItemGroup>
<Exec Command="Binaries\$(Configuration)\RunTests.exe packages\xunit.runners.2.0.0-alpha-build2576\tools $(RunTestArgs) @(TestAssemblies, ' ')" />
<Exec Command="Binaries\$(Configuration)\RunTests.exe packages/xunit.runner.console.2.1.0-beta3-build3029/tools/ $(RunTestArgs) @(TestAssemblies, ' ')" />
</Target>
......
......@@ -333,6 +333,16 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AnalyzerPowerPack.Setup", "
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AnalyzerPowerPack.Test", "src\Diagnostics\FxCop\Test\AnalyzerPowerPack.Test.csproj", "{06ECCF53-B9B8-4CC2-83C0-E308BF645F7F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Desktop.Analyzers", "Desktop.Analyzers", "{6B1C8EB7-A53A-4CF0-BEAA-FA210B658D3C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DesktopAnalyzers", "src\Diagnostics\FxCop\Desktop.Analyzers\Core\DesktopAnalyzers.csproj", "{D1B42764-D442-4E4C-B2E7-9BA36FFBDDF1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpDesktopAnalyzers", "src\Diagnostics\FxCop\Desktop.Analyzers\CSharp\CSharpDesktopAnalyzers.csproj", "{9A61D22F-A414-47C5-A72A-6546ACECDB23}"
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "BasicDesktopAnalyzers", "src\Diagnostics\FxCop\Desktop.Analyzers\VisualBasic\BasicDesktopAnalyzers.vbproj", "{219EC670-D9C3-4493-AC28-AD42697CCFAD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DesktopAnalyzersTest", "src\Diagnostics\FxCop\Desktop.Analyzers\Test\DesktopAnalyzersTest.csproj", "{9468F53A-8B08-4DAC-9612-3BBB3BCF0783}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Setup", "Setup", "{19148439-436F-4CDA-B493-70AF4FFC13E9}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Features", "Features", "{2491A9B9-C0A8-49EE-9077-A32DE76E1E94}"
......@@ -2976,6 +2986,70 @@ Global
{06ECCF53-B9B8-4CC2-83C0-E308BF645F7F}.Release|x64.Build.0 = Release|Any CPU
{06ECCF53-B9B8-4CC2-83C0-E308BF645F7F}.Release|x86.ActiveCfg = Release|Any CPU
{06ECCF53-B9B8-4CC2-83C0-E308BF645F7F}.Release|x86.Build.0 = Release|Any CPU
{D1B42764-D442-4E4C-B2E7-9BA36FFBDDF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D1B42764-D442-4E4C-B2E7-9BA36FFBDDF1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D1B42764-D442-4E4C-B2E7-9BA36FFBDDF1}.Debug|ARM.ActiveCfg = Debug|Any CPU
{D1B42764-D442-4E4C-B2E7-9BA36FFBDDF1}.Debug|ARM.Build.0 = Debug|Any CPU
{D1B42764-D442-4E4C-B2E7-9BA36FFBDDF1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{D1B42764-D442-4E4C-B2E7-9BA36FFBDDF1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{D1B42764-D442-4E4C-B2E7-9BA36FFBDDF1}.Debug|x64.ActiveCfg = Debug|Any CPU
{D1B42764-D442-4E4C-B2E7-9BA36FFBDDF1}.Debug|x64.Build.0 = Debug|Any CPU
{D1B42764-D442-4E4C-B2E7-9BA36FFBDDF1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D1B42764-D442-4E4C-B2E7-9BA36FFBDDF1}.Release|Any CPU.Build.0 = Release|Any CPU
{D1B42764-D442-4E4C-B2E7-9BA36FFBDDF1}.Release|ARM.ActiveCfg = Release|Any CPU
{D1B42764-D442-4E4C-B2E7-9BA36FFBDDF1}.Release|ARM.Build.0 = Release|Any CPU
{D1B42764-D442-4E4C-B2E7-9BA36FFBDDF1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{D1B42764-D442-4E4C-B2E7-9BA36FFBDDF1}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{D1B42764-D442-4E4C-B2E7-9BA36FFBDDF1}.Release|x64.ActiveCfg = Release|Any CPU
{D1B42764-D442-4E4C-B2E7-9BA36FFBDDF1}.Release|x64.Build.0 = Release|Any CPU
{9A61D22F-A414-47C5-A72A-6546ACECDB23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9A61D22F-A414-47C5-A72A-6546ACECDB23}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9A61D22F-A414-47C5-A72A-6546ACECDB23}.Debug|ARM.ActiveCfg = Debug|Any CPU
{9A61D22F-A414-47C5-A72A-6546ACECDB23}.Debug|ARM.Build.0 = Debug|Any CPU
{9A61D22F-A414-47C5-A72A-6546ACECDB23}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{9A61D22F-A414-47C5-A72A-6546ACECDB23}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{9A61D22F-A414-47C5-A72A-6546ACECDB23}.Debug|x64.ActiveCfg = Debug|Any CPU
{9A61D22F-A414-47C5-A72A-6546ACECDB23}.Debug|x64.Build.0 = Debug|Any CPU
{9A61D22F-A414-47C5-A72A-6546ACECDB23}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9A61D22F-A414-47C5-A72A-6546ACECDB23}.Release|Any CPU.Build.0 = Release|Any CPU
{9A61D22F-A414-47C5-A72A-6546ACECDB23}.Release|ARM.ActiveCfg = Release|Any CPU
{9A61D22F-A414-47C5-A72A-6546ACECDB23}.Release|ARM.Build.0 = Release|Any CPU
{9A61D22F-A414-47C5-A72A-6546ACECDB23}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{9A61D22F-A414-47C5-A72A-6546ACECDB23}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{9A61D22F-A414-47C5-A72A-6546ACECDB23}.Release|x64.ActiveCfg = Release|Any CPU
{9A61D22F-A414-47C5-A72A-6546ACECDB23}.Release|x64.Build.0 = Release|Any CPU
{219EC670-D9C3-4493-AC28-AD42697CCFAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{219EC670-D9C3-4493-AC28-AD42697CCFAD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{219EC670-D9C3-4493-AC28-AD42697CCFAD}.Debug|ARM.ActiveCfg = Debug|Any CPU
{219EC670-D9C3-4493-AC28-AD42697CCFAD}.Debug|ARM.Build.0 = Debug|Any CPU
{219EC670-D9C3-4493-AC28-AD42697CCFAD}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{219EC670-D9C3-4493-AC28-AD42697CCFAD}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{219EC670-D9C3-4493-AC28-AD42697CCFAD}.Debug|x64.ActiveCfg = Debug|Any CPU
{219EC670-D9C3-4493-AC28-AD42697CCFAD}.Debug|x64.Build.0 = Debug|Any CPU
{219EC670-D9C3-4493-AC28-AD42697CCFAD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{219EC670-D9C3-4493-AC28-AD42697CCFAD}.Release|Any CPU.Build.0 = Release|Any CPU
{219EC670-D9C3-4493-AC28-AD42697CCFAD}.Release|ARM.ActiveCfg = Release|Any CPU
{219EC670-D9C3-4493-AC28-AD42697CCFAD}.Release|ARM.Build.0 = Release|Any CPU
{219EC670-D9C3-4493-AC28-AD42697CCFAD}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{219EC670-D9C3-4493-AC28-AD42697CCFAD}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{219EC670-D9C3-4493-AC28-AD42697CCFAD}.Release|x64.ActiveCfg = Release|Any CPU
{219EC670-D9C3-4493-AC28-AD42697CCFAD}.Release|x64.Build.0 = Release|Any CPU
{9468F53A-8B08-4DAC-9612-3BBB3BCF0783}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9468F53A-8B08-4DAC-9612-3BBB3BCF0783}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9468F53A-8B08-4DAC-9612-3BBB3BCF0783}.Debug|ARM.ActiveCfg = Debug|Any CPU
{9468F53A-8B08-4DAC-9612-3BBB3BCF0783}.Debug|ARM.Build.0 = Debug|Any CPU
{9468F53A-8B08-4DAC-9612-3BBB3BCF0783}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{9468F53A-8B08-4DAC-9612-3BBB3BCF0783}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{9468F53A-8B08-4DAC-9612-3BBB3BCF0783}.Debug|x64.ActiveCfg = Debug|Any CPU
{9468F53A-8B08-4DAC-9612-3BBB3BCF0783}.Debug|x64.Build.0 = Debug|Any CPU
{9468F53A-8B08-4DAC-9612-3BBB3BCF0783}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9468F53A-8B08-4DAC-9612-3BBB3BCF0783}.Release|Any CPU.Build.0 = Release|Any CPU
{9468F53A-8B08-4DAC-9612-3BBB3BCF0783}.Release|ARM.ActiveCfg = Release|Any CPU
{9468F53A-8B08-4DAC-9612-3BBB3BCF0783}.Release|ARM.Build.0 = Release|Any CPU
{9468F53A-8B08-4DAC-9612-3BBB3BCF0783}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{9468F53A-8B08-4DAC-9612-3BBB3BCF0783}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{9468F53A-8B08-4DAC-9612-3BBB3BCF0783}.Release|x64.ActiveCfg = Release|Any CPU
{9468F53A-8B08-4DAC-9612-3BBB3BCF0783}.Release|x64.Build.0 = Release|Any CPU
{F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|ARM.ActiveCfg = Debug|Any CPU
......@@ -3211,6 +3285,11 @@ Global
{45854FF7-A6D5-4B28-87A1-0B75390125C0} = {24E8CBFA-38D2-486F-B772-C10AB2DC7F01}
{FFCA21B9-C7CB-4F0F-851B-947EE25C416C} = {24E8CBFA-38D2-486F-B772-C10AB2DC7F01}
{06ECCF53-B9B8-4CC2-83C0-E308BF645F7F} = {24E8CBFA-38D2-486F-B772-C10AB2DC7F01}
{6B1C8EB7-A53A-4CF0-BEAA-FA210B658D3C} = {24E8CBFA-38D2-486F-B772-C10AB2DC7F01}
{D1B42764-D442-4E4C-B2E7-9BA36FFBDDF1} = {6B1C8EB7-A53A-4CF0-BEAA-FA210B658D3C}
{9A61D22F-A414-47C5-A72A-6546ACECDB23} = {6B1C8EB7-A53A-4CF0-BEAA-FA210B658D3C}
{219EC670-D9C3-4493-AC28-AD42697CCFAD} = {6B1C8EB7-A53A-4CF0-BEAA-FA210B658D3C}
{9468F53A-8B08-4DAC-9612-3BBB3BCF0783} = {6B1C8EB7-A53A-4CF0-BEAA-FA210B658D3C}
{19148439-436F-4CDA-B493-70AF4FFC13E9} = {999FBDA2-33DA-4F74-B957-03AC72CCE5EC}
{2491A9B9-C0A8-49EE-9077-A32DE76E1E94} = {999FBDA2-33DA-4F74-B957-03AC72CCE5EC}
{5CA5F70E-0FDB-467B-B22C-3CD5994F0087} = {999FBDA2-33DA-4F74-B957-03AC72CCE5EC}
......
......@@ -14,6 +14,9 @@
<InternalsVisibleToTest>
<Visible>false</Visible>
</InternalsVisibleToTest>
<InternalsVisibleToTypeScript>
<Visible>false</Visible>
</InternalsVisibleToTypeScript>
</ItemDefinitionGroup>
<PropertyGroup Condition="'$(PublicKey)' != '' and '$(SignAssembly)' == 'True'">
......
......@@ -3,7 +3,7 @@
<PropertyGroup>
<StartAction Condition="'$(StartActions)' == ''">Program</StartAction>
<StartProgram Condition="'$(StartProgram)' == ''">$(MSBuildThisFileDirectory)\..\..\..\Closed\Tools\xUnit\xunit.gui.custom.exe</StartProgram>
<StartProgram Condition="'$(StartProgram)' == ''">$(MSBuildThisFileDirectory)\..\..\..\packages\xunit.runners.2.0.0-alpha-build2576\tools\xunit.console.x86.exe</StartProgram>
<StartArguments Condition="'$(StartArguments)' == ''">$(AssemblyName).dll</StartArguments>
<StartWorkingDirectory Condition="'$(StartWorkingDirectory)' == ''">$(OutDir)</StartWorkingDirectory>
</PropertyGroup>
......
......@@ -64,8 +64,8 @@
<!-- Import the global NuGet packages -->
<PropertyGroup>
<ToolsetCompilerPackageName>Microsoft.Net.Compilers</ToolsetCompilerPackageName>
<ToolsetCompilerPropsFilePath>$(NuGetPackagesPath)\Microsoft.Net.Compilers.1.0.0-rc3-20150616-02\build\Microsoft.Net.Compilers.props</ToolsetCompilerPropsFilePath>
<RoslynDiagnosticsPropsFilePath>$(NuGetPackagesPath)\Microsoft.Net.RoslynDiagnostics.1.0.0-rc3-20150616-02\build\Microsoft.Net.RoslynDiagnostics.props</RoslynDiagnosticsPropsFilePath>
<ToolsetCompilerPropsFilePath>$(NuGetPackagesPath)\Microsoft.Net.Compilers.1.1.0-beta1-20150727-01\build\Microsoft.Net.Compilers.props</ToolsetCompilerPropsFilePath>
<RoslynDiagnosticsPropsFilePath>$(NuGetPackagesPath)\Microsoft.Net.RoslynDiagnostics.1.1.0-beta1-20150727-01\build\Microsoft.Net.RoslynDiagnostics.props</RoslynDiagnosticsPropsFilePath>
<AdditionalFileItemNames>$(AdditionalFileItemNames);PublicAPI</AdditionalFileItemNames>
</PropertyGroup>
......@@ -120,9 +120,7 @@
</PropertyGroup>
<ItemGroup Condition="'$(ProjectLanguage)' == 'CSharp' AND '$(TargetNetFX20)' == 'true'">
<Reference Include="$(FrameworkPathOverride)\mscorlib.dll">
<Private>False</Private>
</Reference>
<_ExplicitReference Include="$(FrameworkPathOverride)\mscorlib.dll" />
</ItemGroup>
<PropertyGroup>
......@@ -260,8 +258,8 @@
</PropertyGroup>
</When>
<When Condition="'$(RealSignBuild)' == 'true' OR '$(SignType)' == 'real'">
<!-- We're real-signing the build, but don't have a build number. Just use the RoslynSemanticVersion.
<When Condition="'$(OfficialBuild)' == 'true' OR '$(RealSignBuild)' == 'true' OR '$(SignType)' == 'real'">
<!-- We're creating an official or real-signed build, but don't have a build number. Just use the RoslynSemanticVersion.
This happens if the build template does not pass BuildNumber down to MSBuild. -->
<PropertyGroup>
<AssemblyVersion>$(RoslynSemanticVersion).0</AssemblyVersion>
......
......@@ -10,7 +10,7 @@ usage()
echo " --os <os> OS to run (Linux / Darwin)"
}
XUNIT_VERSION=2.0.0-alpha-build2576
XUNIT_VERSION=2.1.0-beta3-build3029
BUILD_CONFIGURATION=Debug
OS_NAME=$(uname -s)
......@@ -175,7 +175,7 @@ set_mono_path()
test_roslyn()
{
local xunit_runner=packages/xunit.runners.$XUNIT_VERSION/tools/xunit.console.x86.exe
local xunit_runner=packages/xunit.runner.console.$XUNIT_VERSION/tools/xunit.console.x86.exe
local test_binaries=(
Roslyn.Compilers.CSharp.CommandLine.UnitTests
Roslyn.Compilers.CSharp.Syntax.UnitTests
......@@ -203,7 +203,6 @@ test_roslyn()
# temporary work around.
echo Restoring NuGet packages
run_nuget restore Roslyn.sln
run_nuget install xunit.runners -PreRelease -Version $XUNIT_VERSION -OutputDirectory packages
set_mono_path
which mono
......
API Breaking Changes
====
# Version 1.1.0
### Removed VisualBasicCommandLineParser.ctor
During a toolset update we noticed the constructor on `VisualBasicCommandLineParser` was `public`. This in turn made many of the `protected` members of `CommandLineParser` a part of the API surface as it gave external customers an inheritance path.
It was never the intent for these members to be a part of the supported API surface. Creation of the parsers is meant to be done via the `Default` singleton properties. There seems to be little risk that we broke any customers here and hence we decided to remove this API.
PR: https://github.com/dotnet/roslyn/pull/4169
......@@ -20,6 +20,7 @@
<RestorePackages>true</RestorePackages>
<AutoGenerateBindingRedirects>True</AutoGenerateBindingRedirects>
<TargetCoreClr>true</TargetCoreClr>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\Core\Portable\CodeAnalysis.csproj">
......
{
"dependencies": {
"System.AppContext": "4.0.0-beta-*",
"System.Console": "4.0.0-beta-*",
"System.Collections": "4.0.10-beta-*",
"System.Diagnostics.Debug": "4.0.10-beta-*",
"System.Diagnostics.FileVersionInfo": "4.0.0-beta-*",
"System.Diagnostics.Process": "4.0.0-beta-*",
"System.Diagnostics.Tools": "4.0.0-beta-*",
"System.Dynamic.Runtime": "4.0.10-beta-*",
"System.Globalization": "4.0.10-beta-*",
"System.IO": "4.0.10-beta-*",
"System.IO.FileSystem": "4.0.0-beta-*",
"System.IO.FileSystem.Primitives": "4.0.0-beta-*",
"System.IO.Pipes": "4.0.0-beta-*",
"System.Linq": "4.0.0-beta-*",
"System.Linq.Expressions": "4.0.10-beta-*",
"System.ObjectModel": "4.0.10-beta-*",
"System.Reflection": "4.0.10-beta-*",
"System.Reflection.Extensions": "4.0.0-beta-*",
"System.Reflection.Primitives": "4.0.0-beta-*",
"System.Reflection.TypeExtensions": "4.0.0-beta-*",
"System.Resources.ResourceManager": "4.0.0-beta-*",
"System.Runtime": "4.0.20-beta-*",
"System.Runtime.Extensions": "4.0.10-beta-*",
"System.Runtime.Handles": "4.0.0-beta-*",
"System.Runtime.InteropServices": "4.0.20-beta-*",
"System.Security.Cryptography.Hashing.Algorithms": "4.0.0-beta-*",
"System.Security.Principal": "4.0.0-beta-*",
"System.Text.Encoding": "4.0.10-beta-*",
"System.Text.Encoding.Extensions": "4.0.10-beta-*",
"System.Threading": "4.0.10-beta-*",
"System.Threading.Thread": "4.0.0-beta-*",
"System.Threading.Tasks": "4.0.10-beta-*",
"System.Threading.Tasks.Parallel": "4.0.0-beta-*",
"System.Xml.ReaderWriter": "4.0.10-beta-*",
"System.Xml.XDocument": "4.0.10-beta-*",
"System.Xml.XmlDocument": "4.0.0-beta-*",
"System.AppContext": "4.0.0-beta-22816",
"System.Console": "4.0.0-beta-22816",
"System.Collections": "4.0.10-beta-22816",
"System.Diagnostics.Debug": "4.0.10-beta-22816",
"System.Diagnostics.FileVersionInfo": "4.0.0-beta-22816",
"System.Diagnostics.Process": "4.0.0-beta-22816",
"System.Diagnostics.Tools": "4.0.0-beta-22816",
"System.Dynamic.Runtime": "4.0.10-beta-22816",
"System.Globalization": "4.0.10-beta-22816",
"System.IO": "4.0.10-beta-22816",
"System.IO.FileSystem": "4.0.0-beta-22816",
"System.IO.FileSystem.Primitives": "4.0.0-beta-22816",
"System.IO.Pipes": "4.0.0-beta-22816",
"System.Linq": "4.0.0-beta-22816",
"System.Linq.Expressions": "4.0.10-beta-22816",
"System.ObjectModel": "4.0.10-beta-22816",
"System.Reflection": "4.0.10-beta-22816",
"System.Reflection.Extensions": "4.0.0-beta-22816",
"System.Reflection.Primitives": "4.0.0-beta-22816",
"System.Reflection.TypeExtensions": "4.0.0-beta-22816",
"System.Resources.ResourceManager": "4.0.0-beta-22816",
"System.Runtime": "4.0.20-beta-22816",
"System.Runtime.Extensions": "4.0.10-beta-22816",
"System.Runtime.Handles": "4.0.0-beta-22816",
"System.Runtime.InteropServices": "4.0.20-beta-22816",
"System.Security.Cryptography.Hashing.Algorithms": "4.0.0-beta-22816",
"System.Security.Principal": "4.0.0-beta-22816",
"System.Text.Encoding": "4.0.10-beta-22816",
"System.Text.Encoding.Extensions": "4.0.10-beta-22816",
"System.Threading": "4.0.10-beta-22816",
"System.Threading.Thread": "4.0.0-beta-22816",
"System.Threading.Tasks": "4.0.10-beta-22816",
"System.Threading.Tasks.Parallel": "4.0.0-beta-22816",
"System.Xml.ReaderWriter": "4.0.10-beta-22816",
"System.Xml.XDocument": "4.0.10-beta-22816",
"System.Xml.XmlDocument": "4.0.0-beta-22816",
},
"frameworks": {
"dnxcore50": {}
......
......@@ -78,6 +78,7 @@ private static bool AreTokensEquivalent(GreenNode before, GreenNode after)
case SyntaxKind.NumericLiteralToken:
case SyntaxKind.CharacterLiteralToken:
case SyntaxKind.StringLiteralToken:
case SyntaxKind.InterpolatedStringTextToken:
return ((Green.SyntaxToken)before).Text == ((Green.SyntaxToken)after).Text;
}
......
......@@ -422,5 +422,20 @@ public void TestSkippedTest()
VerifyEquivalent(tree1, tree2, topLevel: true);
}
[Fact]
public void TestUpdateInterpolatedString()
{
var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { class C { void Foo() { Console.Write($\"Hello{123:N1}\"); } } }");
var tree2 = tree1.WithReplaceFirst("N1", "N2");
VerifyEquivalent(tree1, tree2, topLevel: true);
VerifyNotEquivalent(tree1, tree2, topLevel: false);
tree2 = tree1.WithReplaceFirst("Hello", "World");
VerifyEquivalent(tree1, tree2, topLevel: true);
VerifyNotEquivalent(tree1, tree2, topLevel: false);
}
}
}
......@@ -96,7 +96,6 @@
<HintPath>..\..\..\..\packages\Microsoft.CodeAnalysis.Test.Resources.Proprietary.1.1.0-beta1-20150716-05\lib\net45\Microsoft.CodeAnalysis.Test.Resources.Proprietary.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Collections" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
......@@ -115,4 +114,4 @@
<ImportGroup Label="Targets">
<Import Project="..\..\..\..\build\Targets\VSL.Imports.targets" />
</ImportGroup>
</Project>
</Project>
\ No newline at end of file
......@@ -116,7 +116,6 @@
<HintPath>..\..\..\..\packages\Microsoft.CodeAnalysis.Test.Resources.Proprietary.1.1.0-beta1-20150716-05\lib\net45\Microsoft.CodeAnalysis.Test.Resources.Proprietary.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Collections" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
......@@ -140,4 +139,4 @@
<Import Project="..\..\..\..\build\Targets\Roslyn.Toolsets.Xunit.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
</ImportGroup>
</Project>
</Project>
\ No newline at end of file
......@@ -55,7 +55,6 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Collections" />
<Reference Include="System.Collections.Immutable, Version=$(SystemCollectionsImmutableAssemblyVersion), Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath>
......@@ -110,4 +109,4 @@
<Import Project="..\..\..\..\..\build\Targets\Roslyn.Toolsets.Xunit.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
</ImportGroup>
</Project>
</Project>
\ No newline at end of file
......@@ -31,7 +31,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
''' Creates a new command line parser.
''' </summary>
''' <param name="isInteractive">An optional parameter indicating indicating whether to create a interactive command line parser.</param>
Public Sub New(Optional isInteractive As Boolean = False)
Friend Sub New(Optional isInteractive As Boolean = False)
MyBase.New(VisualBasic.MessageProvider.Instance, isInteractive)
End Sub
......
......@@ -3045,7 +3045,6 @@ Microsoft.CodeAnalysis.VisualBasic.TypedConstantExtensions
Microsoft.CodeAnalysis.VisualBasic.TypedConstantExtensions.ToVisualBasicString(constant As Microsoft.CodeAnalysis.TypedConstant) -> String
Microsoft.CodeAnalysis.VisualBasic.VisualBasicCommandLineArguments
Microsoft.CodeAnalysis.VisualBasic.VisualBasicCommandLineParser
Microsoft.CodeAnalysis.VisualBasic.VisualBasicCommandLineParser.New(isInteractive As Boolean = False) -> Void
Microsoft.CodeAnalysis.VisualBasic.VisualBasicCommandLineParser.Parse(args As System.Collections.Generic.IEnumerable(Of String), baseDirectory As String, sdkDirectory As String, additionalReferenceDirectories As String = Nothing) -> Microsoft.CodeAnalysis.VisualBasic.VisualBasicCommandLineArguments
Microsoft.CodeAnalysis.VisualBasic.VisualBasicCompilation
Microsoft.CodeAnalysis.VisualBasic.VisualBasicCompilation.AddReferences(ParamArray references As Microsoft.CodeAnalysis.MetadataReference()) -> Microsoft.CodeAnalysis.VisualBasic.VisualBasicCompilation
......@@ -4353,8 +4352,6 @@ Overrides Microsoft.CodeAnalysis.VisualBasic.Syntax.XmlTextSyntax.Accept(Of TRes
Overrides Microsoft.CodeAnalysis.VisualBasic.Syntax.XmlTextSyntax.Accept(visitor As Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxVisitor) -> Void
Overrides Microsoft.CodeAnalysis.VisualBasic.Syntax.YieldStatementSyntax.Accept(Of TResult)(visitor As Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxVisitor(Of TResult)) -> TResult
Overrides Microsoft.CodeAnalysis.VisualBasic.Syntax.YieldStatementSyntax.Accept(visitor As Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxVisitor) -> Void
Overrides Microsoft.CodeAnalysis.VisualBasic.VisualBasicCommandLineParser.RegularFileExtension() -> String
Overrides Microsoft.CodeAnalysis.VisualBasic.VisualBasicCommandLineParser.ScriptFileExtension() -> String
Overrides Microsoft.CodeAnalysis.VisualBasic.VisualBasicCompilation.ContainsSymbolsWithName(predicate As System.Func(Of String, Boolean), filter As Microsoft.CodeAnalysis.SymbolFilter = Microsoft.CodeAnalysis.SymbolFilter.TypeAndMember, cancellationToken As System.Threading.CancellationToken = Nothing) -> Boolean
Overrides Microsoft.CodeAnalysis.VisualBasic.VisualBasicCompilation.CreateErrorTypeSymbol(container As Microsoft.CodeAnalysis.INamespaceOrTypeSymbol, name As String, arity As Integer) -> Microsoft.CodeAnalysis.INamedTypeSymbol
Overrides Microsoft.CodeAnalysis.VisualBasic.VisualBasicCompilation.DirectiveReferences() -> System.Collections.Immutable.ImmutableArray(Of Microsoft.CodeAnalysis.MetadataReference)
......@@ -113,5 +113,10 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
Return False
End Function
<Extension()>
Friend Function AllowsExtensionMethods(container As NamedTypeSymbol) As Boolean
Return container.TypeKind = TypeKind.Module OrElse container.IsScriptClass
End Function
End Module
End Namespace
......@@ -3333,7 +3333,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
' Only Modules can declare extension methods.
If _lazyContainsExtensionMethods = ThreeState.Unknown Then
If Not (_containingSymbol.Kind = SymbolKind.Namespace AndAlso Me.TypeKind = TypeKind.Module AndAlso Me.AnyMemberHasAttributes) Then
If Not (_containingSymbol.Kind = SymbolKind.Namespace AndAlso Me.AllowsExtensionMethods() AndAlso Me.AnyMemberHasAttributes) Then
_lazyContainsExtensionMethods = ThreeState.False
End If
End If
......
......@@ -85,7 +85,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
' Check attributes quickly.
_quickAttributes = binder.QuickAttributeChecker.CheckAttributes(syntax.AttributeLists)
If containingType.TypeKind <> TypeKind.Module Then
If Not containingType.AllowsExtensionMethods() Then
' Extension methods in source can only be inside modules.
_quickAttributes = _quickAttributes And Not QuickAttributes.Extension
End If
......
......@@ -1471,7 +1471,7 @@ lReportErrorOnTwoTokens:
Dim isExtensionMethod As Boolean = False
If Not (Me.MethodKind <> MethodKind.Ordinary AndAlso Me.MethodKind <> MethodKind.DeclareMethod) AndAlso
m_containingType.TypeKind = TYPEKIND.Module AndAlso
m_containingType.AllowsExtensionMethods() AndAlso
Me.ParameterCount <> 0 Then
Debug.Assert(Me.IsShared)
......@@ -1569,7 +1569,7 @@ lReportErrorOnTwoTokens:
If Me.MethodKind <> MethodKind.Ordinary AndAlso Me.MethodKind <> MethodKind.DeclareMethod Then
arguments.Diagnostics.Add(ERRID.ERR_ExtensionOnlyAllowedOnModuleSubOrFunction, arguments.AttributeSyntaxOpt.GetLocation())
ElseIf m_containingType.TypeKind <> TYPEKIND.Module Then
ElseIf Not m_containingType.AllowsExtensionMethods() Then
arguments.Diagnostics.Add(ERRID.ERR_ExtensionMethodNotInModule, arguments.AttributeSyntaxOpt.GetLocation())
ElseIf Me.ParameterCount = 0 Then
......
......@@ -49,6 +49,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Syntax
SyntaxKind.DecimalLiteralToken,
SyntaxKind.FloatingLiteralToken,
SyntaxKind.IntegerLiteralToken,
SyntaxKind.InterpolatedStringTextToken,
SyntaxKind.StringLiteralToken
Return String.Equals(DirectCast(before, Green.SyntaxToken).Text,
DirectCast(after, Green.SyntaxToken).Text,
......
......@@ -2431,6 +2431,59 @@ End Module
End Sub
<Fact>
Public Sub ScriptExtensionMethods()
Dim comp = CreateCompilationWithMscorlib(
<compilation>
<file name="a.vbx"><![CDATA[
Imports System.Runtime.CompilerServices
<Extension>
Shared Function F(o As Object) As Object
Return Nothing
End Function
Dim o As New Object()
o.F()]]></file>
</compilation>,
parseOptions:=TestOptions.Script,
references:={MscorlibRef, SystemCoreRef})
comp.VerifyDiagnostics()
Assert.True(comp.SourceAssembly.MightContainExtensionMethods)
End Sub
<Fact>
Public Sub InteractiveExtensionMethods()
Dim parseOptions = TestOptions.Interactive
Dim references = {MscorlibRef, SystemCoreRef}
Dim source0 = <![CDATA[
Imports System.Runtime.CompilerServices
<Extension>
Shared Function F(o As Object) As Object
Return 0
End Function
Dim o As New Object()
? o.F()]]>
Dim source1 = <![CDATA[
<Extension>
Shared Function G(o As Object) As Object
Return 1
End Function
Dim o As New Object()
? o.G().F()]]>
Dim s0 = VisualBasicCompilation.CreateSubmission(
"s0.dll",
syntaxTree:=Parse(source0.Value, parseOptions),
references:=references)
s0.VerifyDiagnostics()
Assert.True(s0.SourceAssembly.MightContainExtensionMethods)
Dim s1 = VisualBasicCompilation.CreateSubmission(
"s1.dll",
syntaxTree:=Parse(source0.Value, parseOptions),
previousSubmission:=s0,
references:=references)
s1.VerifyDiagnostics()
Assert.True(s1.SourceAssembly.MightContainExtensionMethods)
End Sub
End Class
End Namespace
......
......@@ -260,6 +260,18 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests
VerifyEquivalent(tree1, tree2, topLevel:=True)
End Sub
<Fact>
Public Sub TestUpdateInterpolatedString()
Dim tree1 = VisualBasicSyntaxTree.ParseText(NewLines("namespace N \n class C \n sub Foo() \n Console.Write($""Hello{123:N1}"") \n end sub \n end class \n end namespace"))
Dim tree2 = tree1.WithReplaceFirst("N1", "N2")
VerifyEquivalent(tree1, tree2, topLevel:=True)
VerifyNotEquivalent(tree1, tree2, topLevel:=False)
tree2 = tree1.WithReplaceFirst("Hello", "World")
VerifyEquivalent(tree1, tree2, topLevel:=True)
VerifyNotEquivalent(tree1, tree2, topLevel:=False)
End Sub
#Region "Field"
<Fact>
......
......@@ -20,6 +20,7 @@
<RestorePackages>true</RestorePackages>
<AutoGenerateBindingRedirects>True</AutoGenerateBindingRedirects>
<TargetCoreClr>true</TargetCoreClr>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\Core\Portable\CodeAnalysis.csproj">
......
{
"dependencies": {
"System.AppContext": "4.0.0-beta-*",
"System.Console": "4.0.0-beta-*",
"System.Collections": "4.0.10-beta-*",
"System.Diagnostics.Debug": "4.0.10-beta-*",
"System.Diagnostics.FileVersionInfo": "4.0.0-beta-*",
"System.Diagnostics.Process": "4.0.0-beta-*",
"System.Diagnostics.Tools": "4.0.0-beta-*",
"System.Dynamic.Runtime": "4.0.0-beta-*",
"System.Globalization": "4.0.10-beta-*",
"System.IO": "4.0.10-beta-*",
"System.IO.FileSystem": "4.0.0-beta-*",
"System.IO.FileSystem.Primitives": "4.0.0-beta-*",
"System.IO.Pipes": "4.0.0-beta-*",
"System.Linq": "4.0.0-beta-*",
"System.Linq.Expressions": "4.0.0-beta-*",
"System.ObjectModel": "4.0.10-beta-*",
"System.Reflection": "4.0.10-beta-*",
"System.Reflection.Extensions": "4.0.0-beta-*",
"System.Reflection.Primitives": "4.0.0-beta-*",
"System.Reflection.TypeExtensions": "4.0.0-beta-*",
"System.Resources.ResourceManager": "4.0.0-beta-*",
"System.Runtime": "4.0.20-beta-*",
"System.Runtime.Extensions": "4.0.10-beta-*",
"System.Runtime.Handles": "4.0.0-beta-*",
"System.Runtime.InteropServices": "4.0.20-beta-*",
"System.Security.Cryptography.Hashing.Algorithms": "4.0.0-beta-*",
"System.Security.Principal": "4.0.0-beta-*",
"System.Text.Encoding": "4.0.10-beta-*",
"System.Text.Encoding.Extensions": "3.0.10-beta-*",
"System.Threading": "4.0.0-beta-*",
"System.Threading.Thread": "4.0.0-beta-*",
"System.Threading.Tasks": "4.0.10-beta-*",
"System.Threading.Tasks.Parallel": "4.0.0-beta-*",
"System.Xml.ReaderWriter": "4.0.10-beta-*",
"System.Xml.XmlDocument": "4.0.0-beta-*",
"System.AppContext": "4.0.0-beta-22816",
"System.Console": "4.0.0-beta-22816",
"System.Collections": "4.0.10-beta-22816",
"System.Diagnostics.Debug": "4.0.10-beta-22816",
"System.Diagnostics.FileVersionInfo": "4.0.0-beta-22816",
"System.Diagnostics.Process": "4.0.0-beta-22816",
"System.Diagnostics.Tools": "4.0.0-beta-22816",
"System.Dynamic.Runtime": "4.0.0-beta-22816",
"System.Globalization": "4.0.10-beta-22816",
"System.IO": "4.0.10-beta-22816",
"System.IO.FileSystem": "4.0.0-beta-22816",
"System.IO.FileSystem.Primitives": "4.0.0-beta-22816",
"System.IO.Pipes": "4.0.0-beta-22816",
"System.Linq": "4.0.0-beta-22816",
"System.Linq.Expressions": "4.0.0-beta-22816",
"System.ObjectModel": "4.0.10-beta-22816",
"System.Reflection": "4.0.10-beta-22816",
"System.Reflection.Extensions": "4.0.0-beta-22816",
"System.Reflection.Primitives": "4.0.0-beta-22816",
"System.Reflection.TypeExtensions": "4.0.0-beta-22816",
"System.Resources.ResourceManager": "4.0.0-beta-22816",
"System.Runtime": "4.0.20-beta-22816",
"System.Runtime.Extensions": "4.0.10-beta-22816",
"System.Runtime.Handles": "4.0.0-beta-22816",
"System.Runtime.InteropServices": "4.0.20-beta-22816",
"System.Security.Cryptography.Hashing.Algorithms": "4.0.0-beta-22816",
"System.Security.Principal": "4.0.0-beta-22816",
"System.Text.Encoding": "4.0.10-beta-22816",
"System.Text.Encoding.Extensions": "3.0.10-beta-22816",
"System.Threading": "4.0.0-beta-22816",
"System.Threading.Thread": "4.0.0-beta-22816",
"System.Threading.Tasks": "4.0.10-beta-22816",
"System.Threading.Tasks.Parallel": "4.0.0-beta-22816",
"System.Xml.ReaderWriter": "4.0.10-beta-22816",
"System.Xml.XmlDocument": "4.0.0-beta-22816",
}
}
......@@ -25,14 +25,23 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'" />
<ItemGroup>
<ProjectReference Include="..\Microsoft.DiaSymReader.PortablePdb\Microsoft.DiaSymReader.PortablePdb.csproj">
<Project>{f83343ba-b4ea-451c-b6db-5d645e6171bc}</Project>
<Name>Microsoft.DiaSymReader.PortablePdb</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Reference Include="..\..\..\packages\Microsoft.DiaSymReader.1.0.5\lib\net45\Microsoft.DiaSymReader.dll" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.Collections.Immutable, Version=$(SystemCollectionsImmutableAssemblyVersion), Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath>
<HintPath>..\..\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath>
</Reference>
<Reference Include="System.Reflection.Metadata">
<HintPath>..\..\..\..\packages\System.Reflection.Metadata.$(SystemReflectionMetadataVersion)\lib\portable-net45+win8\System.Reflection.Metadata.dll</HintPath>
<Reference Include="System.Reflection.Metadata, Version=$(SystemReflectionMetadataAssemblyVersion), Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\System.Reflection.Metadata.$(SystemReflectionMetadataVersion)\lib\portable-net45+win8\System.Reflection.Metadata.dll</HintPath>
</Reference>
<Reference Include="..\..\..\packages\System.IO.4.0.10-beta-22816\lib\portable-wpa81+wp80+win80+net45+aspnetcore50\System.IO.dll">
<Private>False</Private>
......@@ -49,12 +58,21 @@
<Reference Include="..\..\..\packages\System.Runtime.4.0.20-beta-22816\lib\portable-wpa81+wp80+win80+net45+aspnetcore50\System.Runtime.dll">
<Private>False</Private>
</Reference>
<Reference Include="..\..\..\packages\System.Runtime.Loader.4.0.0-beta-22816\lib\portable-wpa81+wp80+win80+net45+aspnetcore50\System.Runtime.Loader.dll">
<Private>False</Private>
</Reference>
<Reference Include="..\..\..\packages\System.Reflection.4.0.10-beta-22816\lib\portable-wpa81+wp80+win80+net45+aspnetcore50\System.Reflection.dll">
<Private>False</Private>
</Reference>
<Reference Include="..\..\..\packages\System.Reflection.Primitives.4.0.0-beta-22816\lib\portable-wpa81+wp80+win80+net45+aspnetcore50\System.Reflection.Primitives.dll">
<Private>False</Private>
</Reference>
<Reference Include="..\..\..\packages\System.Reflection.Extensions.4.0.0-beta-22816\lib\portable-wpa81+wp80+win80+net45+aspnetcore50\System.Reflection.Extensions.dll">
<Private>False</Private>
</Reference>
<Reference Include="..\..\..\packages\System.Resources.ResourceManager.4.0.0-beta-22816\lib\portable-wpa81+wp80+win80+net45+aspnetcore50\System.Resources.ResourceManager.dll">
<Private>False</Private>
</Reference>
<Reference Include="..\..\..\packages\System.Runtime.InteropServices.4.0.20-beta-22816\lib\portable-wpa81+wp80+win80+net45+aspnetcore50\System.Runtime.InteropServices.dll">
<Private>False</Private>
</Reference>
......@@ -64,10 +82,36 @@
<Reference Include="..\..\..\packages\System.Linq.4.0.0-beta-22816\lib\portable-wpa81+wp80+win80+net45+aspnetcore50\System.Linq.dll">
<Private>False</Private>
</Reference>
<ProjectReference Include="..\Microsoft.DiaSymReader.PortablePdb\Microsoft.DiaSymReader.PortablePdb.csproj">
<Project>{f83343ba-b4ea-451c-b6db-5d645e6171bc}</Project>
<Name>Microsoft.DiaSymReader.PortablePdb</Name>
</ProjectReference>
<Reference Include="..\..\..\packages\System.Diagnostics.Debug.4.0.10-beta-22816\lib\portable-wpa81+wp80+win80+net45+aspnetcore50\System.Diagnostics.Debug.dll">
<Private>False</Private>
</Reference>
<Reference Include="..\..\..\packages\System.Diagnostics.Tools.4.0.0-beta-22816\lib\portable-wpa81+wp80+win80+net45+aspnetcore50\System.Diagnostics.Tools.dll">
<Private>False</Private>
</Reference>
<Reference Include="..\..\..\packages\System.Globalization.4.0.10-beta-22816\lib\portable-wpa81+wp80+win80+net45+aspnetcore50\System.Globalization.dll">
<Private>False</Private>
</Reference>
<Reference Include="..\..\..\packages\System.Text.Encoding.4.0.10-beta-22816\lib\portable-wpa81+wp80+win80+net45+aspnetcore50\System.Text.Encoding.dll">
<Private>False</Private>
</Reference>
<Reference Include="..\..\..\packages\System.Threading.4.0.10-beta-22816\lib\portable-wpa81+wp80+win80+net45+aspnetcore50\System.Threading.dll">
<Private>False</Private>
</Reference>
<Reference Include="..\..\..\packages\System.Threading.Tasks.4.0.10-beta-22816\lib\portable-wpa81+wp80+win80+net45+aspnetcore50\System.Threading.Tasks.dll">
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Content Include="..\..\..\packages\System.IO.FileSystem.4.0.0-beta-22816\lib\net45\System.IO.FileSystem.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>False</Visible>
</Content>
<Content Include="..\..\..\packages\System.IO.FileSystem.Primitives.4.0.0-beta-22816\lib\net45\System.IO.FileSystem.Primitives.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>false</Visible>
</Content>
</ItemGroup>
<ItemGroup>
<Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\xunit.abstractions.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.abstractions.dll</HintPath>
......@@ -82,28 +126,39 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Content Include="..\..\..\packages\System.IO.FileSystem.4.0.0-beta-22816\lib\net45\System.IO.FileSystem.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>False</Visible>
</Content>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\Async.pdbx" />
<EmbeddedResource Include="Resources\Async.dll">
<LogicalName>Async.dll</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="Resources\Async.pdbx">
<LogicalName>Async.pdbx</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="Resources\Documents.dll">
<LogicalName>Documents.dll</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="Resources\Documents.pdbx">
<LogicalName>Documents.pdbx</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="Resources\Scopes.dll">
<LogicalName>Scopes.dll</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="Resources\Scopes.pdbx">
<LogicalName>Scopes.pdbx</LogicalName>
</EmbeddedResource>
<None Include="Resources\build.cmd" />
<EmbeddedResource Include="Resources\Async.dll" />
<Content Include="Resources\Documents.cs" />
<EmbeddedResource Include="Resources\Documents.dll" />
<EmbeddedResource Include="Resources\Documents.pdbx" />
<None Include="Resources\Scopes.cs" />
<EmbeddedResource Include="Resources\Scopes.dll" />
<EmbeddedResource Include="Resources\Scopes.pdbx" />
<None Include="Resources\Async.cs" />
<Compile Include="Resources\TestResources.cs" />
<Content Include="Resources\Documents.cs" />
<Compile Include="..\..\Compilers\Core\Portable\InternalUtilities\ComStreamWrapper.cs">
<Link>TestHelpers\ComStreamWrapper.cs</Link>
</Compile>
<Compile Include="ResourceLoader.cs" />
<Compile Include="SymBinderTests.cs" />
<Compile Include="TestResources.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="TestHelpers\AssertEx.cs" />
<Compile Include="Utilities\EnumerableHelpersTests.cs" />
<Compile Include="SymMetadataImport.cs" />
<Compile Include="Utilities\SymMetadataImport.cs" />
<Compile Include="SymReaderTests.cs" />
</ItemGroup>
<ItemGroup>
......
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.IO;
using System.Reflection;
namespace TestResources
{
internal static class Documents
internal static class ResourceLoader
{
public static readonly byte[] dll = ResourceHelper.GetResource("Documents.dll");
public static readonly byte[] pdb = ResourceHelper.GetResource("Documents.pdbx");
}
internal static class ResourceHelper
{
public static Stream GetResourceStream(string name)
private static Stream GetResourceStream(string name)
{
string fullName = $"{nameof(Microsoft)}.{nameof(Microsoft.DiaSymReader)}.{nameof(Microsoft.DiaSymReader.PortablePdb)}.{nameof(Microsoft.DiaSymReader.PortablePdb.UnitTests)}.Resources." + name;
return typeof(ResourceHelper).GetTypeInfo().Assembly.GetManifestResourceStream(fullName);
var assembly = typeof(ResourceLoader).GetTypeInfo().Assembly;
var stream = assembly.GetManifestResourceStream(name);
if (stream == null)
{
throw new InvalidOperationException($"Resource '{name}' not found in {assembly.FullName}.");
}
return stream;
}
public static byte[] GetResource(string name)
private static byte[] GetResourceBlob(string name)
{
using (var stream = GetResourceStream(name))
{
......@@ -33,5 +34,15 @@ public static byte[] GetResource(string name)
return bytes;
}
}
public static byte[] GetOrCreateResource(ref byte[] resource, string name)
{
if (resource == null)
{
resource = GetResourceBlob(name);
}
return resource;
}
}
}
}
\ No newline at end of file
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.IO;
using Roslyn.Utilities;
using Xunit;
namespace Microsoft.DiaSymReader.PortablePdb.UnitTests
{
public class SymBinderTests
{
private static ISymUnmanagedBinder SymBinder => new SymBinder();
[Fact]
public void GetReaderForFile()
{
var importer = new SymMetadataImport(new MemoryStream(TestResources.Documents.Dll));
string filePath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
File.WriteAllBytes(filePath, TestResources.Documents.Pdb);
string searchPath = null;
ISymUnmanagedReader symReader;
Assert.Equal(HResult.S_OK, SymBinder.GetReaderForFile(importer, filePath, searchPath, out symReader));
int actualCount;
Assert.Equal(HResult.S_OK, symReader.GetDocuments(0, out actualCount, null));
Assert.Equal(11, actualCount);
Assert.Equal(HResult.S_FALSE, ((ISymUnmanagedDispose)symReader).Destroy());
Assert.Equal(HResult.S_OK, ((ISymUnmanagedDispose)symReader).Destroy());
Assert.Throws<ObjectDisposedException>(() => symReader.GetDocuments(0, out actualCount, null));
File.Delete(filePath);
}
[Fact]
public void GetReaderFromStream()
{
var importer = new SymMetadataImport(new MemoryStream(TestResources.Documents.Dll));
var stream = new MemoryStream(TestResources.Documents.Pdb);
var wrapper = new ComStreamWrapper(stream);
ISymUnmanagedReader symReader;
Assert.Equal(HResult.S_OK, SymBinder.GetReaderFromStream(importer, wrapper, out symReader));
int actualCount;
Assert.Equal(HResult.S_OK, symReader.GetDocuments(0, out actualCount, null));
Assert.Equal(11, actualCount);
Assert.Equal(HResult.S_FALSE, ((ISymUnmanagedDispose)symReader).Destroy());
Assert.Equal(HResult.S_OK, ((ISymUnmanagedDispose)symReader).Destroy());
Assert.Throws<ObjectDisposedException>(() => symReader.GetDocuments(0, out actualCount, null));
}
}
}
......@@ -3,22 +3,26 @@
using System;
using System.Reflection.Metadata;
using Xunit;
using System.IO;
using System.Collections.Generic;
namespace Microsoft.DiaSymReader.PortablePdb.UnitTests
{
public class SymReaderTests
{
private static SymReader CreateSymReaderFromResource(string name)
#region Helpers
private static SymReader CreateSymReaderFromResource(KeyValuePair<byte[], byte[]> peAndPdb)
{
MetadataReader mdReader;
return CreateSymReaderFromResource(name, out mdReader);
return CreateSymReaderFromResource(peAndPdb, out mdReader);
}
private static SymReader CreateSymReaderFromResource(string name, out MetadataReader mdReader)
private static SymReader CreateSymReaderFromResource(KeyValuePair<byte[], byte[]> peAndPdb, out MetadataReader mdReader)
{
var importer = new SymMetadataImport(TestResources.ResourceHelper.GetResourceStream(name + ".dll"));
var importer = new SymMetadataImport(new MemoryStream(peAndPdb.Key));
mdReader = importer.MetadataReader;
return new SymReader(new PortablePdbReader(TestResources.ResourceHelper.GetResourceStream(name + ".pdbx"), importer));
return new SymReader(new PortablePdbReader(peAndPdb.Value, peAndPdb.Value.Length, importer));
}
private void ValidateDocumentUrl(ISymUnmanagedDocument document, string url)
......@@ -236,12 +240,14 @@ private void ValidateAsyncMethod(ISymUnmanagedReader symReader, int moveNextMeth
}
}
#endregion
[Fact]
public unsafe void TestMetadataHeaders1()
{
fixed (byte* pdbPtr = TestResources.Documents.pdb)
fixed (byte* pdbPtr = TestResources.Documents.Pdb)
{
var pdbReader = new MetadataReader(pdbPtr, TestResources.Documents.pdb.Length);
var pdbReader = new MetadataReader(pdbPtr, TestResources.Documents.Pdb.Length);
Assert.Equal("PDB v0.1", pdbReader.MetadataVersion);
Assert.Equal(MetadataKind.Ecma335, pdbReader.MetadataKind);
Assert.False(pdbReader.IsAssembly);
......@@ -252,7 +258,7 @@ public unsafe void TestMetadataHeaders1()
[Fact]
public void TestGetDocuments1()
{
var symReader = CreateSymReaderFromResource("Documents");
var symReader = CreateSymReaderFromResource(TestResources.Documents.DllAndPdb);
int actualCount;
Assert.Equal(HResult.S_OK, symReader.GetDocuments(0, out actualCount, null));
......@@ -283,7 +289,7 @@ public void TestGetDocuments1()
[Fact]
public void TestGetDocument1()
{
var symReader = CreateSymReaderFromResource("Documents");
var symReader = CreateSymReaderFromResource(TestResources.Documents.DllAndPdb);
TestGetDocument(symReader, @"x.cs", expectedUrl: @"C:\a\b\c\d\x.cs");
TestGetDocument(symReader, @"X.CS", expectedUrl: @"C:\a\b\c\d\x.cs");
TestGetDocument(symReader, @"1.cs", expectedUrl: @"C:\a\b\c\d\1.cs");
......@@ -316,7 +322,7 @@ private void TestGetDocument(SymReader symReader, string name, string expectedUr
[Fact]
public void TestSymGetAttribute()
{
var symReader = CreateSymReaderFromResource("Documents");
var symReader = CreateSymReaderFromResource(TestResources.Documents.DllAndPdb);
int actualCount;
int actualCount2;
......@@ -326,13 +332,13 @@ public void TestSymGetAttribute()
Assert.Equal(HResult.S_OK, symReader.GetSymAttribute(0, "<PortablePdbImage>", actualCount, out actualCount2, image));
Assert.Equal(actualCount, actualCount2);
AssertEx.Equal(TestResources.Documents.pdb, image);
AssertEx.Equal(TestResources.Documents.Pdb, image);
}
[Fact]
public void TestMethods1()
{
var symReader = CreateSymReaderFromResource("Scopes");
var symReader = CreateSymReaderFromResource(TestResources.Scopes.DllAndPdb);
int count;
//
......@@ -459,7 +465,7 @@ public void TestMethods1()
[Fact]
public void TestAsyncMethods()
{
var symReader = CreateSymReaderFromResource("Async");
var symReader = CreateSymReaderFromResource(TestResources.Async.DllAndPdb);
ValidateAsyncMethod(
symReader,
......@@ -481,7 +487,7 @@ public void TestAsyncMethods()
[Fact]
public void TestAsyncMethods_GetAsyncStepInfo()
{
var symReader = CreateSymReaderFromResource("Async");
var symReader = CreateSymReaderFromResource(TestResources.Async.DllAndPdb);
ISymUnmanagedMethod method;
Assert.Equal(HResult.S_OK, symReader.GetMethod(0x06000005, out method));
......@@ -526,7 +532,7 @@ public void TestAsyncMethods_GetAsyncStepInfo()
[Fact]
public void TestAsyncMethods_Errors()
{
var symReader = CreateSymReaderFromResource("Scopes");
var symReader = CreateSymReaderFromResource(TestResources.Scopes.DllAndPdb);
ISymUnmanagedMethod method;
Assert.Equal(HResult.S_OK, symReader.GetMethod(0x06000002, out method));
......
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.Collections.Generic;
namespace TestResources
{
public static class Documents
{
private static byte[] _dll;
public static byte[] Dll => ResourceLoader.GetOrCreateResource(ref _dll, nameof(Documents) + ".dll");
private static byte[] _pdb;
public static byte[] Pdb => ResourceLoader.GetOrCreateResource(ref _pdb, nameof(Documents) + ".pdbx");
public static KeyValuePair<byte[], byte[]> DllAndPdb => new KeyValuePair<byte[], byte[]>(Dll, Pdb);
}
public static class Scopes
{
private static byte[] _dll;
public static byte[] Dll => ResourceLoader.GetOrCreateResource(ref _dll, nameof(Scopes) + ".dll");
private static byte[] _pdb;
public static byte[] Pdb => ResourceLoader.GetOrCreateResource(ref _pdb, nameof(Scopes) + ".pdbx");
public static KeyValuePair<byte[], byte[]> DllAndPdb => new KeyValuePair<byte[], byte[]>(Dll, Pdb);
}
public static class Async
{
private static byte[] _dll;
public static byte[] Dll => ResourceLoader.GetOrCreateResource(ref _dll, nameof(Async) + ".dll");
private static byte[] _pdb;
public static byte[] Pdb => ResourceLoader.GetOrCreateResource(ref _pdb, nameof(Async) + ".pdbx");
public static KeyValuePair<byte[], byte[]> DllAndPdb => new KeyValuePair<byte[], byte[]>(Dll, Pdb);
}
}
......@@ -36,12 +36,19 @@
<Reference Include="..\..\..\packages\System.IO.FileSystem.Primitives.4.0.0-beta-22816\lib\portable-wpa81+wp80+win80+net45+aspnetcore50\System.IO.FileSystem.Primitives.dll">
<Private>False</Private>
</Reference>
<Reference Include="..\..\..\packages\System.IO.MemoryMappedFiles.4.0.0-beta-22816\lib\portable-wpa81+wp80+win80+net45+aspnetcore50\System.IO.MemoryMappedFiles.dll">
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Content Include="..\..\..\packages\System.IO.FileSystem.4.0.0-beta-22816\lib\net45\System.IO.FileSystem.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>false</Visible>
</Content>
<Content Include="..\..\..\packages\System.IO.MemoryMappedFiles.4.0.0-beta-22816\lib\net45\System.IO.MemoryMappedFiles.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>false</Visible>
</Content>
</ItemGroup>
<ItemGroup>
<Compile Include="AsyncMethodData.cs" />
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335;
using System.Runtime.InteropServices;
......@@ -23,14 +21,8 @@ public sealed class SymReader : ISymUnmanagedReader3, ISymUnmanagedDispose
private int _version;
/// <summary>
/// Creates <see cref="SymReader"/>.
/// </summary>
/// <param name="pdbReader"></param>
/// <remarks>
/// Takes ownership of <paramref name="pdbReader"/>.
/// </remarks>
public SymReader(PortablePdbReader pdbReader)
// Takes ownership of <paramref name="pdbReader"/>.
internal SymReader(PortablePdbReader pdbReader)
{
Debug.Assert(pdbReader != null);
......@@ -47,8 +39,13 @@ public SymReader(PortablePdbReader pdbReader)
public int Destroy()
{
if (_pdbReader.IsDisposed)
{
return HResult.S_OK;
}
_pdbReader.Dispose();
return HResult.S_OK;
return HResult.S_FALSE;
}
private bool IsVisualBasicAssembly()
......@@ -239,14 +236,14 @@ public int GetMethodVersion(ISymUnmanagedMethod method, out int version)
if (name == "<PortablePdbImage>")
{
count = _pdbReader.Image.Length;
count = _pdbReader.ImageSize;
if (bufferLength == 0)
{
return HResult.S_FALSE;
}
Buffer.BlockCopy(_pdbReader.Image, 0, customDebugInformation, 0, bufferLength);
Marshal.Copy(_pdbReader.ImagePtr, customDebugInformation, 0, bufferLength);
return HResult.S_OK;
}
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册