提交 a40a9573 编写于 作者: N Neal Gafter

Merge from future into features/patterns

......@@ -10,6 +10,11 @@ REM internal repositories.
set RoslynSolution=%1
if "%RoslynSolution%" == "" set RoslynSolution=%~dp0Roslyn.sln
echo Deleting project.lock.json files
pushd "%~dp0src"
del /s /q project.lock.json
popd
echo Restoring packages: Toolsets
call %NugetExe% restore "%~dp0build\ToolsetPackages\project.json" %NuGetAdditionalCommandLineArgs% || goto :RestoreFailed
......
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" Condition="'$(IsPortable)' == 'true'"/>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" Condition="'$(IsPortable)' != 'true'" />
<Import Project="VSL.Imports.targets"/>
<PropertyGroup>
<TargetPath></TargetPath> <!-- Prevent projects referencing this from trying to pass us to the compiler -->
</PropertyGroup>
<Target Name="CoreCompile" /> <!-- Prevent Csc from being called -->
<Target Name="CopyFilesToOutputDirectory" /> <!-- Prevent non-existent output from being copied -->
<Target Name="GenerateTargetFrameworkMonikerAttribute" /> <!-- Don't generate TFM attribute -->
<Target Name="RuntimeImplementationProjectOutputGroup" /> <!-- Group always attempts resolve runtime, regardless of <CopyNuGetImplementations>-->
......
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="Settings.targets" />
<PropertyGroup>
<CopyNuGetImplementations>false</CopyNuGetImplementations>
<IsDeployment Condition="'$(IsDeployment)' == ''">false</IsDeployment>
<IsPortable Condition="'$(IsPortable)' == ''">true</IsPortable>
</PropertyGroup>
<PropertyGroup Condition="'$(IsDeployment)' == 'false'">
<UseCommonOutputDirectory>true</UseCommonOutputDirectory>
<OutputPath>bin</OutputPath>
</PropertyGroup>
<PropertyGroup>
<CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
<OutputType>Library</OutputType>
<IsPortable Condition="'$(IsPortable)' == ''">true</IsPortable>
</PropertyGroup>
<PropertyGroup Condition="'$(IsPortable)' == 'true'">
......@@ -19,7 +27,7 @@
<PropertyGroup Condition="'$(IsPortable)' != 'true'">
<TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
</PropertyGroup>
</Project>
\ No newline at end of file
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<!-- Turn off implict binary and project reference copying to prevent projects
from racing to copy the same files to the shared build directory -->
<ItemDefinitionGroup Condition="'$(CopyReferencesByDefault)' == 'false'">
<Reference>
<Private>false</Private>
</Reference>
<ProjectReference>
<Private>false</Private>
</ProjectReference>
</ItemDefinitionGroup>
<!-- This file is imported by all projects at the end of the project files -->
<!-- Update common properties -->
<PropertyGroup>
......@@ -29,6 +15,14 @@
<RoslynInternalKey>002400000480000094000000060200000024000052534131000400000100010055e0217eb635f69281051f9a823e0c7edd90f28063eb6c7a742a19b4f6139778ee0af438f47aed3b6e9f99838aa8dba689c7a71ddb860c96d923830b57bbd5cd6119406ddb9b002cf1c723bf272d6acbb7129e9d6dd5a5309c94e0ff4b2c884d45a55f475cd7dba59198086f61f5a8c8b5e601c0edbf269733f6f578fc8579c2</RoslynInternalKey>
</PropertyGroup>
<PropertyGroup>
<!-- While UseCommonOutputDirectory will prevent NuGet implementations from being copied,
we still need to turn off CopyNuGetImplementations to prevent the build task from complaining about a
lack of a runtime section in our project.json. -->
<CopyNuGetImplementations Condition="'$(UseCommonOutputDirectory)' == 'true'">false</CopyNuGetImplementations>
</PropertyGroup>
<!-- settings for strong name signing -->
<PropertyGroup>
<RunningInMicroBuild Condition="Exists('$(TF_BUILD_BUILDDIRECTORY)\MicroBuild\MicroBuild.Signing.dll')">true</RunningInMicroBuild>
......@@ -124,7 +118,7 @@
<!-- On Mono on *nix the NuGet targets aren't imported by default, so we do that here -->
<Import Project="$(MSBuildExtensionsPath)\Microsoft\NuGet\Microsoft.NuGet.targets"
Condition="'$(OS)' != 'Windows_NT'" />
<Choose>
<When Condition="'$(TargetFrameworkIdentifier)' == '.NETPortable' AND
'$(TargetFrameworkVersion)' == 'v5.0'">
......
......@@ -8,7 +8,8 @@ export HOME=$(cd ~ && pwd)
# NuGet often exceeds the limit of open files on Mac
# https://github.com/NuGet/Home/issues/2163
if [ "$(uname -s)" == "Darwin" ]
OS=$(uname -s)
if [ "$OS" == "Darwin" || "$OS" == "Linux" ]
then
ulimit -n 6500
fi
......
......@@ -5,28 +5,29 @@ This document reflects the status, and planned work, for the compiler team. It
## C# 7.0 and VB 15
| Feature | Branch | State | Owners | LDM Champ |
| ------- | ------ | ----- | ------ | ----- | ----- |
| ------- | ------ | ----- | ------ | --------- |
| [Async Main](https://github.com/dotnet/roslyn/issues/7476) | none | Feature Specification | [tyoverby](https://github.com/tyoverby), [agocke](https://github.com/agocke) | [stephentoub](https://github.com/stephentoub) |
| Address of Static | none | Feature Specification | | [jaredpar](https://github.com/jaredpar) |
| [Binary Literals](https://github.com/dotnet/roslyn/issues/215) | [future](https://github.com/dotnet/roslyn/tree/future) | Finishing | | [gafter](https://github.com/gafter) |
| [Digit Separators](https://github.com/dotnet/roslyn/issues/216) | [future](https://github.com/dotnet/roslyn/tree/future) | Finishing | | [gafter](https://github.com/gafter) |
| [Local Functions](https://github.com/dotnet/roslyn/blob/future/docs/features/local-functions.md) | [future](https://github.com/dotnet/roslyn/tree/future) | Finishing | [agocke](https://github.com/agocke), [jaredpar](https://github.com/jaredpar), [vsadov](https://github.com/vsadov) | [gafter](https://github.com/gafter) |
| [Pattern Matching](https://github.com/dotnet/roslyn/blob/future/docs/features/patterns.md) | [features/patterns](https://github.com/dotnet/roslyn/tree/features/patterns) | Prototyping | [gafter](https://github.com/gafter), [alekseyts](https://github.com/alekseyts), [agocke](https://github.com/agocke) | [gafter](https://github.com/gafter) |
| [Type switch](https://github.com/dotnet/roslyn/blob/future/docs/features/patterns.md) | [future](https://github.com/dotnet/roslyn/tree/future) | Finishing | [gafter](https://github.com/gafter), [alekseyts](https://github.com/alekseyts), [agocke](https://github.com/agocke) | [gafter](https://github.com/gafter) |
| [Ref Returns](https://github.com/dotnet/roslyn/issues/118) | [future](https://github.com/dotnet/roslyn/tree/future) | Finishing | [vsadov](https://github.com/vsadov), [agocke](https://github.com/agocke), [jaredpar](https://github.com/jaredpar) | [vsadov](https://github.com/vsadov) |
| Source Generation | [future](https://github.com/dotnet/roslyn/tree/features/generators) | Prototyping | [cston](https://github.com/cston), [vsadov](https://github.com/vsadov) | [mattwar](https://github.com/mattwar) |
| [Throw Expr](https://github.com/dotnet/roslyn/blob/future/docs/features/patterns.md) | [features/patterns](https://github.com/dotnet/roslyn/tree/features/patterns) | Prototyping | [agocke](https://github.com/agocke), [tyoverby](https://github.com/tyoverby), [gafter](https://github.com/gafter) | [gafter](https://github.com/gafter) |
| [Tuples](https://github.com/dotnet/roslyn/issues/347) | [features/tuples](https://github.com/dotnet/roslyn/tree/features/tuples) | Prototyping | [vsadov](https://github.com/vsadov), [jcouv](https://github.com/jcouv) | [madstorgerson](https://github.com/MadsTorgersen) |
| [Out var](https://github.com/dotnet/roslyn/issues/6183) | none | Feature Specification | [alekseyts](https://github.com/alekseyts) | [gafter](https://github.com/gafter) |
| [Throw Expr](https://github.com/dotnet/roslyn/blob/features/patterns/docs/features/patterns.md) | [features/patterns](https://github.com/dotnet/roslyn/tree/features/patterns) | Finishing | [agocke](https://github.com/agocke), [tyoverby](https://github.com/tyoverby), [gafter](https://github.com/gafter) | [gafter](https://github.com/gafter) |
| [Tuples](https://github.com/dotnet/roslyn/issues/347) | [features/tuples](https://github.com/dotnet/roslyn/tree/features/tuples) | Prototyping | [vsadov](https://github.com/vsadov), [jcouv](https://github.com/jcouv) | [madstorgersen](https://github.com/MadsTorgersen) |
| [Out var](https://github.com/dotnet/roslyn/blob/features/outvar/docs/features/outvar.md) | [features/outvar](https://github.com/dotnet/roslyn/tree/features/outvar) | Feature Specification | [alekseyts](https://github.com/alekseyts) | [gafter](https://github.com/gafter) |
## (C# 7.0 and VB 15) + 1
| Feature | Branch | State | Owners | LDM |
| ------- | ------ | ----- | ------ | ----- |
| Feature | Branch | State | Owners | LDM Champ |
| ------- | ------ | ----- | ------ | --------- |
| [private protected](https://github.com/dotnet/roslyn/blob/features/privateProtected/docs/features/private-protected.md) | [features/privateProtected](https://github.com/dotnet/roslyn/tree/features/privateProtected) | Prototyping | | [gafter](https://github.com/gafter) |
| [Non-null Ref Types](https://github.com/dotnet/roslyn/blob/features/NullableReferenceTypes/docs/features/NullableReferenceTypes/Nullable%20reference%20types.md) | [features/NullableReferenceTypes](https://github.com/dotnet/roslyn/tree/features/NullableReferenceTypes) | Prototyping | [alekseyts](https://github.com/alekseyts) | [mattwar](https://github.com/mattwar) |
| [Better Betterness](https://github.com/dotnet/roslyn/issues/250) | none | Feature Specification | | [gafter](https://github.com/gafter) |
| [Records](https://github.com/dotnet/roslyn/blob/features/records/docs/features/records.md) | [features/records](https://github.com/dotnet/roslyn/tree/features/records) | Feature Specification | [jcouv](https://github.com/jcouv) | [gafter](https://github.com/gafter) |
| [With Exprs](https://github.com/dotnet/roslyn/blob/features/records/docs/features/records.md) | [features/records](https://github.com/dotnet/roslyn/tree/features/records) | Feature Specification | [gafter](https://github.com/gafter) | [gafter](https://github.com/gafter) |
| [Pattern Matching](https://github.com/dotnet/roslyn/blob/features/patterns/docs/features/patterns.md) | [features/patterns](https://github.com/dotnet/roslyn/tree/features/patterns) | Prototyping | [gafter](https://github.com/gafter), [alekseyts](https://github.com/alekseyts), [agocke](https://github.com/agocke) | [gafter](https://github.com/gafter) |
# FAQ
......
......@@ -275,7 +275,7 @@ The order in which patterns are matched is not defined. A compiler is permitted
In some cases the compiler can prove that a switch section can have no effect at runtime because its pattern is subsumed by a previous case. In these cases a warning may be produced. [TODO: these warnings should be mandatory and we should specify precisely when they are produced.]
If a *case_guard* is present, its expression of type `bool`. It is evaluated as an additional condition that must be satisfied for the case to be considered satisfied.
If a *case-guard* is present, its expression is of type `bool`. It is evaluated as an additional condition that must be satisfied for the case to be considered satisfied.
## Match Expression
......
......@@ -57,7 +57,7 @@ with_expression
with_initializer_list
: with_initializer
| with_initiaizer ',' with_initializer_list
| with_initializer ',' with_initializer_list
;
with_initializer
......
The CI restore works by downloading the contents of the packages directory from Azure directly. Hence if a package is updated this zip will need to be rebuilt.
This is done by executing the following on a Windows box.
- Change to the root of the enlistment.
- delete the contents of the `~\.nuget\packages`
- Run Restore.cmd
- Zip the `~\.nuget` directory (via explorer) and name it nuget.X.zip (where X is one higher than the previous number)
- Use [azcopy](https://azure.microsoft.com/en-us/documentation/articles/storage-use-azcopy) to upload to https://dotnetci.blob.core.windows.net/roslyn
- Change cibuild.sh and cibuild.cmd to reference the new package.
......@@ -17,6 +17,18 @@ static void addEmailPublisher(def myJob) {
}
}
// Calls a web hook on Jenkins build events. Allows our build monitoring jobs to be push notified
// vs. polling
static void addBuildEventWebHook(def myJob) {
myJob.with {
notifications {
endpoint('https://jaredpar.azurewebsites.net/api/BuildEvent?code=tts2pvyelahoiliwu7lo6flxr8ps9kaip4hyr4m0ofa3o3l3di77tzcdpk22kf9gex5m6cbrcnmi') {
event('all')
}
}
}
}
// Generates the standard trigger phrases. This is the regex which ends up matching lines like:
// test win32 please
static String generateTriggerPhrase(String jobName, String opsysName, String triggerKeyword = 'this') {
......@@ -42,6 +54,8 @@ static void addRoslynJob(def myJob, String jobName, String branchName, String tr
Utilities.addGithubPushTrigger(myJob)
addEmailPublisher(myJob)
}
addBuildEventWebHook(myJob)
}
def branchNames = []
......
......@@ -30,7 +30,7 @@ internal LoweredDynamicOperationFactory(SyntheticBoundNodeFactory factory, int m
// that redefines these constants and is not supposed to run existing programs.
/// <summary>
/// Corresponds to <see cref="Microsoft.CSharp.RuntimeBinder.CSharpBinderFlags"/>.
/// Corresponds to Microsoft.CSharp.RuntimeBinder.CSharpBinderFlags.
/// </summary>
[Flags]
private enum CSharpBinderFlags
......@@ -48,7 +48,7 @@ private enum CSharpBinderFlags
}
/// <summary>
/// Corresponds to <see cref="Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfoFlags"/>.
/// Corresponds to Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfoFlags.
/// </summary>
[Flags]
private enum CSharpArgumentInfoFlags
......
......@@ -478,8 +478,8 @@ internal void DecodeClassInterfaceAttribute(AttributeSyntax nodeOpt, DiagnosticB
switch (interfaceType)
{
case ClassInterfaceType.None:
case ClassInterfaceType.AutoDispatch:
case ClassInterfaceType.AutoDual:
case Cci.Constants.ClassInterfaceType_AutoDispatch:
case Cci.Constants.ClassInterfaceType_AutoDual:
break;
default:
......@@ -503,8 +503,8 @@ internal void DecodeInterfaceTypeAttribute(AttributeSyntax node, DiagnosticBag d
switch (interfaceType)
{
case ComInterfaceType.InterfaceIsDual:
case ComInterfaceType.InterfaceIsIDispatch:
case Cci.Constants.ComInterfaceType_InterfaceIsDual:
case Cci.Constants.ComInterfaceType_InterfaceIsIDispatch:
case ComInterfaceType.InterfaceIsIInspectable:
case ComInterfaceType.InterfaceIsIUnknown:
break;
......
......@@ -9,7 +9,7 @@
namespace Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE
{
/// <summary>
/// Decodes <see cref="System.Runtime.CompilerServices.DynamicAttribute"/> applied to a specified metadata symbol and
/// Decodes System.Runtime.CompilerServices.DynamicAttribute applied to a specified metadata symbol and
/// transforms the specified metadata type, using the decoded dynamic transforms attribute argument,
/// by replacing each occurrence of <see cref="System.Object"/> type with dynamic type.
/// </summary>
......@@ -48,10 +48,10 @@ private DynamicTypeDecoder(ImmutableArray<bool> dynamicTransformFlags, bool have
}
/// <summary>
/// Decodes the attributes applied to the given <see paramref="targetSymbol"/> from metadata and checks if <see cref="System.Runtime.CompilerServices.DynamicAttribute"/> is applied.
/// Decodes the attributes applied to the given <see paramref="targetSymbol"/> from metadata and checks if System.Runtime.CompilerServices.DynamicAttribute is applied.
/// If so, it transforms the given <see paramref="metadataType"/>, using the decoded dynamic transforms attribute argument,
/// by replacing each occurrence of <see cref="System.Object"/> type with dynamic type.
/// If no <see cref="System.Runtime.CompilerServices.DynamicAttribute"/> is applied or the decoded dynamic transforms attribute argument is erroneous,
/// If no System.Runtime.CompilerServices.DynamicAttribute is applied or the decoded dynamic transforms attribute argument is erroneous,
/// returns the unchanged <see paramref="metadataType"/>.
/// </summary>
/// <remarks>This method is a port of TypeManager::ImportDynamicTransformType from the native compiler.</remarks>
......
......@@ -91,7 +91,7 @@ internal bool IsMarshalAsObject
{
case UnmanagedType.Interface:
case UnmanagedType.IUnknown:
case UnmanagedType.IDispatch:
case Cci.Constants.UnmanagedType_IDispatch:
return true;
}
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#pragma warning disable CS0618
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
......
......@@ -144,15 +144,18 @@ internal interface IVsSqmMulti
{
[return: MarshalAs(UnmanagedType.VariantBool)]
bool GetOptInStatus();
void UnloadSessions(
);
void EndAllSessionsAndAbortUploads(
);
void BeginSession(
[In, MarshalAs(UnmanagedType.U4)] System.UInt32 sessionType,
[In, MarshalAs(UnmanagedType.VariantBool)] System.Boolean alwaysSend,
[Out, MarshalAs(UnmanagedType.U4)] out System.UInt32 sessionHandle
);
void EndSession(
[In, MarshalAs(UnmanagedType.U4)] System.UInt32 sessionHandle
);
......
......@@ -1192,8 +1192,8 @@ private static bool IsValidComInterfaceType(int comInterfaceType)
{
switch (comInterfaceType)
{
case (int)ComInterfaceType.InterfaceIsDual:
case (int)ComInterfaceType.InterfaceIsIDispatch:
case (int)Cci.Constants.ComInterfaceType_InterfaceIsDual:
case (int)Cci.Constants.ComInterfaceType_InterfaceIsIDispatch:
case (int)ComInterfaceType.InterfaceIsIInspectable:
case (int)ComInterfaceType.InterfaceIsIUnknown:
return true;
......
......@@ -16,6 +16,17 @@ internal static class Constants
// Non-portable UnmanagedType values:
public const UnmanagedType UnmanagedType_CustomMarshaler = (UnmanagedType)44;
public const UnmanagedType UnmanagedType_IDispatch = (UnmanagedType)26;
public const UnmanagedType UnmanagedType_SafeArray = (UnmanagedType)29;
public const UnmanagedType UnmanagedType_VBByRefStr = (UnmanagedType)34;
public const UnmanagedType UnmanagedType_AnsiBStr = (UnmanagedType)35;
public const UnmanagedType UnmanagedType_TBStr = (UnmanagedType)36;
public const ComInterfaceType ComInterfaceType_InterfaceIsDual = 0;
public const ComInterfaceType ComInterfaceType_InterfaceIsIDispatch = (ComInterfaceType)2;
public const ClassInterfaceType ClassInterfaceType_AutoDispatch = (ClassInterfaceType)1;
public const ClassInterfaceType ClassInterfaceType_AutoDual = (ClassInterfaceType)2;
// Non-portable CompilationRelaxations value:
public const int CompilationRelaxations_NoStringInterning = 0x0008;
......@@ -107,4 +118,55 @@ internal enum TypeFlags : uint
RTSpecialNameReserved = 0x00000800,
HasSecurityReserved = 0x00040000,
}
/// <summary>
/// System.Runtime.InteropServices.VarEnum is obsolete.
/// </summary>
internal enum VarEnum
{
VT_EMPTY = 0,
VT_NULL = 1,
VT_I2 = 2,
VT_I4 = 3,
VT_R4 = 4,
VT_R8 = 5,
VT_CY = 6,
VT_DATE = 7,
VT_BSTR = 8,
VT_DISPATCH = 9,
VT_ERROR = 10,
VT_BOOL = 11,
VT_VARIANT = 12,
VT_UNKNOWN = 13,
VT_DECIMAL = 14,
VT_I1 = 16,
VT_UI1 = 17,
VT_UI2 = 18,
VT_UI4 = 19,
VT_I8 = 20,
VT_UI8 = 21,
VT_INT = 22,
VT_UINT = 23,
VT_VOID = 24,
VT_HRESULT = 25,
VT_PTR = 26,
VT_SAFEARRAY = 27,
VT_CARRAY = 28,
VT_USERDEFINED = 29,
VT_LPSTR = 30,
VT_LPWSTR = 31,
VT_RECORD = 36,
VT_FILETIME = 64,
VT_BLOB = 65,
VT_STREAM = 66,
VT_STORAGE = 67,
VT_STREAMED_OBJECT = 68,
VT_STORED_OBJECT = 69,
VT_BLOB_OBJECT = 70,
VT_CF = 71,
VT_CLSID = 72,
VT_VECTOR = 0x1000,
VT_ARRAY = 0x2000,
VT_BYREF = 0x4000
}
}
......@@ -4902,7 +4902,7 @@ private void SerializeMarshallingDescriptor(IMarshallingInformation marshallingI
break;
case UnmanagedType.SafeArray:
case Constants.UnmanagedType_SafeArray:
if (marshallingInformation.SafeArrayElementSubtype >= 0)
{
writer.WriteCompressedInteger((uint)marshallingInformation.SafeArrayElementSubtype);
......@@ -4920,7 +4920,7 @@ private void SerializeMarshallingDescriptor(IMarshallingInformation marshallingI
break;
case UnmanagedType.Interface:
case UnmanagedType.IDispatch:
case Constants.UnmanagedType_IDispatch:
case UnmanagedType.IUnknown:
if (marshallingInformation.IidParameterIndex >= 0)
{
......
......@@ -3,11 +3,8 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.InteropServices;
using Roslyn.Utilities;
using EmitContext = Microsoft.CodeAnalysis.Emit.EmitContext;
namespace Microsoft.Cci
......@@ -166,7 +163,7 @@ short ParamIndex
/// (The element type of a safe array is VARIANT. The "sub type" specifies the value of all of the tag fields (vt) of the element values. )
/// -1 if it should be omitted from the marshal blob.
/// </summary>
System.Runtime.InteropServices.VarEnum SafeArrayElementSubtype
VarEnum SafeArrayElementSubtype
{
get;
}
......
......@@ -25,7 +25,7 @@ internal static void Decode(ref DecodeWellKnownAttributeArguments<TAttributeSynt
break;
case UnmanagedType.Interface:
case UnmanagedType.IDispatch:
case Cci.Constants.UnmanagedType_IDispatch:
case UnmanagedType.IUnknown:
DecodeMarshalAsComInterface(ref arguments, unmanagedType, messageProvider);
break;
......@@ -46,7 +46,7 @@ internal static void Decode(ref DecodeWellKnownAttributeArguments<TAttributeSynt
break;
case UnmanagedType.SafeArray:
case Cci.Constants.UnmanagedType_SafeArray:
DecodeMarshalAsSafeArray(ref arguments, messageProvider);
break;
......@@ -62,7 +62,7 @@ internal static void Decode(ref DecodeWellKnownAttributeArguments<TAttributeSynt
break;
case UnmanagedType.VBByRefStr:
case Cci.Constants.UnmanagedType_VBByRefStr:
if (target == AttributeTargets.Field)
{
messageProvider.ReportMarshalUnmanagedTypeNotValidForFields(arguments.Diagnostics, arguments.AttributeSyntaxOpt, 0, "VBByRefStr", arguments.Attribute);
......@@ -281,7 +281,7 @@ private static void DecodeMarshalAsSafeArray(ref DecodeWellKnownAttributeArgumen
{
Debug.Assert((object)arguments.AttributeSyntaxOpt != null);
VarEnum? elementTypeVariant = null;
Cci.VarEnum? elementTypeVariant = null;
ITypeSymbol elementTypeSymbol = null;
int symbolIndex = -1;
bool hasErrors = false;
......@@ -292,7 +292,7 @@ private static void DecodeMarshalAsSafeArray(ref DecodeWellKnownAttributeArgumen
switch (namedArg.Key)
{
case "SafeArraySubType":
elementTypeVariant = namedArg.Value.DecodeValue<VarEnum>(SpecialType.System_Enum);
elementTypeVariant = namedArg.Value.DecodeValue<Cci.VarEnum>(SpecialType.System_Enum);
if (elementTypeVariant < 0 || (int)elementTypeVariant > MarshalPseudoCustomAttributeData.MaxMarshalInteger)
{
messageProvider.ReportInvalidNamedArgument(arguments.Diagnostics, arguments.AttributeSyntaxOpt, position, arguments.Attribute.AttributeClass, namedArg.Key);
......@@ -320,9 +320,9 @@ private static void DecodeMarshalAsSafeArray(ref DecodeWellKnownAttributeArgumen
switch (elementTypeVariant)
{
case VarEnum.VT_DISPATCH:
case VarEnum.VT_UNKNOWN:
case VarEnum.VT_RECORD:
case Cci.VarEnum.VT_DISPATCH:
case Cci.VarEnum.VT_UNKNOWN:
case Cci.VarEnum.VT_RECORD:
// only these variants accept specification of user defined subtype
break;
......
......@@ -21,7 +21,7 @@ internal sealed class MarshalPseudoCustomAttributeData : Cci.IMarshallingInforma
internal const int Invalid = -1;
private const UnmanagedType InvalidUnmanagedType = (UnmanagedType)Invalid;
private const VarEnum InvalidVariantType = (VarEnum)Invalid;
private const Cci.VarEnum InvalidVariantType = (Cci.VarEnum)Invalid;
internal const int MaxMarshalInteger = 0x1fffffff;
#region Initialization
......@@ -66,11 +66,11 @@ internal void SetMarshalAsFixedArray(UnmanagedType? elementType, int? elementCou
_marshalArrayElementCount = elementCount ?? Invalid;
}
internal void SetMarshalAsSafeArray(VarEnum? elementType, ITypeSymbol elementTypeSymbol)
internal void SetMarshalAsSafeArray(Cci.VarEnum? elementType, ITypeSymbol elementTypeSymbol)
{
Debug.Assert(elementType == null || elementType >= 0 && (int)elementType <= MaxMarshalInteger);
_marshalType = UnmanagedType.SafeArray;
_marshalType = Cci.Constants.UnmanagedType_SafeArray;
_marshalArrayElementType = (int)(elementType ?? InvalidVariantType);
_marshalTypeNameOrSymbol = elementTypeSymbol;
}
......@@ -103,7 +103,7 @@ int Cci.IMarshallingInformation.IidParameterIndex
Debug.Assert(
_marshalType == UnmanagedType.Interface ||
_marshalType == UnmanagedType.IUnknown ||
_marshalType == UnmanagedType.IDispatch);
_marshalType == Cci.Constants.UnmanagedType_IDispatch);
return _marshalParameterIndex;
}
......@@ -137,7 +137,7 @@ int Cci.IMarshallingInformation.NumberOfElements
{
get
{
Debug.Assert(_marshalType == UnmanagedType.ByValTStr || _marshalType == UnmanagedType.LPArray || _marshalType == UnmanagedType.SafeArray || _marshalType == UnmanagedType.ByValArray);
Debug.Assert(_marshalType == UnmanagedType.ByValTStr || _marshalType == UnmanagedType.LPArray || _marshalType == Cci.Constants.UnmanagedType_SafeArray || _marshalType == UnmanagedType.ByValArray);
return _marshalArrayElementCount;
}
}
......@@ -160,18 +160,18 @@ UnmanagedType Cci.IMarshallingInformation.ElementType
}
}
VarEnum Cci.IMarshallingInformation.SafeArrayElementSubtype
Cci.VarEnum Cci.IMarshallingInformation.SafeArrayElementSubtype
{
get
{
Debug.Assert(_marshalType == UnmanagedType.SafeArray);
return (VarEnum)_marshalArrayElementType;
Debug.Assert(_marshalType == Cci.Constants.UnmanagedType_SafeArray);
return (Cci.VarEnum)_marshalArrayElementType;
}
}
Cci.ITypeReference Cci.IMarshallingInformation.GetSafeArrayElementUserDefinedSubtype(EmitContext context)
{
Debug.Assert(_marshalType == UnmanagedType.SafeArray);
Debug.Assert(_marshalType == Cci.Constants.UnmanagedType_SafeArray);
if (_marshalTypeNameOrSymbol == null)
{
......@@ -189,7 +189,7 @@ Cci.ITypeReference Cci.IMarshallingInformation.GetSafeArrayElementUserDefinedSub
Func<TTypeSymbol, TArg, TTypeSymbol> translator, TArg arg)
where TTypeSymbol : ITypeSymbol
{
if (_marshalType != UnmanagedType.SafeArray || _marshalTypeNameOrSymbol == null)
if (_marshalType != Cci.Constants.UnmanagedType_SafeArray || _marshalTypeNameOrSymbol == null)
{
return this;
}
......@@ -201,7 +201,7 @@ Cci.ITypeReference Cci.IMarshallingInformation.GetSafeArrayElementUserDefinedSub
}
var result = new MarshalPseudoCustomAttributeData();
result.SetMarshalAsSafeArray((VarEnum)_marshalArrayElementType, translatedType);
result.SetMarshalAsSafeArray((Cci.VarEnum)_marshalArrayElementType, translatedType);
return result;
}
......
......@@ -423,7 +423,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
CType(ctorArgument.DecodeValue(Of Short)(SpecialType.System_Int16), ClassInterfaceType))
Select Case interfaceType
Case ClassInterfaceType.None, ClassInterfaceType.AutoDispatch, ClassInterfaceType.AutoDual
Case ClassInterfaceType.None, Cci.Constants.ClassInterfaceType_AutoDispatch, Cci.Constants.ClassInterfaceType_AutoDual
Exit Select
Case Else
diagnostics.Add(ERRID.ERR_BadAttribute1, If(nodeOpt IsNot Nothing, nodeOpt.ArgumentList.Arguments(0).GetLocation(), NoLocation.Singleton), Me.AttributeClass)
......@@ -448,7 +448,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
CType(ctorArgument.DecodeValue(Of Short)(SpecialType.System_Int16), ComInterfaceType))
Select Case interfaceType
Case ComInterfaceType.InterfaceIsDual, ComInterfaceType.InterfaceIsIDispatch, ComInterfaceType.InterfaceIsIInspectable, ComInterfaceType.InterfaceIsIUnknown
Case Cci.Constants.ComInterfaceType_InterfaceIsDual, Cci.Constants.ComInterfaceType_InterfaceIsIDispatch, ComInterfaceType.InterfaceIsIInspectable, ComInterfaceType.InterfaceIsIUnknown
Return True
Case Else
Return False
......
......@@ -1421,7 +1421,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols.Metadata.PE
' Is interface marked with 'InterfaceTypeAttribute( flags with ComInterfaceType.InterfaceIsIDispatch )' attribute
Dim interfaceType As ComInterfaceType = Nothing
If metadataModule.HasInterfaceTypeAttribute(Me._handle, interfaceType) AndAlso
(interfaceType And ComInterfaceType.InterfaceIsIDispatch) <> 0 Then
(interfaceType And Cci.Constants.ComInterfaceType_InterfaceIsIDispatch) <> 0 Then
Return True
End If
......
......@@ -90,7 +90,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
Friend ReadOnly Property IsMarshalAsObject As Boolean
Get
Select Case Me.MarshallingType
Case UnmanagedType.Interface, UnmanagedType.IUnknown, UnmanagedType.IDispatch
Case UnmanagedType.Interface, UnmanagedType.IUnknown, Cci.Constants.UnmanagedType_IDispatch
Return True
End Select
......
......@@ -2029,7 +2029,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
If Not attrdata.HasErrors Then
Dim interfaceType As ComInterfaceType = Nothing
If attrdata.DecodeInterfaceTypeAttribute(interfaceType) AndAlso
(interfaceType And ComInterfaceType.InterfaceIsIDispatch) <> 0 Then
(interfaceType And Cci.Constants.ComInterfaceType_InterfaceIsIDispatch) <> 0 Then
arguments.GetOrCreateData(Of TypeEarlyWellKnownAttributeData).HasAttributeForExtensibleInterface = True
End If
......
......@@ -988,7 +988,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
ImmutableArray.Create(
New TypedConstant(_comClass.GetSpecialType(SpecialType.System_Int16),
TypedConstantKind.Primitive,
CShort(ComInterfaceType.InterfaceIsIDispatch)))))
CShort(Cci.Constants.ComInterfaceType_InterfaceIsIDispatch)))))
End If
AddSynthesizedAttribute(attributes, compilation.TrySynthesizeAttribute(
......
......@@ -400,10 +400,10 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
Select Case pinvoke.CharacterSet
Case Cci.Constants.CharSet_None, CharSet.Ansi
info.SetMarshalAsSimpleType(UnmanagedType.AnsiBStr)
info.SetMarshalAsSimpleType(Cci.Constants.UnmanagedType_AnsiBStr)
Case Cci.Constants.CharSet_Auto
info.SetMarshalAsSimpleType(UnmanagedType.TBStr)
info.SetMarshalAsSimpleType(Cci.Constants.UnmanagedType_TBStr)
Case CharSet.Unicode
info.SetMarshalAsSimpleType(UnmanagedType.BStr)
......@@ -412,7 +412,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
Throw ExceptionUtilities.UnexpectedValue(pinvoke.CharacterSet)
End Select
Else
info.SetMarshalAsSimpleType(UnmanagedType.VBByRefStr)
info.SetMarshalAsSimpleType(Cci.Constants.UnmanagedType_VBByRefStr)
End If
Return info
......
......@@ -41,13 +41,13 @@ public void GetReaderForFile_NextToPE()
{
var importer = new SymMetadataImport(new MemoryStream(TestResources.Documents.PortableDll));
string tempDir = Path.Combine(Path.GetDirectoryName(PortableShim.Path.GetTempFileName()), Guid.NewGuid().ToString());
string tempDir = Path.Combine(Path.GetDirectoryName(Path.GetTempFileName()), Guid.NewGuid().ToString());
string peFilePath = Path.Combine(tempDir, "Documents.dll");
string pdbFilePath = Path.Combine(tempDir, "Documents.pdb");
Directory.CreateDirectory(tempDir);
PortableShim.File.WriteAllBytes(peFilePath, TestResources.Documents.PortableDll);
PortableShim.File.WriteAllBytes(pdbFilePath, TestResources.Documents.PortablePdb);
File.WriteAllBytes(peFilePath, TestResources.Documents.PortableDll);
File.WriteAllBytes(pdbFilePath, TestResources.Documents.PortablePdb);
string searchPath = null;
......@@ -68,15 +68,15 @@ public void GetReaderForFile_SearchPaths()
{
var importer = new SymMetadataImport(new MemoryStream(TestResources.Documents.PortableDll));
string tempDir = Path.Combine(Path.GetDirectoryName(PortableShim.Path.GetTempFileName()), Guid.NewGuid().ToString());
string tempDir = Path.Combine(Path.GetDirectoryName(Path.GetTempFileName()), Guid.NewGuid().ToString());
string searchDir = Path.Combine(tempDir, "Dir");
string peFilePath = Path.Combine(tempDir, "Documents.dll");
string pdbFilePath = Path.Combine(searchDir, "Documents.pdb");
Directory.CreateDirectory(tempDir);
Directory.CreateDirectory(searchDir);
PortableShim.File.WriteAllBytes(peFilePath, TestResources.Documents.PortableDll);
PortableShim.File.WriteAllBytes(pdbFilePath, TestResources.Documents.PortablePdb);
File.WriteAllBytes(peFilePath, TestResources.Documents.PortableDll);
File.WriteAllBytes(pdbFilePath, TestResources.Documents.PortablePdb);
string searchPath = searchDir;
......@@ -97,15 +97,15 @@ public void GetReaderForFile_SearchPaths_SubDir1()
{
var importer = new SymMetadataImport(new MemoryStream(TestResources.Documents.PortableDll));
string tempDir = Path.Combine(Path.GetDirectoryName(PortableShim.Path.GetTempFileName()), Guid.NewGuid().ToString());
string tempDir = Path.Combine(Path.GetDirectoryName(Path.GetTempFileName()), Guid.NewGuid().ToString());
string searchDir = Path.Combine(tempDir, "Dir");
string peFilePath = Path.Combine(tempDir, "Documents.dll");
string pdbFilePath = Path.Combine(searchDir, "dll", "Documents.pdb");
Directory.CreateDirectory(tempDir);
Directory.CreateDirectory(Path.GetDirectoryName(pdbFilePath));
PortableShim.File.WriteAllBytes(peFilePath, TestResources.Documents.PortableDll);
PortableShim.File.WriteAllBytes(pdbFilePath, TestResources.Documents.PortablePdb);
File.WriteAllBytes(peFilePath, TestResources.Documents.PortableDll);
File.WriteAllBytes(pdbFilePath, TestResources.Documents.PortablePdb);
string searchPath = searchDir;
......@@ -126,15 +126,15 @@ public void GetReaderForFile_SearchPaths_SubDir2()
{
var importer = new SymMetadataImport(new MemoryStream(TestResources.Documents.PortableDll));
string tempDir = Path.Combine(Path.GetDirectoryName(PortableShim.Path.GetTempFileName()), Guid.NewGuid().ToString());
string tempDir = Path.Combine(Path.GetDirectoryName(Path.GetTempFileName()), Guid.NewGuid().ToString());
string searchDir = Path.Combine(tempDir, "Dir");
string peFilePath = Path.Combine(tempDir, "Documents.dll");
string pdbFilePath = Path.Combine(searchDir, "symbols", "dll", "Documents.pdb");
Directory.CreateDirectory(tempDir);
Directory.CreateDirectory(Path.GetDirectoryName(pdbFilePath));
PortableShim.File.WriteAllBytes(peFilePath, TestResources.Documents.PortableDll);
PortableShim.File.WriteAllBytes(pdbFilePath, TestResources.Documents.PortablePdb);
File.WriteAllBytes(peFilePath, TestResources.Documents.PortableDll);
File.WriteAllBytes(pdbFilePath, TestResources.Documents.PortablePdb);
string searchPath = searchDir;
......@@ -157,7 +157,7 @@ public void GetReaderForFile_SkipNative1()
{
var importer = new SymMetadataImport(new MemoryStream(TestResources.Documents.PortableDll));
string tempDir = Path.Combine(Path.GetDirectoryName(PortableShim.Path.GetTempFileName()), Guid.NewGuid().ToString());
string tempDir = Path.Combine(Path.GetDirectoryName(Path.GetTempFileName()), Guid.NewGuid().ToString());
string searchDir = Path.Combine(tempDir, "Dir");
string peFilePath = Path.Combine(tempDir, "Documents.dll");
string pdbFilePath = Path.Combine(searchDir, "Documents.pdb");
......@@ -166,9 +166,9 @@ public void GetReaderForFile_SkipNative1()
Directory.CreateDirectory(tempDir);
Directory.CreateDirectory(Path.GetDirectoryName(pdbFilePath));
Directory.CreateDirectory(Path.GetDirectoryName(nativePdbFilePath));
PortableShim.File.WriteAllBytes(peFilePath, TestResources.Documents.PortableDll);
PortableShim.File.WriteAllBytes(pdbFilePath, TestResources.Documents.PortablePdb);
PortableShim.File.WriteAllBytes(nativePdbFilePath, TestResources.Documents.Pdb);
File.WriteAllBytes(peFilePath, TestResources.Documents.PortableDll);
File.WriteAllBytes(pdbFilePath, TestResources.Documents.PortablePdb);
File.WriteAllBytes(nativePdbFilePath, TestResources.Documents.Pdb);
string searchPath = searchDir;
......@@ -189,7 +189,7 @@ public void GetReaderForFile_SkipNative2()
{
var importer = new SymMetadataImport(new MemoryStream(TestResources.Documents.PortableDll));
string tempDir = Path.Combine(Path.GetDirectoryName(PortableShim.Path.GetTempFileName()), Guid.NewGuid().ToString());
string tempDir = Path.Combine(Path.GetDirectoryName(Path.GetTempFileName()), Guid.NewGuid().ToString());
string searchDir1 = Path.Combine(tempDir, "Dir1");
string searchDir2 = Path.Combine(tempDir, "Dir2");
string peFilePath = Path.Combine(tempDir, "Documents.dll");
......@@ -199,9 +199,9 @@ public void GetReaderForFile_SkipNative2()
Directory.CreateDirectory(tempDir);
Directory.CreateDirectory(Path.GetDirectoryName(pdbFilePath));
Directory.CreateDirectory(Path.GetDirectoryName(nativePdbFilePath));
PortableShim.File.WriteAllBytes(peFilePath, TestResources.Documents.PortableDll);
PortableShim.File.WriteAllBytes(pdbFilePath, TestResources.Documents.PortablePdb);
PortableShim.File.WriteAllBytes(nativePdbFilePath, TestResources.Documents.Pdb);
File.WriteAllBytes(peFilePath, TestResources.Documents.PortableDll);
File.WriteAllBytes(pdbFilePath, TestResources.Documents.PortablePdb);
File.WriteAllBytes(nativePdbFilePath, TestResources.Documents.Pdb);
string searchPath = searchDir1 + ";" + searchDir2;
......@@ -222,7 +222,7 @@ public void GetReaderForFile_SkipNonMatching()
{
var importer = new SymMetadataImport(new MemoryStream(TestResources.Documents.PortableDll));
string tempDir = Path.Combine(Path.GetDirectoryName(PortableShim.Path.GetTempFileName()), Guid.NewGuid().ToString());
string tempDir = Path.Combine(Path.GetDirectoryName(Path.GetTempFileName()), Guid.NewGuid().ToString());
string searchDir = Path.Combine(tempDir, "Dir");
string peFilePath = Path.Combine(tempDir, "Documents.dll");
string pdbFilePath = Path.Combine(searchDir, "Documents.pdb");
......@@ -231,9 +231,9 @@ public void GetReaderForFile_SkipNonMatching()
Directory.CreateDirectory(tempDir);
Directory.CreateDirectory(Path.GetDirectoryName(pdbFilePath));
Directory.CreateDirectory(Path.GetDirectoryName(anotherPdbFilePath));
PortableShim.File.WriteAllBytes(peFilePath, TestResources.Documents.PortableDll);
PortableShim.File.WriteAllBytes(pdbFilePath, TestResources.Documents.PortablePdb);
PortableShim.File.WriteAllBytes(anotherPdbFilePath, TestResources.Async.PortablePdb);
File.WriteAllBytes(peFilePath, TestResources.Documents.PortableDll);
File.WriteAllBytes(pdbFilePath, TestResources.Documents.PortablePdb);
File.WriteAllBytes(anotherPdbFilePath, TestResources.Async.PortablePdb);
string searchPath = searchDir;
......@@ -254,15 +254,15 @@ public void GetReaderForFile_MatchingNotFound()
{
var importer = new SymMetadataImport(new MemoryStream(TestResources.Documents.PortableDll));
string tempDir = Path.Combine(Path.GetDirectoryName(PortableShim.Path.GetTempFileName()), Guid.NewGuid().ToString());
string tempDir = Path.Combine(Path.GetDirectoryName(Path.GetTempFileName()), Guid.NewGuid().ToString());
string searchDir = Path.Combine(tempDir, "Dir");
string peFilePath = Path.Combine(tempDir, "Documents.dll");
string anotherPdbFilePath = Path.Combine(searchDir, "symbols", "dll", "Documents.pdb");
Directory.CreateDirectory(tempDir);
Directory.CreateDirectory(Path.GetDirectoryName(anotherPdbFilePath));
PortableShim.File.WriteAllBytes(peFilePath, TestResources.Documents.PortableDll);
PortableShim.File.WriteAllBytes(anotherPdbFilePath, TestResources.Async.PortablePdb);
File.WriteAllBytes(peFilePath, TestResources.Documents.PortableDll);
File.WriteAllBytes(anotherPdbFilePath, TestResources.Async.PortablePdb);
string searchPath = searchDir;
......@@ -276,8 +276,8 @@ public void GetReaderForFile_MatchingNotFound()
[Fact]
public void GetReaderFromPdbFile()
{
string filePath = PortableShim.Path.GetTempFileName();
PortableShim.File.WriteAllBytes(filePath, TestResources.Documents.PortablePdb);
string filePath = Path.GetTempFileName();
File.WriteAllBytes(filePath, TestResources.Documents.PortablePdb);
ISymUnmanagedReader symReader;
Assert.Equal(HResult.S_OK, SymBinder.GetReaderFromPdbFile(NotImplementedMetadataProvider.Instance, filePath, out symReader));
......@@ -291,7 +291,7 @@ public void GetReaderFromPdbFile()
Assert.Throws<ObjectDisposedException>(() => symReader.GetDocuments(0, out actualCount, null));
PortableShim.File.Delete(filePath);
File.Delete(filePath);
}
[Fact]
......
......@@ -28,9 +28,6 @@
<Compile Include="..\..\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs">
<Link>Utilities\ReflectionUtilities.cs</Link>
</Compile>
<Compile Include="..\..\Compilers\Core\Portable\PortableShim.cs">
<Link>Utilities\PortableShim.cs</Link>
</Compile>
<Compile Include="..\Roslyn.Reflection.Metadata.Decoding\ArrayShape.cs">
<Link>System.Reflection.Metadata.Decoding\ArrayShape.cs</Link>
</Compile>
......@@ -87,6 +84,7 @@
<Compile Include="SymMethod.cs" />
<Compile Include="SymReader.cs" />
<Compile Include="SymVariable.cs" />
<Compile Include="Utilities\PortableShim.cs" />
</ItemGroup>
<ItemGroup>
<None Include="project.json" />
......
......@@ -13,22 +13,19 @@
<dependency id="System.Collections.Immutable" version="1.1.37" />
</group>
<group targetFramework="netstandard1.1">
<dependency id="Microsoft.DiaSymReader" version="1.0.8-rc2-60406-06" />
<dependency id="System.Collections" version="4.0.11-rc3-24011-00" />
<dependency id="System.Collections.Immutable" version="1.2.0-rc3-24011-00" />
<dependency id="System.Diagnostics.Debug" version="4.0.11-rc3-24011-00" />
<dependency id="System.Globalization" version="4.0.0-rc3-24011-00" />
<dependency id="System.IO" version="4.1.0-rc3-24011-00" />
<dependency id="System.Linq" version="4.1.0-rc3-24011-00" />
<dependency id="System.Reflection" version="4.1.0-rc3-24011-00" />
<dependency id="System.Reflection.Metadata" version="1.3.0-rc3-24011-00" />
<dependency id="System.Reflection.Primitives" version="4.0.1-rc3-24011-00" />
<dependency id="System.Runtime" version="4.1.0-rc3-24011-00" />
<dependency id="System.Runtime.Extensions" version="4.1.0-rc3-24011-00" />
<dependency id="System.Runtime.InteropServices" version="4.1.0-rc3-24011-00" />
<dependency id="System.Text.Encoding" version="4.0.11-rc3-24011-00" />
<dependency id="System.Threading" version="4.0.11-rc3-24011-00" />
<dependency id="System.Xml.XDocument" version="4.0.11-rc3-24011-00" />
<dependency id="Microsoft.DiaSymReader" version="1.0.8-rc2-60409-05" />
<dependency id="System.Collections" version="4.0.11-rc2-24022" />
<dependency id="System.Collections.Immutable" version="1.2.0-rc2-24022" />
<dependency id="System.Diagnostics.Debug" version="4.0.11-rc2-24022" />
<dependency id="System.IO" version="4.1.0-rc2-24022" />
<dependency id="System.Linq" version="4.1.0-rc2-24022" />
<dependency id="System.Reflection" version="4.1.0-rc2-24022" />
<dependency id="System.Reflection.Metadata" version="1.3.0-rc2-24022" />
<dependency id="System.Reflection.Primitives" version="4.0.1-rc2-24022" />
<dependency id="System.Runtime" version="4.1.0-rc2-24022" />
<dependency id="System.Runtime.Extensions" version="4.1.0-rc2-24022" />
<dependency id="System.Runtime.InteropServices" version="4.1.0-rc2-24022" />
<dependency id="System.Threading" version="4.0.11-rc2-24022" />
</group>
</dependencies>
<language>en-US</language>
......
// 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.Globalization;
using System.IO;
using System.Reflection;
using Roslyn.Utilities;
namespace Microsoft.DiaSymReader.PortablePdb
{
internal static class PortableShim
{
private static class CoreNames
{
internal const string System_IO_FileSystem = "System.IO.FileSystem, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
internal const string System_Runtime_Extensions = "System.Runtime.Extensions, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
}
internal static class Environment
{
internal const string TypeName = "System.Environment";
internal static readonly Type Type = ReflectionUtilities.GetTypeFromEither(
contractName: $"{TypeName}, {CoreNames.System_Runtime_Extensions}",
desktopName: TypeName);
internal static Func<string, string> GetEnvironmentVariable = (Func<string, string>)Type
.GetTypeInfo()
.GetDeclaredMethod(nameof(GetEnvironmentVariable), paramTypes: new[] { typeof(string) })
.CreateDelegate(typeof(Func<string, string>));
}
internal static class File
{
internal const string TypeName = "System.IO.File";
internal static readonly Type Type = ReflectionUtilities.GetTypeFromEither(
contractName: $"{TypeName}, {CoreNames.System_IO_FileSystem}",
desktopName: TypeName);
internal static readonly Func<string, Stream> OpenRead = Type
.GetTypeInfo()
.GetDeclaredMethod(nameof(OpenRead), paramTypes: new[] { typeof(string) })
.CreateDelegate<Func<string, Stream>>();
internal static readonly Func<string, bool> Exists = Type
.GetTypeInfo()
.GetDeclaredMethod(nameof(Exists), new[] { typeof(string) })
.CreateDelegate<Func<string, bool>>();
internal static readonly Func<string, byte[]> ReadAllBytes = Type
.GetTypeInfo()
.GetDeclaredMethod(nameof(ReadAllBytes), paramTypes: new[] { typeof(string) })
.CreateDelegate<Func<string, byte[]>>();
}
}
}
......@@ -4,6 +4,6 @@
"Moq": "4.2.1402.2112"
},
"frameworks": {
".NETFramework,Version=v4.5": { }
".NETFramework,Version=v4.6": { }
}
}
\ No newline at end of file
......@@ -20,6 +20,6 @@
"Microsoft.VisualStudio.Data.Services": "9.0.21022"
},
"frameworks": {
".NETFramework,Version=v4.5": { }
".NETFramework,Version=v4.6": { }
}
}
\ No newline at end of file
......@@ -8,6 +8,6 @@
"Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "14.1.24720"
},
"frameworks": {
".NETFramework,Version=v4.5": { }
".NETFramework,Version=v4.6": { }
}
}
\ No newline at end of file
......@@ -7,6 +7,6 @@
"Microsoft.VisualStudio.Text.UI.Wpf": "14.1.24720"
},
"frameworks": {
".NETFramework,Version=v4.5": { }
".NETFramework,Version=v4.6": { }
}
}
\ No newline at end of file
......@@ -7073,6 +7073,80 @@ End Module
Await VerifyItemExistsAsync(text, "Length")
End Function
<WorkItem(153633, "https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems/edit/153633")>
<Fact, Trait(Traits.Feature, Traits.Features.Completion)>
Public Async Function LocalInForLoop() As Task
Dim text =
<code><![CDATA[
Module Program
Sub Main(args As String())
Dim x As Integer
For $$
End Sub
End Module
]]></code>.Value
Await VerifyItemExistsAsync(text, "x")
End Function
<WorkItem(153633, "https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems/edit/153633")>
<Fact, Trait(Traits.Feature, Traits.Features.Completion)>
Public Async Function ExcludeConstLocalInForLoop() As Task
Dim text =
<code><![CDATA[
Module Program
Sub Main(args As String())
Dim const x As Integer
For $$
End Sub
End Module
]]></code>.Value
Await VerifyItemIsAbsentAsync(text, "x")
End Function
<WorkItem(153633, "https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems/edit/153633")>
<Fact, Trait(Traits.Feature, Traits.Features.Completion)>
Public Async Function ExcludeConstFieldInForLoop() As Task
Dim text =
<code><![CDATA[
Class Program
Const x As Integer = 0
Sub Main(args As String())
For $$
End Sub
End Class
]]></code>.Value
Await VerifyItemIsAbsentAsync(text, "x")
End Function
<WorkItem(153633, "https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems/edit/153633")>
<Fact, Trait(Traits.Feature, Traits.Features.Completion)>
Public Async Function ExcludeReadOnlyFieldInForLoop() As Task
Dim text =
<code><![CDATA[
Class Program
ReadOnly x As Integer
Sub Main(args As String())
For $$
End Sub
End Class
]]></code>.Value
Await VerifyItemIsAbsentAsync(text, "x")
End Function
<WorkItem(153633, "https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems/edit/153633")>
<Fact, Trait(Traits.Feature, Traits.Features.Completion)>
Public Async Function FieldInForLoop() As Task
Dim text =
<code><![CDATA[
Class Program
Dim x As Integer
Sub Main(args As String())
For $$
End Sub
End Class
]]></code>.Value
Await VerifyItemExistsAsync(text, "x")
End Function
End Class
End Namespace
......@@ -68,7 +68,7 @@ private DynamicFlagsCustomTypeInfo(ArrayBuilder<bool> dynamicFlags, int startInd
/// <remarks>
/// Not guaranteed to add the same number of flags as would
/// appear in a <see cref="System.Runtime.CompilerServices.DynamicAttribute"/>.
/// appear in a System.Runtime.CompilerServices.DynamicAttribute.
/// It may have more (for padding) or fewer (for compactness) falses.
/// It is, however, guaranteed to include the last true.
/// </remarks>
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#pragma warning disable RS0007 // Avoid zero-length array allocations.
using System;
using System.Collections.ObjectModel;
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#pragma warning disable RS0007 // Avoid zero-length array allocations.
using System.Collections.Generic;
using System.Collections.ObjectModel;
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#pragma warning disable RS0007 // Avoid zero-length array allocations.
using System;
using System.Collections.ObjectModel;
......
......@@ -32,6 +32,11 @@
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\Dependencies\VisualStudio\VisualStudio.csproj">
<Project>{8da861d8-0cce-4334-b6c0-01a846c881ec}</Project>
<Name>VisualStudio</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\VisualStudio\Setup\VisualStudioSetup.csproj">
<Project>{201EC5B7-F91E-45E5-B9F2-67A266CCE6FC}</Project>
<Name>VisualStudioSetup</Name>
......@@ -86,16 +91,10 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.Shell.14.0, Version=$(VisualStudioReferenceAssemblyVersion), Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>false</Private>
<HintPath>$(DevEnvDir)\PrivateAssemblies\Microsoft.VisualStudio.Shell.14.0.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>false</Private>
</Reference>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<None Include="project.json" />
<None Include="source.extension.vsixmanifest">
<SubType>Designer</SubType>
</None>
......
{
"dependencies": {
},
"frameworks": {
"net46": { }
},
"runtimes": {
"win7": { },
"win7-anycpu": { }
}
}
......@@ -18,25 +18,25 @@
<dependencies>
<dependency id="Microsoft.CodeAnalysis.Common" version="[$version$]" />
<dependency id="System.AppContext" version="4.1.0-rc2-24008" />
<dependency id="System.Collections" version="4.0.11-rc2-24008" />
<dependency id="System.Collections.Immutable" version="1.2.0-rc2-24008" />
<dependency id="System.Diagnostics.Debug" version="4.0.11-rc2-24008" />
<dependency id="System.Diagnostics.StackTrace" version="4.0.1-rc2-24008" />
<dependency id="System.Diagnostics.Tools" version="4.0.1-rc2-24008" />
<dependency id="System.Globalization" version="4.0.11-rc2-24008" />
<dependency id="System.IO" version="4.1.0-rc2-24008" />
<dependency id="System.IO.FileSystem" version="4.0.1-rc2-24008" />
<dependency id="System.Linq" version="4.1.0-rc2-24008" />
<dependency id="System.Linq.Expressions" version="4.0.11-rc2-24008" />
<dependency id="System.Reflection" version="4.1.0-rc2-24008" />
<dependency id="System.Reflection.Extensions" version="4.0.1-rc2-24008" />
<dependency id="System.Resources.ResourceManager" version="4.0.1-rc2-24008" />
<dependency id="System.Runtime" version="4.1.0-rc2-24008" />
<dependency id="System.Runtime.Extensions" version="4.1.0-rc2-24008" />
<dependency id="System.Runtime.InteropServices" version="4.1.0-rc2-24008" />
<dependency id="System.Threading" version="4.0.11-rc2-24008" />
<dependency id="System.Threading.Tasks" version="4.0.11-rc2-24008" />
<dependency id="System.AppContext" version="4.1.0-rc2-24022" />
<dependency id="System.Collections" version="4.0.11-rc2-24022" />
<dependency id="System.Collections.Immutable" version="1.2.0-rc2-24022" />
<dependency id="System.Diagnostics.Debug" version="4.0.11-rc2-24022" />
<dependency id="System.Diagnostics.StackTrace" version="4.0.1-rc2-24022" />
<dependency id="System.Diagnostics.Tools" version="4.0.1-rc2-24022" />
<dependency id="System.Globalization" version="4.0.11-rc2-24022" />
<dependency id="System.IO" version="4.1.0-rc2-24022" />
<dependency id="System.IO.FileSystem" version="4.0.1-rc2-24022" />
<dependency id="System.Linq" version="4.1.0-rc2-24022" />
<dependency id="System.Linq.Expressions" version="4.0.11-rc2-24022" />
<dependency id="System.Reflection" version="4.1.0-rc2-24022" />
<dependency id="System.Reflection.Extensions" version="4.0.1-rc2-24022" />
<dependency id="System.Resources.ResourceManager" version="4.0.1-rc2-24022" />
<dependency id="System.Runtime" version="4.1.0-rc2-24022" />
<dependency id="System.Runtime.Extensions" version="4.1.0-rc2-24022" />
<dependency id="System.Runtime.InteropServices" version="4.1.0-rc2-24022" />
<dependency id="System.Threading" version="4.0.11-rc2-24022" />
<dependency id="System.Threading.Tasks" version="4.0.11-rc2-24022" />
</dependencies>
</metadata>
<files>
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\..\build\Targets\VSL.Settings.targets" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
<IsPortable>false</IsPortable>
<IsDeployment>true</IsDeployment>
</PropertyGroup>
<Import Project="..\..\..\build\Targets\ProducesNoOutput.Settings.targets" />
<PropertyGroup>
<ProjectGuid>{37BA82E6-9ABD-4ACA-AA26-2DFD39A359A5}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Microsoft.VisualStudio</RootNamespace>
<AssemblyName>ProjectSystem</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
<NoDocumentationFile>true</NoDocumentationFile>
<CopyNuGetImplementations>true</CopyNuGetImplementations>
<CopyReferencesByDefault>true</CopyReferencesByDefault>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
</PropertyGroup>
......@@ -82,5 +74,5 @@
<ItemGroup>
<Content Include="Readme.txt" />
</ItemGroup>
<Import Project="..\..\..\build\Targets\VSL.Imports.targets" />
<Import Project="..\..\..\build\Targets\ProducesNoOutput.Imports.targets" />
</Project>
\ No newline at end of file
......@@ -6,7 +6,6 @@
"net46": { }
},
"runtimes": {
"win7": { },
"win7-anycpu": { }
"win7": { }
}
}
\ No newline at end of file
......@@ -19,8 +19,7 @@
<OptionInfer>On</OptionInfer>
<SignAssembly>true</SignAssembly>
<NoWarn>$(NoWarn);42105;42107;42353;42307</NoWarn>
<CopyNuGetImplementations>false</CopyNuGetImplementations>
<CopyReferencesByDefault>false</CopyReferencesByDefault>
<UseCommonOutputDirectory>true</UseCommonOutputDirectory>
<!-- Override Roslyn which embeds by default -->
<VBRuntime>Default</VBRuntime>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
......
......@@ -19,8 +19,7 @@
<OptionInfer>On</OptionInfer>
<SignAssembly>true</SignAssembly>
<NoWarn>$(NoWarn);42105;42107;42353;42355</NoWarn>
<CopyNuGetImplementations>false</CopyNuGetImplementations>
<CopyReferencesByDefault>false</CopyReferencesByDefault>
<UseCommonOutputDirectory>true</UseCommonOutputDirectory>
<!-- Override Roslyn which embeds by default -->
<VBRuntime>Default</VBRuntime>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
......
......@@ -12,8 +12,7 @@
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<SignAssembly>true</SignAssembly>
<Nonshipping>true</Nonshipping>
<CopyNuGetImplementations>false</CopyNuGetImplementations>
<CopyReferencesByDefault>false</CopyReferencesByDefault>
<UseCommonOutputDirectory>true</UseCommonOutputDirectory>
</PropertyGroup>
<ItemGroup>
<InternalsVisibleToTest Include="Microsoft.VisualStudio.ProjectSystem.CSharp.VS.UnitTests" />
......
......@@ -12,8 +12,7 @@
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<SignAssembly>true</SignAssembly>
<Nonshipping>true</Nonshipping>
<CopyNuGetImplementations>false</CopyNuGetImplementations>
<CopyReferencesByDefault>false</CopyReferencesByDefault>
<UseCommonOutputDirectory>true</UseCommonOutputDirectory>
</PropertyGroup>
<ItemGroup>
<InternalsVisibleToMoq Include="DynamicProxyGenAssembly2" />
......
......@@ -16,8 +16,7 @@
<UseCodebase>true</UseCodebase>
<SignAssembly>true</SignAssembly>
<OutDir>$(OutDir)\ProjectSystem\</OutDir>
<CopyNuGetImplementations>false</CopyNuGetImplementations>
<CopyReferencesByDefault>false</CopyReferencesByDefault>
<UseCommonOutputDirectory>true</UseCommonOutputDirectory>
</PropertyGroup>
<ItemGroup>
<InternalsVisibleToTest Include="Microsoft.VisualStudio.ProjectSystem.CSharp.VS.UnitTests" />
......
......@@ -16,8 +16,7 @@
<UseCodebase>true</UseCodebase>
<SignAssembly>true</SignAssembly>
<OutDir>$(OutDir)\ProjectSystem\</OutDir>
<CopyNuGetImplementations>false</CopyNuGetImplementations>
<CopyReferencesByDefault>false</CopyReferencesByDefault>
<UseCommonOutputDirectory>true</UseCommonOutputDirectory>
</PropertyGroup>
<ItemGroup>
<InternalsVisibleTo Include="Microsoft.VisualStudio.ProjectSystem.CSharp.VS" />
......
......@@ -12,8 +12,7 @@
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<SignAssembly>true</SignAssembly>
<Nonshipping>true</Nonshipping>
<CopyNuGetImplementations>false</CopyNuGetImplementations>
<CopyReferencesByDefault>false</CopyReferencesByDefault>
<UseCommonOutputDirectory>true</UseCommonOutputDirectory>
</PropertyGroup>
<ItemGroup>
<InternalsVisibleToTest Include="Microsoft.VisualStudio.ProjectSystem.Managed.VS.UnitTests" />
......
......@@ -12,8 +12,7 @@
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<SignAssembly>true</SignAssembly>
<Nonshipping>true</Nonshipping>
<CopyNuGetImplementations>false</CopyNuGetImplementations>
<CopyReferencesByDefault>false</CopyReferencesByDefault>
<UseCommonOutputDirectory>true</UseCommonOutputDirectory>
</PropertyGroup>
<ItemGroup>
<InternalsVisibleToTest Include="Microsoft.VisualStudio.ProjectSystem.CSharp.VS.UnitTests" />
......
......@@ -12,8 +12,7 @@
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<SignAssembly>true</SignAssembly>
<OutDir>$(OutDir)\ProjectSystem\</OutDir>
<CopyNuGetImplementations>false</CopyNuGetImplementations>
<CopyReferencesByDefault>false</CopyReferencesByDefault>
<UseCommonOutputDirectory>true</UseCommonOutputDirectory>
</PropertyGroup>
<ItemGroup>
<InternalsVisibleTo Include="Microsoft.VisualStudio.ProjectSystem.CSharp.VS" />
......
......@@ -12,8 +12,7 @@
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<SignAssembly>true</SignAssembly>
<OutDir>$(OutDir)\ProjectSystem\</OutDir>
<CopyNuGetImplementations>false</CopyNuGetImplementations>
<CopyReferencesByDefault>false</CopyReferencesByDefault>
<UseCommonOutputDirectory>true</UseCommonOutputDirectory>
</PropertyGroup>
<ItemGroup>
<InternalsVisibleTo Include="Microsoft.VisualStudio.ProjectSystem.Managed.VS" />
......
......@@ -12,8 +12,7 @@
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<SignAssembly>true</SignAssembly>
<Nonshipping>true</Nonshipping>
<CopyNuGetImplementations>false</CopyNuGetImplementations>
<CopyReferencesByDefault>false</CopyReferencesByDefault>
<UseCommonOutputDirectory>true</UseCommonOutputDirectory>
</PropertyGroup>
<ItemGroup>
<InternalsVisibleToTest Include="Microsoft.VisualStudio.ProjectSystem.VisualBasic.VS.UnitTests" />
......
......@@ -12,8 +12,7 @@
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<SignAssembly>true</SignAssembly>
<Nonshipping>true</Nonshipping>
<CopyNuGetImplementations>false</CopyNuGetImplementations>
<CopyReferencesByDefault>false</CopyReferencesByDefault>
<UseCommonOutputDirectory>true</UseCommonOutputDirectory>
</PropertyGroup>
<ItemGroup>
<InternalsVisibleToMoq Include="DynamicProxyGenAssembly2" />
......
......@@ -16,8 +16,7 @@
<UseCodebase>true</UseCodebase>
<SignAssembly>true</SignAssembly>
<OutDir>$(OutDir)\ProjectSystem\</OutDir>
<CopyNuGetImplementations>false</CopyNuGetImplementations>
<CopyReferencesByDefault>false</CopyReferencesByDefault>
<UseCommonOutputDirectory>true</UseCommonOutputDirectory>
</PropertyGroup>
<ItemGroup>
<InternalsVisibleToTest Include="Microsoft.VisualStudio.ProjectSystem.VisualBasic.VS.UnitTests" />
......
......@@ -16,8 +16,7 @@
<UseCodebase>true</UseCodebase>
<SignAssembly>true</SignAssembly>
<OutDir>$(OutDir)\ProjectSystem\</OutDir>
<CopyNuGetImplementations>false</CopyNuGetImplementations>
<CopyReferencesByDefault>false</CopyReferencesByDefault>
<UseCommonOutputDirectory>true</UseCommonOutputDirectory>
</PropertyGroup>
<ItemGroup>
<InternalsVisibleTo Include="Microsoft.VisualStudio.ProjectSystem.VisualBasic.VS" />
......
......@@ -23,8 +23,7 @@
<CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
<NoDocumentationFile>true</NoDocumentationFile>
<CopyNuGetImplementations>false</CopyNuGetImplementations>
<CopyReferencesByDefault>false</CopyReferencesByDefault>
<UseCommonOutputDirectory>true</UseCommonOutputDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
</PropertyGroup>
......
......@@ -70,9 +70,6 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.VisualStudio.CoreUtility">
<Private>false</Private>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
......
......@@ -43,6 +43,11 @@
<Name>Composition</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\Dependencies\VisualStudio\VisualStudio.csproj">
<Project>{8da861d8-0cce-4334-b6c0-01a846c881ec}</Project>
<Name>VisualStudio</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
......@@ -84,28 +89,6 @@
</None>
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.CoreUtility, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<Private>false</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Editor, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<Private>false</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.OLE.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<Private>false</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.10.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.VisualStudio.Text.Data, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<Private>false</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Text.UI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<Private>false</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Text.UI.Wpf, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<Private>false</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TextManager.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<Private>false</Private>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="System" />
<Reference Include="WindowsBase" />
......
......@@ -39,6 +39,16 @@
<Name>Composition</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Dependencies\VisualStudioText\VisualStudioText.csproj">
<Project>{c25768b3-2fe1-4d6d-8c17-a6acd56f8389}</Project>
<Name>VisualStudioText</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Dependencies\VisualStudio\VisualStudio.csproj">
<Project>{8da861d8-0cce-4334-b6c0-01a846c881ec}</Project>
<Name>VisualStudio</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<NonShipping>true</NonShipping>
......@@ -80,46 +90,6 @@
<Private>false</Private>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.VisualStudio.CoreUtility">
<Private>false</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Editor">
<Private>false</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.OLE.Interop">
<Private>false</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.10.0" />
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.10.0">
<Private>false</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop">
<Private>false</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.10.0">
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.8.0">
<Private>false</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.9.0">
<Private>false</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Text.Data">
<Private>false</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Text.Logic">
<Private>false</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Text.UI">
<Private>false</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Text.UI.Wpf">
<Private>false</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TextManager.Interop">
<Private>false</Private>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
......
......@@ -130,6 +130,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Moq.net", "..\Dependencies\
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Composition", "..\Dependencies\Composition\Composition.csproj", "{A57DDFE5-AB0E-4371-98E5-11B9218DF11C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisualStudio", "..\Dependencies\VisualStudio\VisualStudio.csproj", "{8DA861D8-0CCE-4334-B6C0-01A846C881EC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisualStudioText", "..\Dependencies\VisualStudioText\VisualStudioText.csproj", "{C25768B3-2FE1-4D6D-8C17-A6ACD56F8389}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
......@@ -556,6 +560,30 @@ Global
{A57DDFE5-AB0E-4371-98E5-11B9218DF11C}.Release|Mixed Platforms.Build.0 = Debug|Any CPU
{A57DDFE5-AB0E-4371-98E5-11B9218DF11C}.Release|x86.ActiveCfg = Debug|Any CPU
{A57DDFE5-AB0E-4371-98E5-11B9218DF11C}.Release|x86.Build.0 = Debug|Any CPU
{8DA861D8-0CCE-4334-B6C0-01A846C881EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8DA861D8-0CCE-4334-B6C0-01A846C881EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8DA861D8-0CCE-4334-B6C0-01A846C881EC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{8DA861D8-0CCE-4334-B6C0-01A846C881EC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{8DA861D8-0CCE-4334-B6C0-01A846C881EC}.Debug|x86.ActiveCfg = Debug|Any CPU
{8DA861D8-0CCE-4334-B6C0-01A846C881EC}.Debug|x86.Build.0 = Debug|Any CPU
{8DA861D8-0CCE-4334-B6C0-01A846C881EC}.Release|Any CPU.ActiveCfg = Debug|Any CPU
{8DA861D8-0CCE-4334-B6C0-01A846C881EC}.Release|Any CPU.Build.0 = Debug|Any CPU
{8DA861D8-0CCE-4334-B6C0-01A846C881EC}.Release|Mixed Platforms.ActiveCfg = Debug|Any CPU
{8DA861D8-0CCE-4334-B6C0-01A846C881EC}.Release|Mixed Platforms.Build.0 = Debug|Any CPU
{8DA861D8-0CCE-4334-B6C0-01A846C881EC}.Release|x86.ActiveCfg = Debug|Any CPU
{8DA861D8-0CCE-4334-B6C0-01A846C881EC}.Release|x86.Build.0 = Debug|Any CPU
{C25768B3-2FE1-4D6D-8C17-A6ACD56F8389}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C25768B3-2FE1-4D6D-8C17-A6ACD56F8389}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C25768B3-2FE1-4D6D-8C17-A6ACD56F8389}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{C25768B3-2FE1-4D6D-8C17-A6ACD56F8389}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{C25768B3-2FE1-4D6D-8C17-A6ACD56F8389}.Debug|x86.ActiveCfg = Debug|Any CPU
{C25768B3-2FE1-4D6D-8C17-A6ACD56F8389}.Debug|x86.Build.0 = Debug|Any CPU
{C25768B3-2FE1-4D6D-8C17-A6ACD56F8389}.Release|Any CPU.ActiveCfg = Debug|Any CPU
{C25768B3-2FE1-4D6D-8C17-A6ACD56F8389}.Release|Any CPU.Build.0 = Debug|Any CPU
{C25768B3-2FE1-4D6D-8C17-A6ACD56F8389}.Release|Mixed Platforms.ActiveCfg = Debug|Any CPU
{C25768B3-2FE1-4D6D-8C17-A6ACD56F8389}.Release|Mixed Platforms.Build.0 = Debug|Any CPU
{C25768B3-2FE1-4D6D-8C17-A6ACD56F8389}.Release|x86.ActiveCfg = Debug|Any CPU
{C25768B3-2FE1-4D6D-8C17-A6ACD56F8389}.Release|x86.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......@@ -616,5 +644,7 @@ Global
{8635CB8F-D210-41ED-B4FF-71502CDB475C} = {D14160E0-ACA0-4D2D-A670-CB72A57225F2}
{A32EAB7F-691C-4D00-98C4-F50C37BB4754} = {D14160E0-ACA0-4D2D-A670-CB72A57225F2}
{A57DDFE5-AB0E-4371-98E5-11B9218DF11C} = {D14160E0-ACA0-4D2D-A670-CB72A57225F2}
{8DA861D8-0CCE-4334-B6C0-01A846C881EC} = {D14160E0-ACA0-4D2D-A670-CB72A57225F2}
{C25768B3-2FE1-4D6D-8C17-A6ACD56F8389} = {D14160E0-ACA0-4D2D-A670-CB72A57225F2}
EndGlobalSection
EndGlobal
......@@ -30,6 +30,16 @@
<Name>Composition</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Dependencies\VisualStudioText\VisualStudioText.csproj">
<Project>{c25768b3-2fe1-4d6d-8c17-a6acd56f8389}</Project>
<Name>VisualStudioText</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Dependencies\VisualStudio\VisualStudio.csproj">
<Project>{8da861d8-0cce-4334-b6c0-01a846c881ec}</Project>
<Name>VisualStudio</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<NonShipping>true</NonShipping>
......@@ -74,46 +84,6 @@
<Reference Include="EnvDTE">
<Private>false</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.CoreUtility">
<Private>false</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Editor">
<Private>false</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.OLE.Interop">
<Private>false</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.10.0" />
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.10.0">
<Private>false</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop">
<Private>false</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.10.0">
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.8.0">
<Private>false</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.9.0">
<Private>false</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Text.Data">
<Private>false</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Text.Logic">
<Private>false</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Text.UI">
<Private>false</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Text.UI.Wpf">
<Private>false</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TextManager.Interop">
<Private>false</Private>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
......
......@@ -217,7 +217,7 @@ public static string DecodeForwardIteratorRecord(ImmutableArray<byte> bytes)
}
/// <summary>
/// Does for locals what <see cref="System.Runtime.CompilerServices.DynamicAttribute"/> does for parameters, return types, and fields.
/// Does for locals what System.Runtime.CompilerServices.DynamicAttribute does for parameters, return types, and fields.
/// In particular, indicates which occurrences of <see cref="object"/> in the signature are really dynamic.
/// </summary>
/// <remarks>
......
......@@ -41,13 +41,22 @@ foreach (dynamic test in testInstances)
for (int i = 0; i < iterations; i++)
{
traceManager.StartScenarios();
traceManager.Start();
traceManager.StartScenario(test.Name + i, test.MeasuredProc);
traceManager.StartEvent();
test.Test();
traceManager.EndEvent();
traceManager.EndScenario();
traceManager.StartScenarios();
if (test.ProvidesScenarios)
{
traceManager.WriteScenarios(test.GetScenarios());
test.Test();
}
else
{
traceManager.StartScenario(test.Name + i, test.MeasuredProc);
traceManager.StartEvent();
test.Test();
traceManager.EndEvent();
traceManager.EndScenario();
}
traceManager.EndScenarios();
traceManager.WriteScenariosFileToDisk();
......
......@@ -30,6 +30,11 @@ class CSharpCompilerTest: PerfTest
public override int Iterations => 2;
public override string Name => "csharp " + _rspFile;
public override string MeasuredProc => "csc";
public override bool ProvidesScenarios => false;
public override string[] GetScenarios()
{
throw new System.NotImplementedException();
}
}
TestThisPlease(
......
......@@ -24,6 +24,11 @@ class HelloWorldTest: PerfTest
public override int Iterations => 2;
public override string Name => "hello world";
public override string MeasuredProc => "csc";
public override bool ProvidesScenarios => false;
public override string[] GetScenarios()
{
throw new System.NotImplementedException();
}
}
TestThisPlease(new HelloWorldTest());
......@@ -51,7 +51,7 @@ public class ScenarioGenerator
public void AddStartEvent(int absoluteInstance)
{
WriteToBuffer($@"<from providerGuid=""{KernelProviderGuid}"" absoluteInstance=""{absoluteInstance}"" process=""csc"" eventName = ""Process/Start""/>");
WriteToBuffer($@"<from providerGuid=""{KernelProviderGuid}"" absoluteInstance=""{absoluteInstance}"" process=""csc"" eventName=""Process/Start""/>");
}
public void AddEndEvent()
......@@ -63,6 +63,11 @@ public class ScenarioGenerator
{
WriteToBuffer($@"<!-- {comment} -->");
}
public void AddLine(string line)
{
WriteToBuffer(line);
}
public void WriteToDisk()
{
......
......@@ -138,6 +138,8 @@ abstract class PerfTest: RelativeDirectory {
Log(description + ": " + value.ToString());
}
public abstract bool ProvidesScenarios { get; }
public abstract string[] GetScenarios();
public abstract void Setup();
public abstract void Test();
public abstract int Iterations { get; }
......
......@@ -21,6 +21,7 @@ interface ITraceManager
void StartScenario(string scenarioName, string processName);
void StartScenarios();
void Stop();
void WriteScenarios(string[] scenarios);
void WriteScenariosFileToDisk();
}
......@@ -106,6 +107,10 @@ class NoOpTraceManager : ITraceManager
{
}
public void WriteScenarios(string[] scenarios)
{
}
public void WriteScenariosFileToDisk()
{
}
......@@ -209,6 +214,14 @@ class TraceManager: ITraceManager
{
_scenarioGenerator.AddScenariosFileEnd();
}
public void WriteScenarios(string[] scenarios)
{
foreach (var line in scenarios)
{
_scenarioGenerator.AddLine(line);
}
}
public void WriteScenariosFileToDisk()
{
......
......@@ -20,8 +20,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TargetFrameworkIdentifier>.NETPortable</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
<CopyNuGetImplementations>false</CopyNuGetImplementations>
<CopyReferencesByDefault>false</CopyReferencesByDefault>
<UseCommonOutputDirectory>true</UseCommonOutputDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
</PropertyGroup>
......
......@@ -20,8 +20,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TargetFrameworkIdentifier>.NETPortable</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
<CopyNuGetImplementations>false</CopyNuGetImplementations>
<CopyReferencesByDefault>false</CopyReferencesByDefault>
<UseCommonOutputDirectory>true</UseCommonOutputDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
</PropertyGroup>
......
......@@ -19,8 +19,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TargetFrameworkIdentifier>.NETPortable</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
<CopyNuGetImplementations>false</CopyNuGetImplementations>
<CopyReferencesByDefault>false</CopyReferencesByDefault>
<UseCommonOutputDirectory>true</UseCommonOutputDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
</PropertyGroup>
......
......@@ -27,8 +27,7 @@
<ProjectTypeGuids>{14182A97-F7F0-4C62-8B27-98AA8AE2109A};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>
<TargetFrameworkIdentifier>.NETPortable</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
<CopyNuGetImplementations>false</CopyNuGetImplementations>
<CopyReferencesByDefault>false</CopyReferencesByDefault>
<UseCommonOutputDirectory>true</UseCommonOutputDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
</PropertyGroup>
......
......@@ -24,8 +24,7 @@
<ProjectTypeGuids>{14182A97-F7F0-4C62-8B27-98AA8AE2109A};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>
<TargetFrameworkIdentifier>.NETPortable</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
<CopyNuGetImplementations>false</CopyNuGetImplementations>
<CopyReferencesByDefault>false</CopyReferencesByDefault>
<UseCommonOutputDirectory>true</UseCommonOutputDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
</PropertyGroup>
......
......@@ -248,6 +248,9 @@
<Reference Include="Microsoft.VisualStudio.CallHierarchy.Package.Definitions.dll">
<HintPath>$(DevEnvDir)\Microsoft.VisualStudio.CallHierarchy.Package.Definitions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.ExtensionManager, Version=$(VisualStudioReferenceAssemblyVersion), Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<HintPath>$(DevEnvDir)\PrivateAssemblies\Microsoft.VisualStudio.ExtensionManager.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.CSharp" />
......
......@@ -68,11 +68,29 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Recommendations
Return GetUnqualifiedSymbolsForLabelContext(context, cancellationToken)
ElseIf context.SyntaxTree.IsRaiseEventContext(context.Position, context.TargetToken, cancellationToken) Then
Return GetUnqualifiedSymbolsForRaiseEvent(context, cancellationToken)
ElseIf context.TargetToken.IsKind(SyntaxKind.ForKeyword) Then
Dim symbols = GetUnqualifiedSymbolsForExpressionOrStatementContext(context, filterOutOfScopeLocals, cancellationToken) _
.Where(AddressOf IsWritableFieldOrLocal)
Return symbols
End If
Return SpecializedCollections.EmptyEnumerable(Of ISymbol)()
End Function
Private Function IsWritableFieldOrLocal(symbol As ISymbol) As Boolean
If symbol.Kind() = SymbolKind.Field Then
Dim field = DirectCast(symbol, IFieldSymbol)
Return Not field.IsReadOnly AndAlso Not field.IsConst
End If
If symbol.Kind() = SymbolKind.Local Then
Dim local = DirectCast(symbol, ILocalSymbol)
Return Not local.IsConst
End If
Return False
End Function
Private Function GetSymbolsForGlobalStatementContext(
context As VisualBasicSyntaxContext,
cancellationToken As CancellationToken
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册