提交 1bd2ff31 编写于 作者: S Srivatsn Narayanan

Merge pull request #8557 from srivatsn/fsharpivt

Changes needed to create a F# language service based on Roslyn workspace model 
......@@ -17,6 +17,9 @@
<InternalsVisibleToTypeScript>
<Visible>false</Visible>
</InternalsVisibleToTypeScript>
<InternalsVisibleToFSharp>
<Visible>false</Visible>
</InternalsVisibleToFSharp>
<InternalsVisibleToMoq>
<Visible>false</Visible>
</InternalsVisibleToMoq>
......@@ -33,7 +36,7 @@
Inputs="$(MSBuildThisFileFullPath);$(MSBuildProjectFile)"
Outputs="$(GeneratedInternalsVisibleToFile)"
DependsOnTargets="PrepareForBuild"
Condition="'@(InternalsVisibleTo)' != '' OR '@(InternalsVisibleToTest)' != '' OR '@(InternalsVisibleToTypeScript)' != '' OR '@(InternalsVisibleToMoq)' != ''">
Condition="'@(InternalsVisibleTo)' != '' OR '@(InternalsVisibleToTest)' != '' OR '@(InternalsVisibleToTypeScript)' != '' OR '@(InternalsVisibleToFSharp)' != '' OR '@(InternalsVisibleToMoq)' != ''">
<!--
This is a slightly evil trick. What we have is a group of InternalsVisibleTo items which
......@@ -66,6 +69,11 @@
Condition="'@(InternalsVisibleToTypeScript)' != ''">
<Output TaskParameter="Include" ItemName="InternalsVisibleToAttribute" />
</CreateItem>
<CreateItem Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute"
AdditionalMetadata="_Parameter1=%(InternalsVisibleToFSharp.Identity), PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293"
Condition="'@(InternalsVisibleToFSharp)' != ''">
<Output TaskParameter="Include" ItemName="InternalsVisibleToAttribute" />
</CreateItem>
<CreateItem Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute"
AdditionalMetadata="_Parameter1=%(InternalsVisibleToMoq.Identity), PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7"
Condition="'@(InternalsVisibleToMoq)' != ''">
......
......@@ -134,6 +134,7 @@
<InternalsVisibleToTypeScript Include="Microsoft.VisualStudio.LanguageServices.TypeScript" />
<InternalsVisibleToTypeScript Include="Microsoft.Test.Apex.VisualStudio" />
<InternalsVisibleToTypeScript Include="Roslyn.Services.Editor.TypeScript.UnitTests" />
<InternalsVisibleToFSharp Include="FSharp.Editor" />
<InternalsVisibleToMoq Include="DynamicProxyGenAssembly2" />
</ItemGroup>
<ItemGroup>
......
......@@ -16,8 +16,7 @@
namespace Microsoft.CodeAnalysis.Editor.Implementation.Classification
{
[Export(typeof(ITaggerProvider))]
[ContentType(ContentTypeNames.CSharpContentType)]
[ContentType(ContentTypeNames.VisualBasicContentType)]
[ContentType(ContentTypeNames.RoslynContentType)]
[TextViewRole(PredefinedTextViewRoles.Document)]
[TagType(typeof(IClassificationTag))]
internal partial class SyntacticClassificationTaggerProvider : ITaggerProvider
......
......@@ -51,6 +51,8 @@
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.VisualBasic.InteractiveEditorFeatures" />
<InternalsVisibleToTypeScript Include="Microsoft.CodeAnalysis.TypeScript.EditorFeatures" />
<InternalsVisibleToTypeScript Include="Microsoft.VisualStudio.LanguageServices.TypeScript" />
<InternalsVisibleToFSharp Include="FSharp.Editor" />
<InternalsVisibleToFSharp Include="FSharp.LanguageService" />
<!-- The rest are for test purposes only. -->
<InternalsVisibleToTest Include="Roslyn.Services.Editor.CSharp.UnitTests" />
<InternalsVisibleToTest Include="Roslyn.Services.Editor.UnitTests" />
......
......@@ -69,6 +69,7 @@
<InternalsVisibleToTypeScript Include="Microsoft.CodeAnalysis.TypeScript.EditorFeatures" />
<InternalsVisibleToTypeScript Include="Microsoft.VisualStudio.LanguageServices.TypeScript" />
<InternalsVisibleToTypeScript Include="Roslyn.Services.Editor.TypeScript.UnitTests" />
<InternalsVisibleToFSharp Include="FSharp.Editor" />
<InternalsVisibleToMoq Include="DynamicProxyGenAssembly2" />
</ItemGroup>
<ItemGroup>
......
......@@ -352,6 +352,11 @@ public ImmutableArray<ProjectReference> GetCurrentProjectReferences()
{
return ImmutableArray.CreateRange(_projectReferences);
}
public ImmutableArray<VisualStudioMetadataReference> GetCurrentMetadataReferences()
{
return ImmutableArray.CreateRange(_metadataReferences);
}
public IVisualStudioHostDocument GetDocumentOrAdditionalDocument(DocumentId id)
{
......
......@@ -234,6 +234,8 @@
<InternalsVisibleToTypeScript Include="ManagedSourceCodeAnalysis" />
<InternalsVisibleToTypeScript Include="CodeAnalysis" />
<InternalsVisibleToTypeScript Include="StanCore" />
<InternalsVisibleToFSharp Include="FSharp.Editor" />
<InternalsVisibleToFSharp Include="FSharp.LanguageService" />
</ItemGroup>
<ItemGroup>
<Reference Include="envdte, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
......
......@@ -67,6 +67,8 @@
<InternalsVisibleToTest Include="Roslyn.VisualStudio.Services.UnitTests" />
<InternalsVisibleToTypeScript Include="Microsoft.VisualStudio.LanguageServices.TypeScript" />
<InternalsVisibleToTypeScript Include="Microsoft.CodeAnalysis.TypeScript.EditorFeatures" />
<InternalsVisibleToFSharp Include="FSharp.Editor" />
<InternalsVisibleToFSharp Include="FSharp.LanguageService" />
</ItemGroup>
<ItemGroup>
<Reference Include="envdte, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
......
......@@ -3,6 +3,7 @@
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Globalization;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CodeFixes;
......@@ -57,6 +58,15 @@ public static DiagnosticData ToDiagnosticData(this Diagnostic diagnostic, Projec
return DiagnosticData.Create(project.GetDocument(diagnostic.Location.SourceTree), diagnostic);
}
if (diagnostic.Location.Kind == LocationKind.ExternalFile)
{
var document = project.Documents.FirstOrDefault(d => d.FilePath == diagnostic.Location.GetLineSpan().Path);
if (document != null)
{
return DiagnosticData.Create(document, diagnostic);
}
}
return DiagnosticData.Create(project, diagnostic);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册