提交 7755b163 编写于 作者: D Dustin Campbell

Merge pull request #4759 from DustinCampbell/portable-features

Make Features layer portable

要显示的变更太多。

To preserve performance only 1000 of 1000+ files are displayed.
......@@ -103,11 +103,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RunTests", "src\Tools\Sourc
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSourceDebug", "src\Tools\Source\OpenSourceDebug\OpenSourceDebug.csproj", "{43026D51-3083-4850-928D-07E1883D5B1A}"
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "BasicFeatures", "src\Features\VisualBasic\BasicFeatures.vbproj", "{A1BCD0CE-6C2F-4F8C-9A48-D9D93928E26D}"
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "BasicFeatures", "src\Features\VisualBasic\Portable\BasicFeatures.vbproj", "{A1BCD0CE-6C2F-4F8C-9A48-D9D93928E26D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpFeatures", "src\Features\CSharp\CSharpFeatures.csproj", "{3973B09A-4FBF-44A5-8359-3D22CEB71F71}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpFeatures", "src\Features\CSharp\Portable\CSharpFeatures.csproj", "{3973B09A-4FBF-44A5-8359-3D22CEB71F71}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Features", "src\Features\Core\Features.csproj", "{EDC68A0E-C68D-4A74-91B7-BF38EC909888}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Features", "src\Features\Core\Portable\Features.csproj", "{EDC68A0E-C68D-4A74-91B7-BF38EC909888}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TextEditorFeatures", "src\EditorFeatures\Text\TextEditorFeatures.csproj", "{18F5FBB8-7570-4412-8CC7-0A86FF13B7BA}"
EndProject
......
......@@ -2,7 +2,9 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.ExceptionServices;
namespace Roslyn.Utilities
{
......@@ -73,5 +75,34 @@ public static T CreateDelegate<T>(this MethodInfo methodInfo)
return (T)(object)methodInfo.CreateDelegate(typeof(T));
}
public static T InvokeConstructor<T>(this ConstructorInfo constructorInfo, params object[] args)
{
if (constructorInfo == null)
{
return default(T);
}
try
{
return (T)constructorInfo.Invoke(args);
}
catch (TargetInvocationException e)
{
ExceptionDispatchInfo.Capture(e.InnerException).Throw();
Debug.Assert(false, "Unreachable");
return default(T);
}
}
public static object InvokeConstructor(this ConstructorInfo constructorInfo, params object[] args)
{
return constructorInfo.InvokeConstructor<object>(args);
}
public static T Invoke<T>(this MethodInfo methodInfo, object obj, params object[] args)
{
return (T)methodInfo.Invoke(obj, args);
}
}
}
......@@ -56,6 +56,7 @@ internal static void Initialize()
Touch(Path.Type);
Touch(RuntimeHelpers.Type);
Touch(SearchOption.Type);
Touch(StackTrace.Type);
Touch(Thread.Type);
Touch(XPath.Extensions.Type);
Touch(HashAlgorithm.Type);
......@@ -74,6 +75,7 @@ private static void Touch(Type type)
private static class CoreNames
{
internal const string System_Diagnostics_FileVersionInfo = "System.Diagnostics.FileVersionInfo, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
internal const string System_Diagnostics_StackTrace = "System.Diagnostics.StackTrace, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
internal const string System_IO_FileSystem = "System.IO.FileSystem, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
internal const string System_IO_FileSystem_Primitives = "System.IO.FileSystem.Primitives, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
internal const string System_Reflection = "System.Reflection, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
......@@ -322,38 +324,24 @@ internal static class FileStream
.GetTypeInfo()
.GetDeclaredConstructor(paramTypes: new[] { typeof(string), FileMode.Type, FileAccess.Type, FileShare.Type, typeof(int), FileOptions.Type });
private static Stream InvokeConstructor(ConstructorInfo constructorInfo, object[] args)
{
try
{
return (Stream)constructorInfo.Invoke(args);
}
catch (TargetInvocationException e)
{
ExceptionDispatchInfo.Capture(e.InnerException).Throw();
Debug.Assert(false, "Unreachable");
return null;
}
}
internal static Stream Create(string path, object mode)
{
return InvokeConstructor(s_Ctor_String_FileMode, new[] { path, mode });
return s_Ctor_String_FileMode.InvokeConstructor<Stream>(path, mode);
}
internal static Stream Create(string path, object mode, object access)
{
return InvokeConstructor(s_Ctor_String_FileMode_FileAccess, new[] { path, mode, access });
return s_Ctor_String_FileMode_FileAccess.InvokeConstructor<Stream>(path, mode, access);
}
internal static Stream Create(string path, object mode, object access, object share)
{
return InvokeConstructor(s_Ctor_String_FileMode_FileAccess_FileShare, new[] { path, mode, access, share });
return s_Ctor_String_FileMode_FileAccess_FileShare.InvokeConstructor<Stream>(path, mode, access, share);
}
internal static Stream Create(string path, object mode, object access, object share, int bufferSize, object options)
{
return InvokeConstructor(s_Ctor_String_FileMode_FileAccess_FileShare_Int32_FileOptions, new[] { path, mode, access, share, bufferSize, options });
return s_Ctor_String_FileMode_FileAccess_FileShare_Int32_FileOptions.InvokeConstructor<Stream>(path, mode, access, share, bufferSize, options);
}
internal static Stream Create_String_FileMode_FileAccess_FileShare(string path, object mode, object access, object share)
......@@ -413,6 +401,30 @@ internal static class RuntimeHelpers
.CreateDelegate<Action>();
}
internal static class StackTrace
{
internal const string TypeName = "System.Diagnostics.StackTrace";
internal static readonly Type Type = ReflectionUtilities.GetTypeFromEither(
contractName: $"{TypeName}, {CoreNames.System_Diagnostics_StackTrace}",
desktopName: TypeName);
private static readonly ConstructorInfo s_Ctor = Type
.GetTypeInfo()
.GetDeclaredConstructor(new Type[] { });
private static readonly MethodInfo s_ToString = Type
.GetTypeInfo()
.GetDeclaredMethod("ToString", new Type[] { });
internal static string GetString()
{
var stackTrace = s_Ctor.InvokeConstructor();
return s_ToString.Invoke<string>(stackTrace) ?? "StackTrace unavailable.";
}
}
internal static class Encoding
{
internal static readonly Type Type = typeof(System.Text.Encoding);
......
......@@ -31,11 +31,11 @@
<Project>{5F8D2414-064A-4B3A-9B42-8E2A04246BE5}</Project>
<Name>Workspaces</Name>
</ProjectReference>
<ProjectReference Include="..\..\Features\CSharp\CSharpFeatures.csproj">
<ProjectReference Include="..\..\Features\CSharp\Portable\CSharpFeatures.csproj">
<Project>{3973B09A-4FBF-44A5-8359-3D22CEB71F71}</Project>
<Name>CSharpFeatures</Name>
</ProjectReference>
<ProjectReference Include="..\..\Features\Core\Features.csproj">
<ProjectReference Include="..\..\Features\Core\Portable\Features.csproj">
<Project>{EDC68A0E-C68D-4A74-91B7-BF38EC909888}</Project>
<Name>Features</Name>
</ProjectReference>
......
......@@ -45,11 +45,11 @@
<Project>{5F8D2414-064A-4B3A-9B42-8E2A04246BE5}</Project>
<Name>Workspaces</Name>
</ProjectReference>
<ProjectReference Include="..\..\Features\CSharp\CSharpFeatures.csproj">
<ProjectReference Include="..\..\Features\CSharp\Portable\CSharpFeatures.csproj">
<Project>{3973B09A-4FBF-44A5-8359-3D22CEB71F71}</Project>
<Name>CSharpFeatures</Name>
</ProjectReference>
<ProjectReference Include="..\..\Features\Core\Features.csproj">
<ProjectReference Include="..\..\Features\Core\Portable\Features.csproj">
<Project>{EDC68A0E-C68D-4A74-91B7-BF38EC909888}</Project>
<Name>Features</Name>
</ProjectReference>
......
......@@ -36,7 +36,7 @@
<Project>{5F8D2414-064A-4B3A-9B42-8E2A04246BE5}</Project>
<Name>Workspaces</Name>
</ProjectReference>
<ProjectReference Include="..\..\Features\Core\Features.csproj">
<ProjectReference Include="..\..\Features\Core\Portable\Features.csproj">
<Project>{EDC68A0E-C68D-4A74-91B7-BF38EC909888}</Project>
<Name>Features</Name>
</ProjectReference>
......
......@@ -64,7 +64,7 @@
<Project>{2e87fa96-50bb-4607-8676-46521599f998}</Project>
<Name>Workspaces.Desktop</Name>
</ProjectReference>
<ProjectReference Include="..\..\Features\VisualBasic\BasicFeatures.vbproj">
<ProjectReference Include="..\..\Features\VisualBasic\Portable\BasicFeatures.vbproj">
<Project>{A1BCD0CE-6C2F-4F8C-9A48-D9D93928E26D}</Project>
<Name>BasicFeatures</Name>
</ProjectReference>
......@@ -76,7 +76,7 @@
<Project>{5F8D2414-064A-4B3A-9B42-8E2A04246BE5}</Project>
<Name>Workspaces</Name>
</ProjectReference>
<ProjectReference Include="..\..\Features\CSharp\CSharpFeatures.csproj">
<ProjectReference Include="..\..\Features\CSharp\Portable\CSharpFeatures.csproj">
<Project>{3973B09A-4FBF-44A5-8359-3D22CEB71F71}</Project>
<Name>CSharpFeatures</Name>
</ProjectReference>
......@@ -84,7 +84,7 @@
<Project>{21B239D0-D144-430F-A394-C066D58EE267}</Project>
<Name>CSharpWorkspace</Name>
</ProjectReference>
<ProjectReference Include="..\..\Features\Core\Features.csproj">
<ProjectReference Include="..\..\Features\Core\Portable\Features.csproj">
<Project>{EDC68A0E-C68D-4A74-91B7-BF38EC909888}</Project>
<Name>Features</Name>
</ProjectReference>
......
// 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.ComponentModel.Composition;
using System.Composition;
using Microsoft.CodeAnalysis.Shared.TestHooks;
using Microsoft.CodeAnalysis.Text;
namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.EventHookup
{
[Shared]
[Export(typeof(IAsynchronousOperationListener))]
[Export(typeof(IAsynchronousOperationWaiter))]
[Feature(FeatureAttribute.EventHookup)]
......
// 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.ComponentModel.Composition;
using System.Composition;
using Microsoft.CodeAnalysis.Shared.TestHooks;
using Microsoft.CodeAnalysis.Text;
namespace Microsoft.CodeAnalysis.Editor.UnitTests.RenameTracking
{
[Shared]
[Export(typeof(IAsynchronousOperationListener))]
[Export(typeof(IAsynchronousOperationWaiter))]
[Feature(FeatureAttribute.RenameTracking)]
......
......@@ -2,7 +2,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Composition;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
......@@ -912,11 +912,13 @@ private static SolutionInfo GetInitialSolutionInfo(TestWorkspace workspace)
return provider.GetExports<IAsynchronousOperationListener, FeatureMetadata>();
}
[Shared]
[Export(typeof(IAsynchronousOperationListener))]
[Export(typeof(IAsynchronousOperationWaiter))]
[Feature(FeatureAttribute.SolutionCrawler)]
private class SolutionCrawlerWaiter : AsynchronousOperationListener { }
[Shared]
[Export(typeof(IAsynchronousOperationListener))]
[Export(typeof(IAsynchronousOperationWaiter))]
[Feature(FeatureAttribute.Workspace)]
......
......@@ -50,7 +50,7 @@
<Project>{2e87fa96-50bb-4607-8676-46521599f998}</Project>
<Name>Workspaces.Desktop</Name>
</ProjectReference>
<ProjectReference Include="..\..\Features\VisualBasic\BasicFeatures.vbproj">
<ProjectReference Include="..\..\Features\VisualBasic\Portable\BasicFeatures.vbproj">
<Project>{A1BCD0CE-6C2F-4F8C-9A48-D9D93928E26D}</Project>
<Name>BasicFeatures</Name>
</ProjectReference>
......@@ -62,7 +62,7 @@
<Project>{5F8D2414-064A-4B3A-9B42-8E2A04246BE5}</Project>
<Name>Workspaces</Name>
</ProjectReference>
<ProjectReference Include="..\..\Features\CSharp\CSharpFeatures.csproj">
<ProjectReference Include="..\..\Features\CSharp\Portable\CSharpFeatures.csproj">
<Project>{3973B09A-4FBF-44A5-8359-3D22CEB71F71}</Project>
<Name>CSharpFeatures</Name>
</ProjectReference>
......@@ -74,7 +74,7 @@
<Project>{3CDEEAB7-2256-418A-BEB2-620B5CB16302}</Project>
<Name>EditorFeatures</Name>
</ProjectReference>
<ProjectReference Include="..\..\Features\Core\Features.csproj">
<ProjectReference Include="..\..\Features\Core\Portable\Features.csproj">
<Project>{EDC68A0E-C68D-4A74-91B7-BF38EC909888}</Project>
<Name>Features</Name>
</ProjectReference>
......
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
Imports System.ComponentModel.Composition
Imports System.Composition
Imports Microsoft.CodeAnalysis.Shared.TestHooks
Imports Microsoft.CodeAnalysis.Text
Namespace Microsoft.CodeAnalysis.Editor.UnitTests.IntelliSense
<[Shared]>
<Export(GetType(IAsynchronousOperationListener))>
<Export(GetType(IAsynchronousOperationWaiter))>
<Feature(FeatureAttribute.CompletionSet)>
......
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
Imports System.ComponentModel.Composition
Imports System.Composition
Imports Microsoft.CodeAnalysis.Shared.TestHooks
Imports Microsoft.CodeAnalysis.Text
Namespace Microsoft.CodeAnalysis.Editor.UnitTests.IntelliSense
<[Shared]>
<Export(GetType(IAsynchronousOperationListener))>
<Export(GetType(IAsynchronousOperationWaiter))>
<Feature(FeatureAttribute.SignatureHelp)>
......
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
Imports System.Composition
Imports Microsoft.CodeAnalysis.Shared.TestHooks
Imports Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces
Imports Microsoft.VisualStudio.Text
Imports Microsoft.VisualStudio.Composition
Imports System.ComponentModel.Composition
Namespace Microsoft.CodeAnalysis.Editor.UnitTests.NavigationBar
Public Class NavigationBarControllerTests
Friend ReadOnly ExportProvider As ExportProvider = MinimalTestExportProvider.CreateExportProvider(
TestExportProvider.EntireAssemblyCatalogWithCSharpAndVisualBasic.WithPart(GetType(NavigationBarWaiter)))
<[Shared]>
<Export(GetType(IAsynchronousOperationListener))>
<Export(GetType(IAsynchronousOperationWaiter))>
<Export(GetType(NavigationBarWaiter))>
......
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
Imports System.ComponentModel.Composition
Imports System.Composition
Imports Microsoft.CodeAnalysis.Shared.TestHooks
Namespace Microsoft.CodeAnalysis.Editor.UnitTests.Rename
<[Shared]>
<Export(GetType(IAsynchronousOperationListener))>
<Export(GetType(IAsynchronousOperationWaiter))>
<Feature(FeatureAttribute.Rename)>
......
......@@ -25,7 +25,7 @@
<Project>{2523D0E6-DF32-4A3E-8AE0-A19BFFAE2EF6}</Project>
<Name>BasicCodeAnalysis</Name>
</ProjectReference>
<ProjectReference Include="..\..\Features\VisualBasic\BasicFeatures.vbproj">
<ProjectReference Include="..\..\Features\VisualBasic\Portable\BasicFeatures.vbproj">
<Project>{A1BCD0CE-6C2F-4F8C-9A48-D9D93928E26D}</Project>
<Name>BasicFeatures</Name>
</ProjectReference>
......@@ -33,7 +33,7 @@
<Project>{5F8D2414-064A-4B3A-9B42-8E2A04246BE5}</Project>
<Name>Workspaces</Name>
</ProjectReference>
<ProjectReference Include="..\..\Features\Core\Features.csproj">
<ProjectReference Include="..\..\Features\Core\Portable\Features.csproj">
<Project>{EDC68A0E-C68D-4A74-91B7-BF38EC909888}</Project>
<Name>Features</Name>
</ProjectReference>
......
......@@ -47,7 +47,7 @@
<Project>{76C6F005-C89D-4348-BB4A-391898DBEB52}</Project>
<Name>TestUtilities.Desktop</Name>
</ProjectReference>
<ProjectReference Include="..\..\Features\VisualBasic\BasicFeatures.vbproj">
<ProjectReference Include="..\..\Features\VisualBasic\Portable\BasicFeatures.vbproj">
<Project>{A1BCD0CE-6C2F-4F8C-9A48-D9D93928E26D}</Project>
<Name>BasicFeatures</Name>
</ProjectReference>
......@@ -55,7 +55,7 @@
<Project>{5F8D2414-064A-4B3A-9B42-8E2A04246BE5}</Project>
<Name>Workspaces</Name>
</ProjectReference>
<ProjectReference Include="..\..\Features\Core\Features.csproj">
<ProjectReference Include="..\..\Features\Core\Portable\Features.csproj">
<Project>{EDC68A0E-C68D-4A74-91B7-BF38EC909888}</Project>
<Name>Features</Name>
</ProjectReference>
......
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="Settings">
<Import Project="..\..\..\build\Targets\VSL.Settings.targets" />
<Import Project="..\..\..\..\build\Targets\VSL.Settings.targets" />
</ImportGroup>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
......@@ -12,67 +12,62 @@
<AssemblyName>Microsoft.CodeAnalysis.CSharp.Features</AssemblyName>
<TargetExt>.dll</TargetExt>
<SolutionDir Condition="'$(SolutionDir)' == '' OR '$(SolutionDir)' == '*Undefined*'">..\..\..\</SolutionDir>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile>Profile7</TargetFrameworkProfile>
<TargetFrameworkIdentifier>.NETPortable</TargetFrameworkIdentifier>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<RestorePackages>true</RestorePackages>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
</PropertyGroup>
<ItemGroup Label="File References">
<Reference Include="..\..\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll" />
<Reference Include="System.Collections.Immutable">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath>
</Reference>
<Reference Include="System.Composition.AttributedModel">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\packages\Microsoft.Composition.$(MicrosoftCompositionVersion)\lib\portable-net45+win8+wp8+wpa81\System.Composition.AttributedModel.dll</HintPath>
</Reference>
<Reference Include="System.Composition.Convention">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\packages\Microsoft.Composition.$(MicrosoftCompositionVersion)\lib\portable-net45+win8+wp8+wpa81\System.Composition.Convention.dll</HintPath>
</Reference>
<Reference Include="System.Composition.Hosting">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\packages\Microsoft.Composition.$(MicrosoftCompositionVersion)\lib\portable-net45+win8+wp8+wpa81\System.Composition.Hosting.dll</HintPath>
</Reference>
<Reference Include="System.Composition.Runtime">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\packages\Microsoft.Composition.$(MicrosoftCompositionVersion)\lib\portable-net45+win8+wp8+wpa81\System.Composition.Runtime.dll</HintPath>
</Reference>
<Reference Include="System.Composition.TypedParts">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\packages\Microsoft.Composition.$(MicrosoftCompositionVersion)\lib\portable-net45+win8+wp8+wpa81\System.Composition.TypedParts.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\Compilers\Core\Portable\CodeAnalysis.csproj">
<ProjectReference Include="..\..\..\Compilers\Core\Portable\CodeAnalysis.csproj">
<Project>{1EE8CAD3-55F9-4D91-96B2-084641DA9A6C}</Project>
<Name>CodeAnalysis</Name>
</ProjectReference>
<ProjectReference Include="..\..\Compilers\CSharp\Portable\CSharpCodeAnalysis.csproj">
<ProjectReference Include="..\..\..\Compilers\CSharp\Portable\CSharpCodeAnalysis.csproj">
<Project>{B501A547-C911-4A05-AC6E-274A50DFF30E}</Project>
<Name>CSharpCodeAnalysis</Name>
</ProjectReference>
<ProjectReference Include="..\..\Workspaces\Core\Portable\Workspaces.csproj">
<ProjectReference Include="..\..\..\Workspaces\Core\Portable\Workspaces.csproj">
<Project>{5F8D2414-064A-4B3A-9B42-8E2A04246BE5}</Project>
<Name>Workspaces</Name>
</ProjectReference>
<ProjectReference Include="..\..\Workspaces\CSharp\Portable\CSharpWorkspace.csproj">
<ProjectReference Include="..\..\..\Workspaces\CSharp\Portable\CSharpWorkspace.csproj">
<Project>{21B239D0-D144-430F-A394-C066D58EE267}</Project>
<Name>CSharpWorkspace</Name>
</ProjectReference>
<ProjectReference Include="..\Core\Features.csproj">
<ProjectReference Include="..\..\Core\Portable\Features.csproj">
<Project>{EDC68A0E-C68D-4A74-91B7-BF38EC909888}</Project>
<Name>Features</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'" />
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="System" />
<Reference Include="System.Collections" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Composition.AttributedModel">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Composition.$(MicrosoftCompositionVersion)\lib\portable-net45+win8+wp8+wpa81\System.Composition.AttributedModel.dll</HintPath>
</Reference>
<Reference Include="System.Composition.Convention">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Composition.$(MicrosoftCompositionVersion)\lib\portable-net45+win8+wp8+wpa81\System.Composition.Convention.dll</HintPath>
</Reference>
<Reference Include="System.Composition.Hosting">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Composition.$(MicrosoftCompositionVersion)\lib\portable-net45+win8+wp8+wpa81\System.Composition.Hosting.dll</HintPath>
</Reference>
<Reference Include="System.Composition.Runtime">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Composition.$(MicrosoftCompositionVersion)\lib\portable-net45+win8+wp8+wpa81\System.Composition.Runtime.dll</HintPath>
</Reference>
<Reference Include="System.Composition.TypedParts">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Composition.$(MicrosoftCompositionVersion)\lib\portable-net45+win8+wp8+wpa81\System.Composition.TypedParts.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.CSharp.EditorFeatures" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.CSharp" />
......@@ -85,7 +80,7 @@
<InternalsVisibleToTest Include="Roslyn.VisualStudio.CSharp.UnitTests" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\Compilers\CSharp\Portable\Syntax\LambdaUtilities.cs">
<Compile Include="..\..\..\Compilers\CSharp\Portable\Syntax\LambdaUtilities.cs">
<Link>InternalUtilities\LambdaUtilities.cs</Link>
</Compile>
<Compile Include="ChangeSignature\ChangeSignatureCodeRefactoringProvider.cs" />
......@@ -389,9 +384,9 @@
<PublicAPI Include="PublicAPI.Shipped.txt" />
<PublicAPI Include="PublicAPI.Unshipped.txt" />
</ItemGroup>
<Import Project="..\..\Compilers\CSharp\CSharpAnalyzerDriver\CSharpAnalyzerDriver.projitems" Label="Shared" />
<Import Project="..\..\..\Compilers\CSharp\CSharpAnalyzerDriver\CSharpAnalyzerDriver.projitems" Label="Shared" />
<ImportGroup Label="Targets">
<Import Project="..\..\..\build\Targets\VSL.Imports.targets" />
<Import Project="..\..\..\..\build\Targets\VSL.Imports.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
</ImportGroup>
</Project>
</Project>
\ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.0
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
......@@ -10,6 +10,7 @@
namespace Microsoft.CodeAnalysis.CSharp {
using System;
using System.Reflection;
/// <summary>
......@@ -39,7 +40,7 @@ internal class CSharpFeaturesResources {
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.CodeAnalysis.CSharp.CSharpFeaturesResources", typeof(CSharpFeaturesResources).Assembly);
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.CodeAnalysis.CSharp.CSharpFeaturesResources", typeof(CSharpFeaturesResources).GetTypeInfo().Assembly);
resourceMan = temp;
}
return resourceMan;
......
......@@ -305,7 +305,7 @@
</data>
<data name="TryBlock" xml:space="preserve">
<value>try block</value>
<comment>{Locked="try"} "try" is a C# keyword and should not be localized.</comment>
<comment>{Locked="try"} "try" is a C# keyword and should not be localized.</comment>
</data>
<data name="CatchClause" xml:space="preserve">
<value>catch clause</value>
......@@ -316,39 +316,39 @@
</data>
<data name="FinallyClause" xml:space="preserve">
<value>finally clause</value>
<comment>{Locked="finally"} "finally" is a C# keyword and should not be localized.</comment>
<comment>{Locked="finally"} "finally" is a C# keyword and should not be localized.</comment>
</data>
<data name="FixedStatement" xml:space="preserve">
<value>fixed statement</value>
<comment>{Locked="fixed"} "fixed" is a C# keyword and should not be localized.</comment>
<comment>{Locked="fixed"} "fixed" is a C# keyword and should not be localized.</comment>
</data>
<data name="UsingStatement" xml:space="preserve">
<value>using statement</value>
<comment>{Locked="using"} "using" is a C# keyword and should not be localized.</comment>
<comment>{Locked="using"} "using" is a C# keyword and should not be localized.</comment>
</data>
<data name="LockStatement" xml:space="preserve">
<value>lock statement</value>
<comment>{Locked="lock"} "lock" is a C# keyword and should not be localized.</comment>
<comment>{Locked="lock"} "lock" is a C# keyword and should not be localized.</comment>
</data>
<data name="ForEachStatement" xml:space="preserve">
<value>foreach statement</value>
<comment>{Locked="foreach"} "foreach" is a C# keyword and should not be localized.</comment>
<comment>{Locked="foreach"} "foreach" is a C# keyword and should not be localized.</comment>
</data>
<data name="CheckedStatement" xml:space="preserve">
<value>checked statement</value>
<comment>{Locked="checked"} "checked" is a C# keyword and should not be localized.</comment>
<comment>{Locked="checked"} "checked" is a C# keyword and should not be localized.</comment>
</data>
<data name="UncheckedStatement" xml:space="preserve">
<value>unchecked statement</value>
<comment>{Locked="unchecked"} "unchecked" is a C# keyword and should not be localized.</comment>
<comment>{Locked="unchecked"} "unchecked" is a C# keyword and should not be localized.</comment>
</data>
<data name="YieldStatement" xml:space="preserve">
<value>yield statement</value>
<comment>{Locked="yield"} "yield" is a C# keyword and should not be localized.</comment>
<comment>{Locked="yield"} "yield" is a C# keyword and should not be localized.</comment>
</data>
<data name="AwaitExpression" xml:space="preserve">
<value>await expression</value>
<comment>{Locked="await"} "await" is a C# keyword and should not be localized.</comment>
<comment>{Locked="await"} "await" is a C# keyword and should not be localized.</comment>
</data>
<data name="Lambda" xml:space="preserve">
<value>lambda</value>
......@@ -361,38 +361,38 @@
</data>
<data name="JoinClause" xml:space="preserve">
<value>join clause</value>
<comment>{Locked="join"} "join" is a C# keyword and should not be localized.</comment>
<comment>{Locked="join"} "join" is a C# keyword and should not be localized.</comment>
</data>
<data name="LetClause" xml:space="preserve">
<value>let clause</value>
<comment>{Locked="let"} "let" is a C# keyword and should not be localized.</comment>
<comment>{Locked="let"} "let" is a C# keyword and should not be localized.</comment>
</data>
<data name="WhereClause" xml:space="preserve">
<value>where clause</value>
<comment>{Locked="where"} "where" is a C# keyword and should not be localized.</comment>
<comment>{Locked="where"} "where" is a C# keyword and should not be localized.</comment>
</data>
<data name="OrderByClause" xml:space="preserve">
<value>orderby clause</value>
<comment>{Locked="orderby"} "orderby" is a C# keyword and should not be localized.</comment>
<comment>{Locked="orderby"} "orderby" is a C# keyword and should not be localized.</comment>
</data>
<data name="SelectClause" xml:space="preserve">
<value>select clause</value>
<comment>{Locked="select"} "select" is a C# keyword and should not be localized.</comment>
<comment>{Locked="select"} "select" is a C# keyword and should not be localized.</comment>
</data>
<data name="GroupByClause" xml:space="preserve">
<value>groupby clause</value>
<comment>{Locked="groupby"} "groupby" is a C# keyword and should not be localized.</comment>
<comment>{Locked="groupby"} "groupby" is a C# keyword and should not be localized.</comment>
</data>
<data name="QueryBody" xml:space="preserve">
<value>query body</value>
<value>query body</value>
</data>
<data name="IntoClause" xml:space="preserve">
<value>into clause</value>
<comment>{Locked="into"} "into" is a C# keyword and should not be localized.</comment>
<comment>{Locked="into"} "into" is a C# keyword and should not be localized.</comment>
</data>
<data name="GlobalStatement" xml:space="preserve">
<value>global statement</value>
<comment>{Locked="global"} "global" is a C# keyword and should not be localized.</comment>
<comment>{Locked="global"} "global" is a C# keyword and should not be localized.</comment>
</data>
<data name="UsingNamespace" xml:space="preserve">
<value>using namespace</value>
......
// 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.Collections.Immutable;
using System.Composition;
......@@ -700,7 +701,11 @@ private bool IsViablePropertyOrField(ISymbol propertyOrField, SyntaxNode express
return false;
}
return string.Compare(propertyOrField.ContainingType.Name, leftName.Identifier.Text, this.IgnoreCase) == 0;
var comparisonType = this.IgnoreCase
? StringComparison.OrdinalIgnoreCase
: StringComparison.Ordinal;
return string.Compare(propertyOrField.ContainingType.Name, leftName.Identifier.Text, comparisonType) == 0;
}
internal override bool IsAddMethodContext(SyntaxNode node, SemanticModel semanticModel)
......
// 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.Linq;
using Microsoft.CodeAnalysis.Completion;
using Microsoft.CodeAnalysis.Text;
......@@ -19,12 +18,12 @@ internal class ItemRules : CompletionItemRules
public override bool? IsCommitCharacter(CompletionItem completionItem, char ch, string textTypedSoFar)
{
if (ch == '{' && completionItem.DisplayText.Contains('{'))
if (ch == '{' && completionItem.DisplayText.Contains("{"))
{
return false;
}
if (ch == '(' && completionItem.DisplayText.Contains('('))
if (ch == '(' && completionItem.DisplayText.Contains("("))
{
return false;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册