From e4224572a8b8c6c2b2a6f85fdb694e7d99e111cc Mon Sep 17 00:00:00 2001 From: David Wengier Date: Wed, 29 May 2024 09:40:30 +1000 Subject: [PATCH 1/2] Use a more sensible MEF export for brace completion --- .../CSharpBraceCompletionServiceFactory.cs | 3 +- .../AbstractBraceCompletionServiceFactory.cs | 9 ++++-- ...isualBasicBraceCompletionServiceFactory.vb | 4 +-- .../BracketBraceCompletionService.cs | 12 +++---- .../CharLiteralBraceCompletionService.cs | 12 +++---- .../CurlyBraceCompletionService.cs | 12 +++---- ...nterpolatedStringBraceCompletionService.cs | 2 +- .../InterpolationBraceCompletionService.cs | 12 +++---- ...essAndGreaterThanBraceCompletionService.cs | 12 +++---- .../ParenthesisBraceCompletionService.cs | 12 +++---- .../StringLiteralBraceCompletionService.cs | 2 +- .../ExportBraceCompletionServiceAttribute.cs | 15 +++++++++ .../OnAutoInsert/OnAutoInsertHandler.cs | 31 ++++++------------- .../BracketBraceCompletionService.vb | 2 +- .../CurlyBraceCompletionService.vb | 2 +- ...nterpolatedStringBraceCompletionService.vb | 2 +- .../InterpolationBraceCompletionService.vb | 2 +- .../LessAndGreaterThanCompletionService.vb | 2 +- .../ParenthesisBraceCompletionService.vb | 2 +- .../StringLiteralBraceCompletionService.vb | 2 +- 20 files changed, 68 insertions(+), 84 deletions(-) create mode 100644 src/Features/Core/Portable/BraceCompletion/ExportBraceCompletionServiceAttribute.cs diff --git a/src/EditorFeatures/CSharp/AutomaticCompletion/CSharpBraceCompletionServiceFactory.cs b/src/EditorFeatures/CSharp/AutomaticCompletion/CSharpBraceCompletionServiceFactory.cs index 00c1baaba6125..b7bf2b80428c7 100644 --- a/src/EditorFeatures/CSharp/AutomaticCompletion/CSharpBraceCompletionServiceFactory.cs +++ b/src/EditorFeatures/CSharp/AutomaticCompletion/CSharpBraceCompletionServiceFactory.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Composition; +using System.Linq; using Microsoft.CodeAnalysis.AutomaticCompletion; using Microsoft.CodeAnalysis.BraceCompletion; using Microsoft.CodeAnalysis.Host.Mef; @@ -15,6 +16,6 @@ namespace Microsoft.CodeAnalysis.Editor.CSharp.AutomaticCompletion; [method: ImportingConstructor] [method: Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] internal class CSharpBraceCompletionServiceFactory( - [ImportMany(LanguageNames.CSharp)] IEnumerable braceCompletionServices) : AbstractBraceCompletionServiceFactory(braceCompletionServices) + [ImportMany] IEnumerable> braceCompletionServices) : AbstractBraceCompletionServiceFactory(braceCompletionServices, LanguageNames.CSharp) { } diff --git a/src/EditorFeatures/Core/AutomaticCompletion/AbstractBraceCompletionServiceFactory.cs b/src/EditorFeatures/Core/AutomaticCompletion/AbstractBraceCompletionServiceFactory.cs index 17889586908fd..79bd574380433 100644 --- a/src/EditorFeatures/Core/AutomaticCompletion/AbstractBraceCompletionServiceFactory.cs +++ b/src/EditorFeatures/Core/AutomaticCompletion/AbstractBraceCompletionServiceFactory.cs @@ -2,10 +2,14 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System; using System.Collections.Generic; using System.Collections.Immutable; +using System.Linq; using System.Threading; using Microsoft.CodeAnalysis.BraceCompletion; +using Microsoft.CodeAnalysis.Host.Mef; +using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.AutomaticCompletion; @@ -14,9 +18,10 @@ internal abstract class AbstractBraceCompletionServiceFactory : IBraceCompletion private readonly ImmutableArray _braceCompletionServices; protected AbstractBraceCompletionServiceFactory( - IEnumerable braceCompletionServices) + IEnumerable> braceCompletionServices, + string languageName) { - _braceCompletionServices = braceCompletionServices.ToImmutableArray(); + _braceCompletionServices = braceCompletionServices.Where(s => s.Metadata.Language == languageName).SelectAsArray(s => s.Value); } public IBraceCompletionService? TryGetService(ParsedDocument document, int openingPosition, char openingBrace, CancellationToken cancellationToken) diff --git a/src/EditorFeatures/VisualBasic/AutomaticCompletion/VisualBasicBraceCompletionServiceFactory.vb b/src/EditorFeatures/VisualBasic/AutomaticCompletion/VisualBasicBraceCompletionServiceFactory.vb index 110e4213b2e99..d58eb4458a120 100644 --- a/src/EditorFeatures/VisualBasic/AutomaticCompletion/VisualBasicBraceCompletionServiceFactory.vb +++ b/src/EditorFeatures/VisualBasic/AutomaticCompletion/VisualBasicBraceCompletionServiceFactory.vb @@ -15,8 +15,8 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.AutomaticCompletion Public Sub New( - braceCompletionServices As IEnumerable(Of IBraceCompletionService)) - MyBase.New(braceCompletionServices) + braceCompletionServices As IEnumerable(Of Lazy(Of IBraceCompletionService, LanguageMetadata))) + MyBase.New(braceCompletionServices, LanguageNames.VisualBasic) End Sub End Class End Namespace diff --git a/src/Features/CSharp/Portable/BraceCompletion/BracketBraceCompletionService.cs b/src/Features/CSharp/Portable/BraceCompletion/BracketBraceCompletionService.cs index 3a5ccadca9945..e06a726ea09a8 100644 --- a/src/Features/CSharp/Portable/BraceCompletion/BracketBraceCompletionService.cs +++ b/src/Features/CSharp/Portable/BraceCompletion/BracketBraceCompletionService.cs @@ -16,15 +16,11 @@ namespace Microsoft.CodeAnalysis.CSharp.BraceCompletion; -[Export(LanguageNames.CSharp, typeof(IBraceCompletionService)), Shared] -internal class BracketBraceCompletionService : AbstractCurlyBraceOrBracketCompletionService +[ExportBraceCompletionService(LanguageNames.CSharp), Shared] +[method: ImportingConstructor] +[method: Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] +internal class BracketBraceCompletionService() : AbstractCurlyBraceOrBracketCompletionService { - [ImportingConstructor] - [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] - public BracketBraceCompletionService() - { - } - protected override char OpeningBrace => Bracket.OpenCharacter; protected override char ClosingBrace => Bracket.CloseCharacter; diff --git a/src/Features/CSharp/Portable/BraceCompletion/CharLiteralBraceCompletionService.cs b/src/Features/CSharp/Portable/BraceCompletion/CharLiteralBraceCompletionService.cs index 24eaf46168ee6..38d32923c2c39 100644 --- a/src/Features/CSharp/Portable/BraceCompletion/CharLiteralBraceCompletionService.cs +++ b/src/Features/CSharp/Portable/BraceCompletion/CharLiteralBraceCompletionService.cs @@ -10,15 +10,11 @@ namespace Microsoft.CodeAnalysis.CSharp.BraceCompletion; -[Export(LanguageNames.CSharp, typeof(IBraceCompletionService)), Shared] -internal class CharLiteralBraceCompletionService : AbstractCSharpBraceCompletionService +[ExportBraceCompletionService(LanguageNames.CSharp), Shared] +[method: ImportingConstructor] +[method: Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] +internal class CharLiteralBraceCompletionService() : AbstractCSharpBraceCompletionService { - [ImportingConstructor] - [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] - public CharLiteralBraceCompletionService() - { - } - protected override char OpeningBrace => SingleQuote.OpenCharacter; protected override char ClosingBrace => SingleQuote.CloseCharacter; diff --git a/src/Features/CSharp/Portable/BraceCompletion/CurlyBraceCompletionService.cs b/src/Features/CSharp/Portable/BraceCompletion/CurlyBraceCompletionService.cs index ecd63e1301991..0defc83620c65 100644 --- a/src/Features/CSharp/Portable/BraceCompletion/CurlyBraceCompletionService.cs +++ b/src/Features/CSharp/Portable/BraceCompletion/CurlyBraceCompletionService.cs @@ -21,15 +21,11 @@ namespace Microsoft.CodeAnalysis.CSharp.BraceCompletion; -[Export(LanguageNames.CSharp, typeof(IBraceCompletionService)), Shared] -internal class CurlyBraceCompletionService : AbstractCurlyBraceOrBracketCompletionService +[ExportBraceCompletionService(LanguageNames.CSharp), Shared] +[method: ImportingConstructor] +[method: Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] +internal class CurlyBraceCompletionService() : AbstractCurlyBraceOrBracketCompletionService { - [ImportingConstructor] - [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] - public CurlyBraceCompletionService() - { - } - protected override char OpeningBrace => CurlyBrace.OpenCharacter; protected override char ClosingBrace => CurlyBrace.CloseCharacter; diff --git a/src/Features/CSharp/Portable/BraceCompletion/InterpolatedStringBraceCompletionService.cs b/src/Features/CSharp/Portable/BraceCompletion/InterpolatedStringBraceCompletionService.cs index 0ec8311ba7cef..b77c49dc13339 100644 --- a/src/Features/CSharp/Portable/BraceCompletion/InterpolatedStringBraceCompletionService.cs +++ b/src/Features/CSharp/Portable/BraceCompletion/InterpolatedStringBraceCompletionService.cs @@ -15,7 +15,7 @@ namespace Microsoft.CodeAnalysis.CSharp.BraceCompletion; /// Brace completion service for double quotes marking an interpolated string. Note that the is used for other double quote completions. /// -[Export(LanguageNames.CSharp, typeof(IBraceCompletionService)), Shared] +[ExportBraceCompletionService(LanguageNames.CSharp), Shared] [method: ImportingConstructor] [method: Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] internal sealed class InterpolatedStringBraceCompletionService() : AbstractCSharpBraceCompletionService diff --git a/src/Features/CSharp/Portable/BraceCompletion/InterpolationBraceCompletionService.cs b/src/Features/CSharp/Portable/BraceCompletion/InterpolationBraceCompletionService.cs index c3d55f62d8259..ea65ee899b152 100644 --- a/src/Features/CSharp/Portable/BraceCompletion/InterpolationBraceCompletionService.cs +++ b/src/Features/CSharp/Portable/BraceCompletion/InterpolationBraceCompletionService.cs @@ -17,15 +17,11 @@ namespace Microsoft.CodeAnalysis.CSharp.BraceCompletion; /// Brace completion service used for completing curly braces inside interpolated strings. /// In other curly brace completion scenarios the should be used. /// -[Export(LanguageNames.CSharp, typeof(IBraceCompletionService)), Shared] -internal class InterpolationBraceCompletionService : AbstractCSharpBraceCompletionService +[ExportBraceCompletionService(LanguageNames.CSharp), Shared] +[method: ImportingConstructor] +[method: Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] +internal class InterpolationBraceCompletionService() : AbstractCSharpBraceCompletionService { - [ImportingConstructor] - [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] - public InterpolationBraceCompletionService() - { - } - protected override char OpeningBrace => CurlyBrace.OpenCharacter; protected override char ClosingBrace => CurlyBrace.CloseCharacter; diff --git a/src/Features/CSharp/Portable/BraceCompletion/LessAndGreaterThanBraceCompletionService.cs b/src/Features/CSharp/Portable/BraceCompletion/LessAndGreaterThanBraceCompletionService.cs index 1220ff54ccda1..7c09013404f1e 100644 --- a/src/Features/CSharp/Portable/BraceCompletion/LessAndGreaterThanBraceCompletionService.cs +++ b/src/Features/CSharp/Portable/BraceCompletion/LessAndGreaterThanBraceCompletionService.cs @@ -15,15 +15,11 @@ namespace Microsoft.CodeAnalysis.CSharp.BraceCompletion; -[Export(LanguageNames.CSharp, typeof(IBraceCompletionService)), Shared] -internal class LessAndGreaterThanBraceCompletionService : AbstractCSharpBraceCompletionService +[ExportBraceCompletionService(LanguageNames.CSharp), Shared] +[method: ImportingConstructor] +[method: Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] +internal class LessAndGreaterThanBraceCompletionService() : AbstractCSharpBraceCompletionService { - [ImportingConstructor] - [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] - public LessAndGreaterThanBraceCompletionService() - { - } - protected override bool NeedsSemantics => true; protected override char OpeningBrace => LessAndGreaterThan.OpenCharacter; diff --git a/src/Features/CSharp/Portable/BraceCompletion/ParenthesisBraceCompletionService.cs b/src/Features/CSharp/Portable/BraceCompletion/ParenthesisBraceCompletionService.cs index dda93ad44659b..3c4b8e48b4f30 100644 --- a/src/Features/CSharp/Portable/BraceCompletion/ParenthesisBraceCompletionService.cs +++ b/src/Features/CSharp/Portable/BraceCompletion/ParenthesisBraceCompletionService.cs @@ -12,15 +12,11 @@ namespace Microsoft.CodeAnalysis.CSharp.BraceCompletion; -[Export(LanguageNames.CSharp, typeof(IBraceCompletionService)), Shared] -internal class ParenthesisBraceCompletionService : AbstractCSharpBraceCompletionService +[ExportBraceCompletionService(LanguageNames.CSharp), Shared] +[method: ImportingConstructor] +[method: Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] +internal class ParenthesisBraceCompletionService() : AbstractCSharpBraceCompletionService { - [ImportingConstructor] - [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] - public ParenthesisBraceCompletionService() - { - } - protected override char OpeningBrace => Parenthesis.OpenCharacter; protected override char ClosingBrace => Parenthesis.CloseCharacter; diff --git a/src/Features/CSharp/Portable/BraceCompletion/StringLiteralBraceCompletionService.cs b/src/Features/CSharp/Portable/BraceCompletion/StringLiteralBraceCompletionService.cs index b98330cae0794..53c2702692fea 100644 --- a/src/Features/CSharp/Portable/BraceCompletion/StringLiteralBraceCompletionService.cs +++ b/src/Features/CSharp/Portable/BraceCompletion/StringLiteralBraceCompletionService.cs @@ -15,7 +15,7 @@ namespace Microsoft.CodeAnalysis.CSharp.BraceCompletion; -[Export(LanguageNames.CSharp, typeof(IBraceCompletionService)), Shared] +[ExportBraceCompletionService(LanguageNames.CSharp), Shared] [method: ImportingConstructor] [method: Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] internal sealed class StringLiteralBraceCompletionService() : AbstractCSharpBraceCompletionService diff --git a/src/Features/Core/Portable/BraceCompletion/ExportBraceCompletionServiceAttribute.cs b/src/Features/Core/Portable/BraceCompletion/ExportBraceCompletionServiceAttribute.cs new file mode 100644 index 0000000000000..cc81d078452f9 --- /dev/null +++ b/src/Features/Core/Portable/BraceCompletion/ExportBraceCompletionServiceAttribute.cs @@ -0,0 +1,15 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Composition; + +namespace Microsoft.CodeAnalysis.BraceCompletion; + +[MetadataAttribute] +[AttributeUsage(AttributeTargets.Class)] +internal class ExportBraceCompletionServiceAttribute(string language) : ExportAttribute(typeof(IBraceCompletionService)) +{ + public string Language { get; } = language ?? throw new ArgumentNullException(nameof(language)); +} diff --git a/src/Features/LanguageServer/Protocol/Handler/OnAutoInsert/OnAutoInsertHandler.cs b/src/Features/LanguageServer/Protocol/Handler/OnAutoInsert/OnAutoInsertHandler.cs index 7ea64d0c5d474..6c4db3f109249 100644 --- a/src/Features/LanguageServer/Protocol/Handler/OnAutoInsert/OnAutoInsertHandler.cs +++ b/src/Features/LanguageServer/Protocol/Handler/OnAutoInsert/OnAutoInsertHandler.cs @@ -7,6 +7,7 @@ using System.Collections.Immutable; using System.Composition; using System.Diagnostics; +using System.Linq; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.BraceCompletion; @@ -26,27 +27,18 @@ namespace Microsoft.CodeAnalysis.LanguageServer.Handler { [ExportCSharpVisualBasicStatelessLspService(typeof(OnAutoInsertHandler)), Shared] [Method(LSP.VSInternalMethods.OnAutoInsertName)] - internal sealed class OnAutoInsertHandler : ILspServiceDocumentRequestHandler + [method: ImportingConstructor] + [method: Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] + internal sealed class OnAutoInsertHandler( + [ImportMany] IEnumerable> braceCompletionServices, + IGlobalOptionService globalOptions) : ILspServiceDocumentRequestHandler { - private readonly ImmutableArray _csharpBraceCompletionServices; - private readonly ImmutableArray _visualBasicBraceCompletionServices; - private readonly IGlobalOptionService _globalOptions; + private readonly ImmutableArray> _braceCompletionServices = braceCompletionServices.ToImmutableArray(); + private readonly IGlobalOptionService _globalOptions = globalOptions; public bool MutatesSolutionState => false; public bool RequiresLSPSolution => true; - [ImportingConstructor] - [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] - public OnAutoInsertHandler( - [ImportMany(LanguageNames.CSharp)] IEnumerable csharpBraceCompletionServices, - [ImportMany(LanguageNames.VisualBasic)] IEnumerable visualBasicBraceCompletionServices, - IGlobalOptionService globalOptions) - { - _csharpBraceCompletionServices = csharpBraceCompletionServices.ToImmutableArray(); - _visualBasicBraceCompletionServices = visualBasicBraceCompletionServices.ToImmutableArray(); - _globalOptions = globalOptions; - } - public LSP.TextDocumentIdentifier GetTextDocumentIdentifier(LSP.VSInternalDocumentOnAutoInsertParams request) => request.TextDocument; public async Task HandleRequestAsync( @@ -229,12 +221,7 @@ static string GetTextChangeTextWithCaretAtLocation(SourceText sourceText, TextCh private async Task<(IBraceCompletionService Service, BraceCompletionContext Context)?> GetBraceCompletionContextAsync(int caretLocation, Document document, CancellationToken cancellationToken) { - var servicesForDocument = document.Project.Language switch - { - LanguageNames.CSharp => _csharpBraceCompletionServices, - LanguageNames.VisualBasic => _visualBasicBraceCompletionServices, - _ => throw new ArgumentException($"Language {document.Project.Language} is not recognized for OnAutoInsert") - }; + var servicesForDocument = _braceCompletionServices.Where(s => s.Metadata.Language == document.Project.Language).SelectAsArray(s => s.Value); var parsedDocument = await ParsedDocument.CreateAsync(document, cancellationToken).ConfigureAwait(false); diff --git a/src/Features/VisualBasic/Portable/BraceCompletion/BracketBraceCompletionService.vb b/src/Features/VisualBasic/Portable/BraceCompletion/BracketBraceCompletionService.vb index 1b050659914f2..3ee4ea728879d 100644 --- a/src/Features/VisualBasic/Portable/BraceCompletion/BracketBraceCompletionService.vb +++ b/src/Features/VisualBasic/Portable/BraceCompletion/BracketBraceCompletionService.vb @@ -14,7 +14,7 @@ Imports Microsoft.CodeAnalysis.VisualBasic.LanguageService Imports Microsoft.CodeAnalysis.VisualBasic.Syntax Namespace Microsoft.CodeAnalysis.VisualBasic.BraceCompletion - + Friend Class BracketBraceCompletionService Inherits AbstractVisualBasicBraceCompletionService diff --git a/src/Features/VisualBasic/Portable/BraceCompletion/CurlyBraceCompletionService.vb b/src/Features/VisualBasic/Portable/BraceCompletion/CurlyBraceCompletionService.vb index c650e77006045..2f8b7ccef2be4 100644 --- a/src/Features/VisualBasic/Portable/BraceCompletion/CurlyBraceCompletionService.vb +++ b/src/Features/VisualBasic/Portable/BraceCompletion/CurlyBraceCompletionService.vb @@ -10,7 +10,7 @@ Imports Microsoft.CodeAnalysis.Host.Mef Imports Microsoft.CodeAnalysis.VisualBasic Namespace Microsoft.CodeAnalysis.VisualBasic.BraceCompletion - + Friend Class CurlyBraceCompletionService Inherits AbstractVisualBasicBraceCompletionService diff --git a/src/Features/VisualBasic/Portable/BraceCompletion/InterpolatedStringBraceCompletionService.vb b/src/Features/VisualBasic/Portable/BraceCompletion/InterpolatedStringBraceCompletionService.vb index 74272722ad892..bb8d519199db3 100644 --- a/src/Features/VisualBasic/Portable/BraceCompletion/InterpolatedStringBraceCompletionService.vb +++ b/src/Features/VisualBasic/Portable/BraceCompletion/InterpolatedStringBraceCompletionService.vb @@ -12,7 +12,7 @@ Imports Microsoft.CodeAnalysis.VisualBasic Imports Microsoft.CodeAnalysis.VisualBasic.Extensions.ContextQuery Namespace Microsoft.CodeAnalysis.VisualBasic.BraceCompletion - + Friend Class InterpolatedStringBraceCompletionService Inherits AbstractVisualBasicBraceCompletionService diff --git a/src/Features/VisualBasic/Portable/BraceCompletion/InterpolationBraceCompletionService.vb b/src/Features/VisualBasic/Portable/BraceCompletion/InterpolationBraceCompletionService.vb index 8b32312ce4f55..0d9071527ee49 100644 --- a/src/Features/VisualBasic/Portable/BraceCompletion/InterpolationBraceCompletionService.vb +++ b/src/Features/VisualBasic/Portable/BraceCompletion/InterpolationBraceCompletionService.vb @@ -11,7 +11,7 @@ Imports Microsoft.CodeAnalysis.Text Imports Microsoft.CodeAnalysis.VisualBasic Namespace Microsoft.CodeAnalysis.VisualBasic.BraceCompletion - + Friend Class InterpolationBraceCompletionService Inherits AbstractVisualBasicBraceCompletionService diff --git a/src/Features/VisualBasic/Portable/BraceCompletion/LessAndGreaterThanCompletionService.vb b/src/Features/VisualBasic/Portable/BraceCompletion/LessAndGreaterThanCompletionService.vb index e39e024003fd1..a5469d4b63238 100644 --- a/src/Features/VisualBasic/Portable/BraceCompletion/LessAndGreaterThanCompletionService.vb +++ b/src/Features/VisualBasic/Portable/BraceCompletion/LessAndGreaterThanCompletionService.vb @@ -12,7 +12,7 @@ Imports Microsoft.CodeAnalysis.VisualBasic Imports Microsoft.CodeAnalysis.VisualBasic.Syntax Namespace Microsoft.CodeAnalysis.VisualBasic.BraceCompletion - + Friend Class LessAndGreaterThanCompletionService Inherits AbstractVisualBasicBraceCompletionService diff --git a/src/Features/VisualBasic/Portable/BraceCompletion/ParenthesisBraceCompletionService.vb b/src/Features/VisualBasic/Portable/BraceCompletion/ParenthesisBraceCompletionService.vb index 639f282a35fa1..c358d2de1cfad 100644 --- a/src/Features/VisualBasic/Portable/BraceCompletion/ParenthesisBraceCompletionService.vb +++ b/src/Features/VisualBasic/Portable/BraceCompletion/ParenthesisBraceCompletionService.vb @@ -12,7 +12,7 @@ Imports Microsoft.CodeAnalysis.VisualBasic Imports Microsoft.CodeAnalysis.VisualBasic.Syntax Namespace Microsoft.CodeAnalysis.VisualBasic.BraceCompletion - + Friend Class ParenthesisBraceCompletionService Inherits AbstractVisualBasicBraceCompletionService diff --git a/src/Features/VisualBasic/Portable/BraceCompletion/StringLiteralBraceCompletionService.vb b/src/Features/VisualBasic/Portable/BraceCompletion/StringLiteralBraceCompletionService.vb index 6b3aa54ba318e..f0f3f44ae6f98 100644 --- a/src/Features/VisualBasic/Portable/BraceCompletion/StringLiteralBraceCompletionService.vb +++ b/src/Features/VisualBasic/Portable/BraceCompletion/StringLiteralBraceCompletionService.vb @@ -10,7 +10,7 @@ Imports Microsoft.CodeAnalysis.Host.Mef Imports Microsoft.CodeAnalysis.VisualBasic Namespace Microsoft.CodeAnalysis.VisualBasic.BraceCompletion - + Friend Class StringLiteralBraceCompletionService Inherits AbstractVisualBasicBraceCompletionService From 327bd32eecd7933826b5f18f325f6fd5504aa9f1 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Wed, 29 May 2024 11:11:04 +1000 Subject: [PATCH 2/2] Fix --- .../VisualBasicBraceCompletionServiceFactory.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EditorFeatures/VisualBasic/AutomaticCompletion/VisualBasicBraceCompletionServiceFactory.vb b/src/EditorFeatures/VisualBasic/AutomaticCompletion/VisualBasicBraceCompletionServiceFactory.vb index d58eb4458a120..94e859dfeb733 100644 --- a/src/EditorFeatures/VisualBasic/AutomaticCompletion/VisualBasicBraceCompletionServiceFactory.vb +++ b/src/EditorFeatures/VisualBasic/AutomaticCompletion/VisualBasicBraceCompletionServiceFactory.vb @@ -15,7 +15,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.AutomaticCompletion Public Sub New( - braceCompletionServices As IEnumerable(Of Lazy(Of IBraceCompletionService, LanguageMetadata))) + braceCompletionServices As IEnumerable(Of Lazy(Of IBraceCompletionService, LanguageMetadata))) MyBase.New(braceCompletionServices, LanguageNames.VisualBasic) End Sub End Class