This doesn't look right - you should be checking using ParseFileInProject/CheckFileInProject (e.g. via a request to the agent) so you check w.r.t. the current source.

See https://github.com/fsharp/fsharpbinding/blob/master/FSharp.CompilerBinding/LanguageService.fs#L311

Note the simplified agent in that file - and also the two files are beginning to diverge quite heavily.