From 59e85d0d659e05a2d6c74bed1ff7938f48ac4b05 Mon Sep 17 00:00:00 2001 From: vaskir Date: Thu, 24 Nov 2016 21:01:58 +0300 Subject: [PATCH] CommentUncommentService --- .../FSharp.Editor/CommentUncommentService.fs | 24 +++++++++++++++++++ .../src/FSharp.Editor/FSharp.Editor.fsproj | 3 +++ 2 files changed, 27 insertions(+) create mode 100644 vsintegration/src/FSharp.Editor/CommentUncommentService.fs diff --git a/vsintegration/src/FSharp.Editor/CommentUncommentService.fs b/vsintegration/src/FSharp.Editor/CommentUncommentService.fs new file mode 100644 index 00000000000..af292f54f8e --- /dev/null +++ b/vsintegration/src/FSharp.Editor/CommentUncommentService.fs @@ -0,0 +1,24 @@ +namespace Microsoft.VisualStudio.FSharp.Editor + +open System.ComponentModel.Composition +open Microsoft.CodeAnalysis.Editor +open Microsoft.CodeAnalysis.Shared.Extensions +open Microsoft.CodeAnalysis.Text +open Microsoft.CodeAnalysis.Text.Shared.Extensions +open Microsoft.VisualStudio.Text +open Microsoft.VisualStudio.Text.Operations +open Microsoft.VisualStudio.Utilities +open Microsoft.CodeAnalysis.Editor.Implementation.CommentSelection +open Microsoft.CodeAnalysis.Host.Mef +open Microsoft.CodeAnalysis +open System.Composition + +[] +[, FSharpCommonConstants.FSharpLanguageName)>] +type CommentUncommentService() = + interface ICommentUncommentService with + member this.SingleLineCommentString = "//" + member this.SupportsBlockComment = true + member this.BlockCommentStartString = "(*" + member this.BlockCommentEndString = "*)" + member this.Format(document, _changes, _cancellationToken) = document \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index 39e8020135c..f874ffcc9f2 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -65,6 +65,9 @@ GoToDefinition\GoToDefinitionService.fs + + BlockComment\CommentUncommentService.fs +