-
Notifications
You must be signed in to change notification settings - Fork 390
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 #9605 from drewnoakes/lang-svc-modernisation
Language service tidying
- Loading branch information
Showing
19 changed files
with
373 additions
and
488 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
244 changes: 103 additions & 141 deletions
244
...ged.VS/ProjectSystem/VS/LanguageServices/Handlers/AbstractEvaluationCommandLineHandler.cs
Large diffs are not rendered by default.
Oops, something went wrong.
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
44 changes: 19 additions & 25 deletions
44
...m.Managed.VS/ProjectSystem/VS/LanguageServices/Handlers/CommandLineNotificationHandler.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 |
---|---|---|
@@ -1,38 +1,32 @@ | ||
// 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.md file in the project root for more information. | ||
|
||
using Microsoft.VisualStudio.Composition; | ||
using Microsoft.VisualStudio.LanguageServices.ProjectSystem; | ||
using Microsoft.VisualStudio.ProjectSystem.LanguageServices.FSharp; | ||
|
||
namespace Microsoft.VisualStudio.ProjectSystem.LanguageServices.Handlers | ||
namespace Microsoft.VisualStudio.ProjectSystem.LanguageServices.Handlers; | ||
|
||
/// <summary> | ||
/// An indirection that sends design-time build results in the form of command-line arguments to the F# language-service. | ||
/// </summary> | ||
/// <remarks> | ||
/// This indirection is needed because Microsoft.VisualStudio.ProjectSystem.FSharp does not have InternalsVisibleTo access to Roslyn. | ||
/// </remarks> | ||
[Export(typeof(IWorkspaceUpdateHandler))] | ||
[method: ImportingConstructor] | ||
internal class CommandLineNotificationHandler(UnconfiguredProject project) : IWorkspaceUpdateHandler, ICommandLineHandler | ||
{ | ||
/// <summary> | ||
/// An indirection that sends design-time build results in the form of command-line arguments to the F# language-service. | ||
/// </summary> | ||
/// <remarks> | ||
/// This indirection is needed because Microsoft.VisualStudio.ProjectSystem.FSharp does not have InternalsVisibleTo access to Roslyn. | ||
/// See <see cref="FSharpCommandLineParserService.HandleCommandLineNotifications"/> for an example of this export. | ||
/// </remarks> | ||
[Export(typeof(IWorkspaceUpdateHandler))] | ||
internal class CommandLineNotificationHandler : IWorkspaceUpdateHandler, ICommandLineHandler | ||
{ | ||
[ImportingConstructor] | ||
public CommandLineNotificationHandler(UnconfiguredProject project) | ||
{ | ||
// See FSharpCommandLineParserService.HandleCommandLineNotifications for an example of this export | ||
CommandLineNotifications = new OrderPrecedenceImportCollection<Action<string?, BuildOptions, BuildOptions>>(projectCapabilityCheckProvider: project); | ||
} | ||
|
||
/// <remarks> | ||
/// See <see cref="FSharpCommandLineParserService.HandleCommandLineNotifications"/> for an export. | ||
/// </remarks> | ||
[ImportMany] | ||
public OrderPrecedenceImportCollection<Action<string?, BuildOptions, BuildOptions>> CommandLineNotifications { get; } | ||
[ImportMany] | ||
public OrderPrecedenceImportCollection<Action<string?, BuildOptions, BuildOptions>> CommandLineNotifications { get; } = new(projectCapabilityCheckProvider: project); | ||
|
||
public void Handle(IWorkspaceProjectContext context, IComparable version, BuildOptions added, BuildOptions removed, ContextState state, IManagedProjectDiagnosticOutputService logger) | ||
public void Handle(IWorkspaceProjectContext context, IComparable version, BuildOptions added, BuildOptions removed, ContextState state, IManagedProjectDiagnosticOutputService logger) | ||
{ | ||
foreach (Action<string?, BuildOptions, BuildOptions> value in CommandLineNotifications.ExtensionValues()) | ||
{ | ||
foreach (Lazy<Action<string?, BuildOptions, BuildOptions>, IOrderPrecedenceMetadataView> value in CommandLineNotifications) | ||
{ | ||
value.Value(context.BinOutputPath, added, removed); | ||
} | ||
value(context.BinOutputPath, added, removed); | ||
} | ||
} | ||
} |
Oops, something went wrong.