-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
Showing
105 changed files
with
6,354 additions
and
650 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/Tools/ExternalAccess/FSharp/Completion/FSharpCommonCompletionItem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/Tools/ExternalAccess/FSharp/Completion/FSharpCommonCompletionProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/Tools/ExternalAccess/FSharp/Completion/FSharpCommonCompletionUtilities.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
src/Tools/ExternalAccess/FSharp/Completion/FSharpFileSystemCompletionHelper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/Tools/ExternalAccess/FSharp/Completion/IFSharpCommonCompletionProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |
2 changes: 0 additions & 2 deletions
2
src/Tools/ExternalAccess/FSharp/Diagnostics/FSharpDiagnosticCustomTags.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/Tools/ExternalAccess/FSharp/Diagnostics/FSharpIDEDiagnosticIds.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/Tools/ExternalAccess/FSharp/Diagnostics/IFSharpDocumentDiagnosticAnalyzer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/Tools/ExternalAccess/FSharp/Diagnostics/IFSharpProjectDiagnosticAnalyzer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/Tools/ExternalAccess/FSharp/Diagnostics/IFSharpSimplifyNameDiagnosticAnalyzer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/Tools/ExternalAccess/FSharp/Diagnostics/IFSharpUnusedDeclarationsDiagnosticAnalyzer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/Tools/ExternalAccess/FSharp/Diagnostics/IFSharpUnusedOpensDiagnosticAnalyzer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |
Oops, something went wrong.