This branch relies on using a locally-built version of FSAC from fsharp/FsAutoComplete#1159 to actually get the information about nested languages in a document.
The approach taken here is to
listen to notifications from FSAC about nested languages in a document
use these notifications to create virtual documents for each instance of a detected nested language whose contents are whitespace except for the content of the detected nested language
register a TextDocumentProvider for these virtual documents with an Ionide-managed scheme
insert a middleware into the LanguageClient that wraps each specific kind of functionality we want to 'light up' for these embedded documents. each wrapped function follows a similar strategy:
determine if the action is applicable to any virtual document(s)
if so, ask the editor to perform the associated action on the virtual document
if not, allow the editor to continue on asking FSAC to handle the interaction
So far, the majority of this seems to work, at least in theory. I am creating and updating the virtual documents on each typecheck of a file, and the middleware functions I've defined are being invoked. However the end-to-end isn't quite working. I'm trying to get Hover working because it's the easiest to see working, but ideally we'd be able to get Hover, Completion, and Highlighting working before merging this.
cc @alfonsogarciacaro for heads-up - I think if we get this right then https://github.com/alfonsogarciacaro/vscode-template-fsharp-highlight could be deprecated, as long as library authors update their libraries to add [<StringSyntax("css")>] or whatever language is appropriate.
Closes #1912
This branch relies on using a locally-built version of FSAC from fsharp/FsAutoComplete#1159 to actually get the information about nested languages in a document.
The approach taken here is to
So far, the majority of this seems to work, at least in theory. I am creating and updating the virtual documents on each typecheck of a file, and the middleware functions I've defined are being invoked. However the end-to-end isn't quite working. I'm trying to get
Hover
working because it's the easiest to see working, but ideally we'd be able to get Hover, Completion, and Highlighting working before merging this.cc @alfonsogarciacaro for heads-up - I think if we get this right then https://github.com/alfonsogarciacaro/vscode-template-fsharp-highlight could be deprecated, as long as library authors update their libraries to add
[<StringSyntax("css")>]
or whatever language is appropriate.