Replies: 1 comment
-
|
You’re not missing anything. There is no supported way to get a Document from the Script API. Roslyn scripting does not integrate with Document/Workspace, and there is currently no official bridge between the two. For a REPL, either keep using the obsolete classifier or opt into an AdhocWorkspace if you want the newer async APIs. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
My game engine uses Roslyn's script API to implement a C# REPL. This works wonders and is an amazing tool. As part of this, I nicely syntax highlight the code submitted to the REPL. I am currently using
Classifier.GetClassifiedSpans, however this was made obsolete in favor of an asynchronous method that takes aDocument.I would love to switch, but there is, as far as I can tell, no API I can use to get a
Documentfrom theScriptAPI, thereby making it impossible to use this new (not obsolete) API.I previously asked about this on the C# Discord and did get a reply by a Microsoft employee, but my question was not answered of "how to get a
DocumentwithScript". I dropped it back then but, well, now I'm looking into this again.Beta Was this translation helpful? Give feedback.
All reactions