-
Notifications
You must be signed in to change notification settings - Fork 840
enable preview LSP support in VS #6945
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Tagging @cartermp for his thoughts. |
cartermp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the overall goal of this?
It would also help to understand the overall architectural strategy and why we can't use something like FSAC, which is already fully LSP-compliant.
|
Note that we can also use FSharpLu.Json for a smaller DU payload:https://www.nuget.org/packages/Microsoft.FSharpLu.Json/ |
Two answers depending on what you're asking:
Ultimately I'm less concerned about the VS work right now, but eventually we'll need a supported method for remote F# editor stuff. |
So far we only need two small converters, so I'd rather consume what's in this PR to keep us from requiring a signing and symbol archiving exemption. If we end up duplicating a lot of work then we can re-visit the VS exemption issue. |
|
Sounds good. I also talked to @TIHan about this and it makes sense. We'll want the testbed for rapid iteration. |
|
Will rebase to re-merge and re-test. |
Includes plumbing and a stub for `textDocument/hover` (e.g., QuickInfo).
Co-Authored-By: Phillip Carter <[email protected]>
* enable preview LSP support Includes plumbing and a stub for `textDocument/hover` (e.g., QuickInfo). * enable easy exclusion of the language server from VS components * Update src/fsharp/FSharp.Compiler.LanguageServer/TextDocument.fs Co-Authored-By: Phillip Carter <[email protected]>
Marked [WIP] so I can verify signed builds and VS insertion before merging toVerified sign check. N.b., insertion will require adding a sign exclusion formaster.Nerdbank.Streams.dll, but that won't be an issue until this actually ships as part of an official VSIX (e.g., not inrelease/dev16.2because these changes are explicitly going to be blocked there.)This allows VS to consume the out-of-process
FSharp.Compiler.LanguageServerand threads through the appropriate options. As it currently stands the default behavior for everything remains the same, but it does enable the following scenario:Consume the regular QuickInfo:
Or check the option
Text Editor -> F# -> Advanced -> (Preview) Use out of process language server -> Text hoverto instead haveFSharp.Compiler.LanguageServerprovide the LSP equivalent:The process going forward to add new LSP features to VS will be to:
src/fsharp/FSharp.Compiler.LanguageServer/Methods.fsServerCapabilitiesrecord insrc/fsharp/FSharp.Compiler.LanguageServer/LspTypes.fsOptionsrecord insrc/fsharp/FSharp.Compiler.LanguageServer/LspExternalAccess.fs.AdvancedOptionsrecord invsintegration/src/FSharp.Editor/Options/EditorOptions.fsvsintegration/src/FSharp.UIResources/AdvancedOptionsControl.xamlHovermethod insrc/fsharp/FSharp.Compiler.LanguageServer/TextDocument.fsreturnsNoneif the option is not enabled.)GetQuickInfoItemAsyncinvsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fsreturnsnullif the preview option is enabled.)Next steps:
FSharp.Editor.dll) what makes sense. Not everything belongs out-of-process, and one can argue that QuickInfo/textDocument/hoveris one of those things that's better in-proc, but it served as an easy demonstration.Once this is in I plan on reverting inI added the variablerelease/dev16.2just the UI changes inAdvancedOptionsControl.xamland removing the[<Export>]attribute fromFSharpLanguageClient.fsbecause I think we need much more runway of testing this in nightly builds.$(IncludeVsLanguageServer)ineng/targets/Settings.propswhich will be left astrueinmasterand changed tofalseinrelease/dev16.2. This will prevent the extra complexity from shipping out of that branch, but makes for an easy way to re-enable it if/when appropriate.