Skip to content
Permalink
Browse files

F# Shim - Round 2 (#35591)

* Added fsharp shims over document diagnostic analyzers

* Added shims for completion and sig help. Also added tests.

* Moved around internal files. Added shim over InlineRenameService.

* Starting shim over document highlights service. Added a better way to handle diagnostics

* Added shim for document highlights service

* Added IFSharpDocumentNavigationService

* Added IFSharpGoToDefinitionService

* Added IFSharpNavigationBarItemService

* Added IFSharpNavigateToSearchService

* Added extra glyph case

* Added FSharpGlyphTags

* Added FSharpCommentSelectionService

* Some cleanup. Added FSharpBlockStructureService

* Added some simple statics

* Finishing the last of shims

* Getting analyzers to work

* Remove folder

* Changes due to feedback

* Fixing build

* Still trying to fix build

* Fixed guid

* Fixing build again
  • Loading branch information...
TIHan committed Jun 11, 2019
1 parent 9948e3d commit 0d44ad1adbc96c99cd64ab1eededea5d6afd0edf
Showing with 6,354 additions and 650 deletions.
  1. +7 −0 Roslyn.sln
  2. +1 −1 src/EditorFeatures/Core.Wpf/Microsoft.CodeAnalysis.EditorFeatures.Wpf.csproj
  3. +1 −2 src/EditorFeatures/Core/Microsoft.CodeAnalysis.EditorFeatures.csproj
  4. +1 −2 src/EditorFeatures/Text/Microsoft.CodeAnalysis.EditorFeatures.Text.csproj
  5. +1 −1 src/Features/Core/Portable/Microsoft.CodeAnalysis.Features.csproj
  6. +1 −0 src/Test/Utilities/Portable/Roslyn.Test.Utilities.csproj
  7. +29 −0 src/Tools/ExternalAccess/FSharp/Completion/FSharpCommonCompletionItem.cs
  8. +15 −0 src/Tools/ExternalAccess/FSharp/Completion/FSharpCommonCompletionProvider.cs
  9. +16 −0 src/Tools/ExternalAccess/FSharp/Completion/FSharpCommonCompletionUtilities.cs
  10. +38 −0 src/Tools/ExternalAccess/FSharp/Completion/FSharpFileSystemCompletionHelper.cs
  11. +24 −0 src/Tools/ExternalAccess/FSharp/Completion/IFSharpCommonCompletionProvider.cs
  12. +0 −2 src/Tools/ExternalAccess/FSharp/Diagnostics/FSharpDiagnosticCustomTags.cs
  13. +12 −0 src/Tools/ExternalAccess/FSharp/Diagnostics/FSharpIDEDiagnosticIds.cs
  14. +15 −0 src/Tools/ExternalAccess/FSharp/Diagnostics/IFSharpDocumentDiagnosticAnalyzer.cs
  15. +13 −0 src/Tools/ExternalAccess/FSharp/Diagnostics/IFSharpProjectDiagnosticAnalyzer.cs
  16. +13 −0 src/Tools/ExternalAccess/FSharp/Diagnostics/IFSharpSimplifyNameDiagnosticAnalyzer.cs
  17. +13 −0 src/Tools/ExternalAccess/FSharp/Diagnostics/IFSharpUnusedDeclarationsDiagnosticAnalyzer.cs
  18. +13 −0 src/Tools/ExternalAccess/FSharp/Diagnostics/IFSharpUnusedOpensDiagnosticAnalyzer.cs
  19. +51 −0 src/Tools/ExternalAccess/FSharp/DocumentHighlighting/IFSharpDocumentHighlightsService.cs
  20. +1 −0 src/Tools/ExternalAccess/FSharp/Editor/FSharpContentTypeNames.cs
  21. +40 −0 src/Tools/ExternalAccess/FSharp/Editor/FSharpNavigationBarItem.cs
  22. +178 −0 src/Tools/ExternalAccess/FSharp/Editor/IFSharpEditorInlineRenameService.cs
  23. +24 −0 src/Tools/ExternalAccess/FSharp/Editor/IFSharpGoToDefinitionService.cs
  24. +13 −0 src/Tools/ExternalAccess/FSharp/Editor/IFSharpNavigationBarItemService.cs
  25. +22 −0 src/Tools/ExternalAccess/FSharp/Editor/Shared/Extensions/FSharpDependencyObjectExtensions.cs
  26. +288 −0 src/Tools/ExternalAccess/FSharp/ExternalAccessFSharpResources.Designer.cs
  27. +195 −0 src/Tools/ExternalAccess/FSharp/ExternalAccessFSharpResources.resx
  28. +11 −0 src/Tools/ExternalAccess/FSharp/FSharpEditorFeaturesResources.cs
  29. +2 −1 src/Tools/ExternalAccess/FSharp/FSharpGlyph.cs
  30. +0 −316 src/Tools/ExternalAccess/FSharp/FSharpGlyphHelpers.cs
  31. +0 −321 src/Tools/ExternalAccess/FSharp/FSharpGlyphHelpersObsolete.cs
  32. +15 −0 src/Tools/ExternalAccess/FSharp/FSharpGlyphTags.cs
  33. 0 src/Tools/ExternalAccess/FSharp/{ → Internal}/Classification/FSharpClassificationService.cs
  34. +32 −0 src/Tools/ExternalAccess/FSharp/Internal/CommentSelection/FSharpCommentSelectionService.cs
  35. +36 −0 src/Tools/ExternalAccess/FSharp/Internal/Completion/FSharpInternalCommonCompletionProvider.cs
  36. 0 src/Tools/ExternalAccess/FSharp/{ → Internal}/Diagnostics/FSharpDiagnosticAnalyzerService.cs
  37. +96 −0 src/Tools/ExternalAccess/FSharp/Internal/Diagnostics/FSharpDocumentDiagnosticAnalyzer.cs
  38. +57 −0 src/Tools/ExternalAccess/FSharp/Internal/Diagnostics/FSharpProjectDiagnosticAnalyzer.cs
  39. +74 −0 src/Tools/ExternalAccess/FSharp/Internal/Diagnostics/FSharpSimplifyNameDiagnosticAnalyzer.cs
  40. +76 −0 src/Tools/ExternalAccess/FSharp/Internal/Diagnostics/FSharpUnusedDeclarationsAnalyzer.cs
  41. +74 −0 src/Tools/ExternalAccess/FSharp/Internal/Diagnostics/FSharpUnusedOpensDiagnosticAnalyzer.cs
  42. +74 −0 src/Tools/ExternalAccess/FSharp/Internal/DocumentHighlighting/FSharpDocumentHighlightsService.cs
  43. 0 src/Tools/ExternalAccess/FSharp/{ → Internal}/Editor/FSharpBraceMatcher.cs
  44. +2 −2 src/Tools/ExternalAccess/FSharp/{ → Internal}/Editor/FSharpContentTypeLanguageService.cs
  45. 0 src/Tools/ExternalAccess/FSharp/{ → Internal}/Editor/FSharpEditorFormattingService.cs
  46. +173 −0 src/Tools/ExternalAccess/FSharp/Internal/Editor/FSharpEditorInlineRenameService.cs
  47. +41 −0 src/Tools/ExternalAccess/FSharp/Internal/Editor/FSharpGoToDefinitionService.cs
  48. +91 −0 src/Tools/ExternalAccess/FSharp/Internal/Editor/FSharpNavigationBarItemService.cs
  49. 0 src/Tools/ExternalAccess/FSharp/{ → Internal}/Editor/FSharpSynchronousIndentationService.cs
  50. 0 src/Tools/ExternalAccess/FSharp/{ → Internal}/Editor/FindUsages/FSharpFindUsagesContext.cs
  51. 0 src/Tools/ExternalAccess/FSharp/{ → Internal}/Editor/FindUsages/FSharpFindUsagesService.cs
  52. 0 ...lAccess/FSharp/{ → Internal}/Editor/Implementation/Debugging/FSharpBreakpointResolutionService.cs
  53. 0 ...rnalAccess/FSharp/{ → Internal}/Editor/Implementation/Debugging/FSharpLanguageDebugInfoService.cs
  54. +21 −0 src/Tools/ExternalAccess/FSharp/Internal/FSharpContentTypeDefinitions.cs
  55. +640 −0 src/Tools/ExternalAccess/FSharp/Internal/FSharpGlyphHelpers.cs
  56. +67 −0 src/Tools/ExternalAccess/FSharp/Internal/NavigateTo/FSharpNavigateToMatchKindHelpers.cs
  57. +43 −0 src/Tools/ExternalAccess/FSharp/Internal/NavigateTo/FSharpNavigateToSearchService.cs
  58. +41 −0 src/Tools/ExternalAccess/FSharp/Internal/NavigateTo/InternalFSharpNavigateToSearchResult.cs
  59. +34 −0 src/Tools/ExternalAccess/FSharp/Internal/Navigation/InternalFSharpNavigableItem.cs
  60. +68 −0 src/Tools/ExternalAccess/FSharp/Internal/SignatureHelp/FSharpSignatureHelpProvider.cs
  61. +38 −0 src/Tools/ExternalAccess/FSharp/Internal/SignatureHelp/FSharpSignatureHelpTriggerReasonHelpers.cs
  62. +34 −0 src/Tools/ExternalAccess/FSharp/Internal/Structure/FSharpBlockStructureService.cs
  63. +33 −0 ...lAccess/FSharp/Internal/VisualStudio/Text/Classification/FSharpSignatureHelpClassifierProvider.cs
  64. +16 −1 src/Tools/ExternalAccess/FSharp/Microsoft.CodeAnalysis.ExternalAccess.FSharp.csproj
  65. +25 −0 src/Tools/ExternalAccess/FSharp/NavigateTo/FSharpNavigateToItemKind.cs
  66. +19 −0 src/Tools/ExternalAccess/FSharp/NavigateTo/FSharpNavigateToMatchKind.cs
  67. +33 −0 src/Tools/ExternalAccess/FSharp/NavigateTo/FSharpNavigateToSearchResult.cs
  68. +24 −0 src/Tools/ExternalAccess/FSharp/NavigateTo/IFSharpNavigateToSearchService.cs
  69. +68 −0 src/Tools/ExternalAccess/FSharp/Navigation/FSharpDocumentNavigationService.cs
  70. +26 −0 src/Tools/ExternalAccess/FSharp/Navigation/FSharpNavigableItem.cs
  71. +12 −0 src/Tools/ExternalAccess/FSharp/Navigation/FSharpNavigationOptions.cs
  72. +41 −0 src/Tools/ExternalAccess/FSharp/Navigation/IFSharpDocumentNavigationService.cs
  73. +80 −0 src/Tools/ExternalAccess/FSharp/SignatureHelp/FSharpSignatureHelpItem.cs
  74. +103 −0 src/Tools/ExternalAccess/FSharp/SignatureHelp/FSharpSignatureHelpItems.cs
  75. +88 −0 src/Tools/ExternalAccess/FSharp/SignatureHelp/FSharpSignatureHelpParameter.cs
  76. +19 −0 src/Tools/ExternalAccess/FSharp/SignatureHelp/FSharpSignatureHelpTriggerInfo.cs
  77. +22 −0 src/Tools/ExternalAccess/FSharp/SignatureHelp/FSharpSignatureHelpTriggerReason.cs
  78. +27 −0 src/Tools/ExternalAccess/FSharp/SignatureHelp/IFSharpSignatureHelpProvider.cs
  79. +68 −0 src/Tools/ExternalAccess/FSharp/Structure/FSharpBlockSpan.cs
  80. +16 −0 src/Tools/ExternalAccess/FSharp/Structure/FSharpBlockStructure.cs
  81. +29 −0 src/Tools/ExternalAccess/FSharp/Structure/FSharpBlockTypes.cs
  82. +12 −0 src/Tools/ExternalAccess/FSharp/Structure/IFSharpBlockStructureService.cs
  83. +132 −0 src/Tools/ExternalAccess/FSharp/xlf/ExternalAccessFSharpResources.cs.xlf
  84. +132 −0 src/Tools/ExternalAccess/FSharp/xlf/ExternalAccessFSharpResources.de.xlf
  85. +132 −0 src/Tools/ExternalAccess/FSharp/xlf/ExternalAccessFSharpResources.es.xlf
  86. +132 −0 src/Tools/ExternalAccess/FSharp/xlf/ExternalAccessFSharpResources.fr.xlf
  87. +132 −0 src/Tools/ExternalAccess/FSharp/xlf/ExternalAccessFSharpResources.it.xlf
  88. +132 −0 src/Tools/ExternalAccess/FSharp/xlf/ExternalAccessFSharpResources.ja.xlf
  89. +132 −0 src/Tools/ExternalAccess/FSharp/xlf/ExternalAccessFSharpResources.ko.xlf
  90. +132 −0 src/Tools/ExternalAccess/FSharp/xlf/ExternalAccessFSharpResources.pl.xlf
  91. +132 −0 src/Tools/ExternalAccess/FSharp/xlf/ExternalAccessFSharpResources.pt-BR.xlf
  92. +132 −0 src/Tools/ExternalAccess/FSharp/xlf/ExternalAccessFSharpResources.ru.xlf
  93. +132 −0 src/Tools/ExternalAccess/FSharp/xlf/ExternalAccessFSharpResources.tr.xlf
  94. +132 −0 src/Tools/ExternalAccess/FSharp/xlf/ExternalAccessFSharpResources.zh-Hans.xlf
  95. +132 −0 src/Tools/ExternalAccess/FSharp/xlf/ExternalAccessFSharpResources.zh-Hant.xlf
  96. +677 −0 src/Tools/ExternalAccess/FSharpTest/FSharpGlyphTests.cs
  97. +63 −0 src/Tools/ExternalAccess/FSharpTest/FSharpHighlightSpanKindTests.cs
  98. +68 −0 src/Tools/ExternalAccess/FSharpTest/FSharpInlineRenameReplacementKindTests.cs
  99. +87 −0 src/Tools/ExternalAccess/FSharpTest/FSharpNavigateToMatchKindTests.cs
  100. +58 −0 src/Tools/ExternalAccess/FSharpTest/FSharpSignatureHelpTriggerReasonTests.cs
  101. +55 −0 src/Tools/ExternalAccess/FSharpTest/Microsoft.CodeAnalysis.ExternalAccess.FSharp.UnitTests.csproj
  102. +1 −0 src/VisualStudio/Core/Def/Microsoft.VisualStudio.LanguageServices.csproj
  103. +1 −0 src/VisualStudio/Core/Impl/Microsoft.VisualStudio.LanguageServices.Implementation.csproj
  104. +1 −0 src/VisualStudio/Setup/source.extension.vsixmanifest
  105. +1 −1 src/Workspaces/Core/Portable/Microsoft.CodeAnalysis.Workspaces.csproj
@@ -404,6 +404,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.Exte
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Roslyn.VisualStudio.Setup.ServiceHub", "src\Setup\DevDivVsix\ServiceHubConfig\Roslyn.VisualStudio.Setup.ServiceHub.csproj", "{3D33BBFD-EC63-4E8C-A714-0A48A3809A87}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.ExternalAccess.FSharp.UnitTests", "src\Tools\ExternalAccess\FSharpTest\Microsoft.CodeAnalysis.ExternalAccess.FSharp.UnitTests.csproj", "{BFFB5CAE-33B5-447E-9218-BDEBFDA96CB5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.ExternalAccess.Apex", "src\Tools\ExternalAccess\Apex\Microsoft.CodeAnalysis.ExternalAccess.Apex.csproj", "{FC32EF16-31B1-47B3-B625-A80933CB3F29}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.ExternalAccess.CodeLens", "src\Tools\ExternalAccess\CodeLens\Microsoft.CodeAnalysis.ExternalAccess.CodeLens.csproj", "{D5B1328C-A9EF-4E55-93D7-B8455855709A}"
@@ -1081,6 +1083,10 @@ Global
{3D33BBFD-EC63-4E8C-A714-0A48A3809A87}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3D33BBFD-EC63-4E8C-A714-0A48A3809A87}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3D33BBFD-EC63-4E8C-A714-0A48A3809A87}.Release|Any CPU.Build.0 = Release|Any CPU
{BFFB5CAE-33B5-447E-9218-BDEBFDA96CB5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BFFB5CAE-33B5-447E-9218-BDEBFDA96CB5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BFFB5CAE-33B5-447E-9218-BDEBFDA96CB5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BFFB5CAE-33B5-447E-9218-BDEBFDA96CB5}.Release|Any CPU.Build.0 = Release|Any CPU
{FC32EF16-31B1-47B3-B625-A80933CB3F29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FC32EF16-31B1-47B3-B625-A80933CB3F29}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FC32EF16-31B1-47B3-B625-A80933CB3F29}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -1294,6 +1300,7 @@ Global
{FA51A3CB-5174-4D99-B76E-DC31C5361DF3} = {8977A560-45C2-4EC2-A849-97335B382C74}
{DE53934B-7FC1-48A0-85AB-C519FBBD02CF} = {8977A560-45C2-4EC2-A849-97335B382C74}
{3D33BBFD-EC63-4E8C-A714-0A48A3809A87} = {BE25E872-1667-4649-9D19-96B83E75A44E}
{BFFB5CAE-33B5-447E-9218-BDEBFDA96CB5} = {8977A560-45C2-4EC2-A849-97335B382C74}
{FC32EF16-31B1-47B3-B625-A80933CB3F29} = {8977A560-45C2-4EC2-A849-97335B382C74}
{D5B1328C-A9EF-4E55-93D7-B8455855709A} = {8977A560-45C2-4EC2-A849-97335B382C74}
{BDB3414C-35F8-4E2D-8603-DE9CF259540F} = {8977A560-45C2-4EC2-A849-97335B382C74}
@@ -54,8 +54,8 @@
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.VisualBasic" />
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.CSharp.EditorFeatures.Wpf" />
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.Remote.ServiceHub" />
<InternalsVisibleTo Include="FSharp.Editor" Key="$(FSharpKey)" WorkItem="https://github.com/dotnet/roslyn/issues/35076" />
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.ExternalAccess.FSharp" />
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.ExternalAccess.FSharp.UnitTests" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.IntegrationTest.Utilities" />
<InternalsVisibleTo Include="Roslyn.Services.Test.Utilities" />
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.EditorFeatures.UnitTests" />
@@ -52,7 +52,6 @@
<InternalsVisibleTo Include="Roslyn.VisualStudio.DiagnosticsWindow" />
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.Remote.ServiceHub" />
<InternalsVisibleTo Include="Roslyn.Hosting.Diagnostics" />
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.ExternalAccess.FSharp" />
<!-- BEGIN MONODEVELOP
These MonoDevelop dependencies don't ship with Visual Studio, so can't break our
binary insertions and are exempted from the ExternalAccess adapter assembly policies.
@@ -83,6 +82,7 @@
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.IntegrationTests" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Test.Utilities2" />
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.ExternalAccess.FSharp" />
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.ExternalAccess.FSharp.UnitTests" />
<!-- Eventually a bunch of these unit tests should move into Roslyn.Services.Implementation.UnitTests
and this should be removed. -->
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.TypeScript.EditorFeatures" Key="$(TypeScriptKey)" WorkItem="https://github.com/dotnet/roslyn/issues/35077" />
@@ -99,7 +99,6 @@
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Remote.CSharp.15.8" Key="$(RemoteLanguageServiceKey)" WorkItem="https://github.com/dotnet/roslyn/issues/35074" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Remote.CSharp.16.0" Key="$(RemoteLanguageServiceKey)" WorkItem="https://github.com/dotnet/roslyn/issues/35074" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Remote.CSharp.16.1" Key="$(RemoteLanguageServiceKey)" WorkItem="https://github.com/dotnet/roslyn/issues/35074" />
<InternalsVisibleTo Include="FSharp.Editor" Key="$(FSharpKey)" WorkItem="https://github.com/dotnet/roslyn/issues/35076" />
<InternalsVisibleTo Include="DynamicProxyGenAssembly2" Key="$(MoqPublicKey)" LoadsWithinVisualStudio="false" />
</ItemGroup>
<ItemGroup>
@@ -36,6 +36,7 @@
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.ExternalDependencyServices" WorkItem="https://github.com/dotnet/roslyn/issues/35085" />
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.CSharp.EditorFeatures.Wpf" />
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.ExternalAccess.FSharp" />
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.ExternalAccess.FSharp.UnitTests" />
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.TypeScript.EditorFeatures" Key="$(TypeScriptKey)" WorkItem="https://github.com/dotnet/roslyn/issues/35077" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Implementation" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.TypeScript" Key="$(TypeScriptKey)" WorkItem="https://github.com/dotnet/roslyn/issues/35077" />
@@ -50,8 +51,6 @@
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Remote.CSharp.16.0" Key="$(RemoteLanguageServiceKey)" WorkItem="https://github.com/dotnet/roslyn/issues/35074" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Remote.CSharp.16.1" Key="$(RemoteLanguageServiceKey)" WorkItem="https://github.com/dotnet/roslyn/issues/35074" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Xaml" />
<InternalsVisibleTo Include="FSharp.Editor" Key="$(FSharpKey)" WorkItem="https://github.com/dotnet/roslyn/issues/35076" />
<InternalsVisibleTo Include="FSharp.LanguageService" Key="$(FSharpKey)" WorkItem="https://github.com/dotnet/roslyn/issues/35076" />
<!-- BEGIN MONODEVELOP
These MonoDevelop dependencies don't ship with Visual Studio, so can't break our
binary insertions and are exempted from the ExternalAccess adapter assembly policies.
@@ -75,6 +75,7 @@
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Test.Utilities2" />
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.ExternalAccess.FSharp" />
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.ExternalAccess.FSharp.UnitTests" />
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.TypeScript.EditorFeatures" Key="$(TypeScriptKey)" WorkItem="https://github.com/dotnet/roslyn/issues/35077" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.TypeScript" Key="$(TypeScriptKey)" WorkItem="https://github.com/dotnet/roslyn/issues/35077" />
<InternalsVisibleTo Include="Roslyn.Services.Editor.TypeScript.UnitTests" Key="$(TypeScriptKey)" WorkItem="https://github.com/dotnet/roslyn/issues/35077" />
@@ -88,7 +89,6 @@
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Remote.CSharp.15.8" Key="$(RemoteLanguageServiceKey)" WorkItem="https://github.com/dotnet/roslyn/issues/35074" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Remote.CSharp.16.0" Key="$(RemoteLanguageServiceKey)" WorkItem="https://github.com/dotnet/roslyn/issues/35074" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Remote.CSharp.16.1" Key="$(RemoteLanguageServiceKey)" WorkItem="https://github.com/dotnet/roslyn/issues/35074" />
<InternalsVisibleTo Include="FSharp.Editor" Key="$(FSharpKey)" WorkItem="https://github.com/dotnet/roslyn/issues/35076" />
<InternalsVisibleTo Include="DynamicProxyGenAssembly2" Key="$(MoqPublicKey)" LoadsWithinVisualStudio="false" />
<InternalsVisibleTo Include="Microsoft.Test.Apex.VisualStudio" Key="$(VisualStudioKey)" WorkItem="https://github.com/dotnet/roslyn/issues/35081" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.Alm.Shared.CodeAnalysisClient" Key="$(VisualStudioKey)" WorkItem="https://github.com/dotnet/roslyn/issues/35086" />
@@ -64,6 +64,7 @@
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities" />
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.Workspaces.UnitTests" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests" />
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.ExternalAccess.FSharp.UnitTests" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\..\Compilers\Shared\CoreClrAnalyzerAssemblyLoader.cs" />
@@ -0,0 +1,29 @@
// 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.Collections.Immutable;
using Microsoft.CodeAnalysis.Completion;
using Microsoft.CodeAnalysis.ExternalAccess.FSharp.Internal;

namespace Microsoft.CodeAnalysis.ExternalAccess.FSharp.Completion
{
internal static class FSharpCommonCompletionItem
{
public static CompletionItem Create(
string displayText,
string displayTextSuffix,
CompletionItemRules rules,
FSharpGlyph? glyph = null,
ImmutableArray<SymbolDisplayPart> description = default,
string sortText = null,
string filterText = null,
bool showsWarningIcon = false,
ImmutableDictionary<string, string> properties = null,
ImmutableArray<string> tags = default,
string inlineDescription = null)
{
var roslynGlyph = glyph.HasValue ? FSharpGlyphHelpers.ConvertTo(glyph.Value) : (Glyph?)null;
return CommonCompletionItem.Create(
displayText, displayTextSuffix, rules, roslynGlyph, description, sortText, filterText, showsWarningIcon, properties, tags, inlineDescription);
}
}
}
@@ -0,0 +1,15 @@
// 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 Microsoft.CodeAnalysis.Completion;
using Microsoft.CodeAnalysis.ExternalAccess.FSharp.Internal.Completion;

namespace Microsoft.CodeAnalysis.ExternalAccess.FSharp.Completion
{
internal static class FSharpCommonCompletionProvider
{
public static CompletionProvider Create(IFSharpCommonCompletionProvider fsharpCommonCompletionProvider)
{
return new FSharpInternalCommonCompletionProvider(fsharpCommonCompletionProvider);
}
}
}
@@ -0,0 +1,16 @@
// 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 Microsoft.CodeAnalysis.Completion;
using Microsoft.CodeAnalysis.Text;

namespace Microsoft.CodeAnalysis.ExternalAccess.FSharp.Completion
{
internal static class FSharpCommonCompletionUtilities
{
public static bool IsStartingNewWord(SourceText text, int characterPosition, Func<char, bool> isWordStartCharacter, Func<char, bool> isWordCharacter)
{
return CommonCompletionUtilities.IsStartingNewWord(text, characterPosition, isWordStartCharacter, isWordCharacter);
}
}
}
@@ -0,0 +1,38 @@
// 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.Collections.Immutable;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Completion;
using Microsoft.CodeAnalysis.ExternalAccess.FSharp.Internal;

namespace Microsoft.CodeAnalysis.ExternalAccess.FSharp.Completion
{
internal class FSharpFileSystemCompletionHelper
{
private readonly FileSystemCompletionHelper _fileSystemCompletionHelper;

public FSharpFileSystemCompletionHelper(
FSharpGlyph folderGlyph,
FSharpGlyph fileGlyph,
ImmutableArray<string> searchPaths,
string baseDirectoryOpt,
ImmutableArray<string> allowableExtensions,
CompletionItemRules itemRules)
{
_fileSystemCompletionHelper =
new FileSystemCompletionHelper(
FSharpGlyphHelpers.ConvertTo(folderGlyph),
FSharpGlyphHelpers.ConvertTo(fileGlyph),
searchPaths,
baseDirectoryOpt,
allowableExtensions,
itemRules);
}

public Task<ImmutableArray<CompletionItem>> GetItemsAsync(string directoryPath, CancellationToken cancellationToken)
{
return _fileSystemCompletionHelper.GetItemsAsync(directoryPath, cancellationToken);
}
}
}
@@ -0,0 +1,24 @@
// 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.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Completion;
using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.Text;

namespace Microsoft.CodeAnalysis.ExternalAccess.FSharp.Completion
{
internal interface IFSharpCommonCompletionProvider
{
Task ProvideCompletionsAsync(CompletionContext context);

bool IsInsertionTrigger(SourceText text, int insertedCharacterPosition, OptionSet options);

Task<TextChange?> GetTextChangeAsync(
Func<CompletionItem, char?, CancellationToken, Task<TextChange?>> baseGetTextChangeAsync,
CompletionItem selectedItem,
char? ch,
CancellationToken cancellationToken);
}
}
@@ -1,7 +1,5 @@
// 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 Microsoft;

namespace Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics
{
internal static class FSharpDiagnosticCustomTags
@@ -0,0 +1,12 @@
// 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 Microsoft.CodeAnalysis.Diagnostics;

namespace Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics
{
internal static class FSharpIDEDiagnosticIds
{
public static string SimplifyNamesDiagnosticId => IDEDiagnosticIds.SimplifyNamesDiagnosticId;
public static string RemoveUnnecessaryImportsDiagnosticId => IDEDiagnosticIds.RemoveUnnecessaryImportsDiagnosticId;
}
}
@@ -0,0 +1,15 @@
// 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.Collections.Immutable;
using System.Threading;
using System.Threading.Tasks;

namespace Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics
{
internal interface IFSharpDocumentDiagnosticAnalyzer
{
Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken);

Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken);
}
}
@@ -0,0 +1,13 @@
// 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.Collections.Immutable;
using System.Threading;
using System.Threading.Tasks;

namespace Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics
{
internal interface IFSharpProjectDiagnosticAnalyzer
{
Task<ImmutableArray<Diagnostic>> AnalyzeProjectAsync(Project project, CancellationToken cancellationToken);
}
}
@@ -0,0 +1,13 @@
// 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.Collections.Immutable;
using System.Threading;
using System.Threading.Tasks;

namespace Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics
{
internal interface IFSharpSimplifyNameDiagnosticAnalyzer
{
Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(DiagnosticDescriptor descriptor, Document document, CancellationToken cancellationToken);
}
}
@@ -0,0 +1,13 @@
// 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.Collections.Immutable;
using System.Threading;
using System.Threading.Tasks;

namespace Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics
{
internal interface IFSharpUnusedDeclarationsDiagnosticAnalyzer
{
Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(DiagnosticDescriptor descriptor, Document document, CancellationToken cancellationToken);
}
}
@@ -0,0 +1,13 @@
// 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.Collections.Immutable;
using System.Threading;
using System.Threading.Tasks;

namespace Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics
{
internal interface IFSharpUnusedOpensDiagnosticAnalyzer
{
Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(DiagnosticDescriptor descriptor, Document document, CancellationToken cancellationToken);
}
}

0 comments on commit 0d44ad1

Please sign in to comment.
You can’t perform that action at this time.