Skip to content

VSMac external access for types required to startup the roslyn LSP server#60330

Merged
dibarbet merged 2 commits intodotnet:mainfrom
dibarbet:external_access_vsmac
Mar 25, 2022
Merged

VSMac external access for types required to startup the roslyn LSP server#60330
dibarbet merged 2 commits intodotnet:mainfrom
dibarbet:external_access_vsmac

Conversation

@dibarbet
Copy link
Member

Implements two types that are a required part of the mef composition in order to start any of the roslyn LSP servers

  1. LspWorkspaceRegistrationService -> We implement this in the .Cocoa dll as we know the host workspace kind for VSMac.
  2. ILspLoggerFactory + ILspLogger -> Implement as external access to allow vsmac to provide their own logger implementation.

@dibarbet dibarbet added Area-IDE LSP issues related to the roslyn language server protocol implementation labels Mar 23, 2022
@dibarbet dibarbet requested a review from a team as a code owner March 23, 2022 00:14
@dibarbet dibarbet requested a review from a team March 23, 2022 00:14
@davidwengier
Copy link
Member

I think this is the first thing VS Mac will be using through EA 😁

Copy link
Member

@sandyarmstrong sandyarmstrong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the wrapper and vsmac-specific interface necessary? Why not just have vsmac implement/export the interfaces directly?

/// as an <see cref="ILspLoggerFactory"/> for inclusion in the vsmac composition.
/// </summary>
[Export(typeof(ILspLoggerFactory)), Shared]
internal class VSMacLspLoggerFactoryWrapper : ILspLoggerFactory
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the Windows side, this factory is in the VS layer, not the EditorFeatures.Wpf layer. Typically that means the implementation should go in VSMac itself. I know we've discussed the idea of starting to move VSMac's Roslyn integration from VSMac to this repo, but we're not there yet. Whatever the reason is for wanting to implement this in Roslyn instead of VSMac right now, maybe we need a new "VSMac layer" assembly here, so that the purpose of EditorFeatures.Cocoa doesn't diverge too much from EditorFeatures.Wpf.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically there is no reason that the windows impl could not live in the editor features layer, other than at some point the host workspace kind may need to differ between VS and VSMac. At some point in the future I am potentially thinking about unifying all of them as well around a single impl in EditorFeatures, so I think we don't need a new VSMac layer for this right now

@dibarbet
Copy link
Member Author

Why is the wrapper and vsmac-specific interface necessary? Why not just have vsmac implement/export the interfaces directly?

this is the external access pattern we've used in the past for teams like F#/TS and has worked well. It allows us to

  1. Know that this interface is being used in VSMac
  2. Refactor the underlying interface without breaking VSMac.

@davidwengier
Copy link
Member

Sorry about the conflicts!

@dibarbet dibarbet enabled auto-merge (squash) March 23, 2022 21:56
@dibarbet
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@dibarbet dibarbet merged commit a71f431 into dotnet:main Mar 25, 2022
@ghost ghost added this to the Next milestone Mar 25, 2022
@dibarbet dibarbet deleted the external_access_vsmac branch March 25, 2022 20:29
@allisonchou allisonchou modified the milestones: Next, 17.2.P3 Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-IDE LSP issues related to the roslyn language server protocol implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants