-
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.
Merge pull request #65898 from dibarbet/fix_xaml_lsp
Fix XAML LSP by using a queue provider instead of subclassing
- Loading branch information
Showing
6 changed files
with
85 additions
and
37 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
...torFeatures/Core/ExternalAccess/VSTypeScript/VSTypeScriptRequestExecutionQueueProvider.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,31 @@ | ||
// 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.Collections.Generic; | ||
using System.Composition; | ||
using System.Text; | ||
using Microsoft.CodeAnalysis.Host.Mef; | ||
using Microsoft.CodeAnalysis.LanguageServer; | ||
using Microsoft.CodeAnalysis.LanguageServer.Handler; | ||
using Microsoft.CommonLanguageServerProtocol.Framework; | ||
|
||
namespace Microsoft.CodeAnalysis.ExternalAccess.VSTypeScript; | ||
|
||
[ExportStatelessLspService(typeof(IRequestExecutionQueueProvider<RequestContext>), ProtocolConstants.TypeScriptLanguageContract), Shared] | ||
internal sealed class VSTypeScriptRequestExecutionQueueProvider : IRequestExecutionQueueProvider<RequestContext> | ||
{ | ||
[ImportingConstructor] | ||
[Obsolete(MefConstruction.ImportingConstructorMessage, true)] | ||
public VSTypeScriptRequestExecutionQueueProvider() | ||
{ | ||
} | ||
|
||
public IRequestExecutionQueue<RequestContext> CreateRequestExecutionQueue(AbstractLanguageServer<RequestContext> languageServer, ILspLogger logger, IHandlerProvider handlerProvider) | ||
{ | ||
var queue = new RoslynRequestExecutionQueue(languageServer, logger, handlerProvider); | ||
queue.Start(); | ||
return queue; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/Features/LanguageServer/Protocol/IRequestExecutionQueueProvider.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 @@ | ||
// 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 Microsoft.CommonLanguageServerProtocol.Framework; | ||
|
||
namespace Microsoft.CodeAnalysis.LanguageServer; | ||
|
||
internal interface IRequestExecutionQueueProvider<RequestContext> : ILspService | ||
{ | ||
IRequestExecutionQueue<RequestContext> CreateRequestExecutionQueue(AbstractLanguageServer<RequestContext> languageServer, ILspLogger logger, IHandlerProvider handlerProvider); | ||
} |
28 changes: 28 additions & 0 deletions
28
src/Features/LanguageServer/Protocol/RequestExecutionQueueProvider.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,28 @@ | ||
// 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; | ||
using Microsoft.CodeAnalysis.Host.Mef; | ||
using Microsoft.CodeAnalysis.LanguageServer.Handler; | ||
using Microsoft.CommonLanguageServerProtocol.Framework; | ||
|
||
namespace Microsoft.CodeAnalysis.LanguageServer; | ||
|
||
[ExportCSharpVisualBasicStatelessLspService(typeof(IRequestExecutionQueueProvider<RequestContext>)), Shared] | ||
internal sealed class RequestExecutionQueueProvider : IRequestExecutionQueueProvider<RequestContext> | ||
{ | ||
[ImportingConstructor] | ||
[Obsolete(MefConstruction.ImportingConstructorMessage, true)] | ||
public RequestExecutionQueueProvider() | ||
{ | ||
} | ||
|
||
public IRequestExecutionQueue<RequestContext> CreateRequestExecutionQueue(AbstractLanguageServer<RequestContext> languageServer, ILspLogger logger, IHandlerProvider handlerProvider) | ||
{ | ||
var queue = new RoslynRequestExecutionQueue(languageServer, logger, handlerProvider); | ||
queue.Start(); | ||
return queue; | ||
} | ||
} |
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