-
Notifications
You must be signed in to change notification settings - Fork 805
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
[WIP - VFT vNext? ] Check against Document/Project snapshots in VS2017 #1866
[WIP - VFT vNext? ] Check against Document/Project snapshots in VS2017 #1866
Conversation
@vasily-kirichenko If we're going to go down this route we may want to rearchitect the whole way we process documents to be much more Roslyn like. |
@vasily-kirichenko Could you merge with master when you get a chance? |
I don't think this is right thing to do in Roslyn world. In Roslyn request is made against the snapshot of the world (represented via We've already walked that path in in-proc version of TypeScript language service which btw has some similarities with its F# counterpart - i.e. all semantic requests are processed by dedicated thread that marshals requests into hosted Chakra instance. With this in mind we never read anything from disk or from editor buffers ourselves - everything was handled by Roslyn and before making any requests we've synchronized our internal state with current snapshot of the world. I can imagine something having something similar in F# language service: implementation of |
f76fc15
to
03b5937
Compare
Done. I agree with @vladima about using Roslyn workspaces for it instead. I think @cloudRoutine is an expert in this area :) |
@vladima so something like this would get us the content of the dirty buffers? let workspace =
serviceProvider.GetService(typeof<VisualStudioWorkspaceImpl>)
:?> VisualStudioWorkspaceImpl
let getOpenDocuments () =
workspace.CurrentSolution.ProjectIds
|> Seq.collect (fun projId ->
workspace.GetOpenDocumentIds projId |> Seq.map (fun docId ->
workspace.CurrentSolution.GetDocument docId))
let getBufferContent() =
getOpenDocuments() |> Seq.map (fun (doc:CodeAnalysis.Document) ->
async {
let! text = doc.GetTextAsync() |> Async.AwaitTask
return text
}|> Async.RunSynchronously) |
If so, it's easy to remove |
Renamed to show we're talking about Roslyn document snapshots |
@cloudRoutine no, this is effectively the same a trying to read content of the buffer directly - there is no guarantee that What is good about Roslyn is that we can really forget about the origin of the source text - all we know is that we have a Having this in mind I'd say that we can have an implementation of // cc @CyrusNajmabadi in case if he wants to chime in. |
From the above I'd say we should also adjust FCS to pass an IFileSystem parameter explicitly, rather than using a global mutable. |
@vasily-kirichenko Any recent progress on this? |
@cartermp no. |
I don't think it'll ever be implemented. Closing. |
@vasily-kirichenko Great that you took a first shot at this. It feels like we have to do this sometime. But maybe by a different approach? |
wip