Permalink
Browse files

fix: updated reference locations when building type check info

  • Loading branch information...
1 parent 149a752 commit 470bf1462dac8210cebff96196331fb4e43d9cc3 @fahadsuhaib committed Feb 20, 2012
Showing with 10 additions and 6 deletions.
  1. +9 −5 src/fsharp/FSharp.Compiler.Silverlight/fsisilverlight.fs
  2. +1 −1 src/fsharp/vs/service.fs
@@ -98,7 +98,7 @@ type TypeCheckResults internal (results:Microsoft.FSharp.Compiler.SourceCodeServ
type public SimpleSourceCodeServices() =
- let filename = "example.fsx"
+ let filename = System.IO.Directory.GetCurrentDirectory() + "\\example.fsx"
let tokenizer = SourceTokenizer([], filename)
let checker = InteractiveChecker.Create(fun _ -> ())
let fileversion = 0
@@ -129,13 +129,17 @@ type public SimpleSourceCodeServices() =
/// For errors, quick info, goto-definition, declaration list intellisense, method overload intellisense
member x.TypeCheckSource (source:string, otherFlags: string[]) =
-#if FX_ATLEAST_40
- begin
+#if SILVERLIGHT
+ begin
use file = new System.IO.StreamWriter(System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForApplication().CreateFile(filename))
file.Write source
end;
-#endif
- //let options = checker.GetCheckOptionsFromScriptRoot(filename, source, otherFlags)
+#else
+ begin
+ use file = new System.IO.StreamWriter(System.IO.File.Create(filename))
+ file.Write source
+ end;
+#endif
let options = { ProjectFileName="console.fsproj"; ProjectFileNames=[| filename |]; ProjectOptions=otherFlags; IsIncompleteTypeCheckEnvironment=false; UseScriptResolutionRules=true }
checker.StartBackgroundCompile options;
// wait for the antecedent to appear
View
@@ -3921,7 +3921,7 @@ type BackgroundCompiler(fileTypeCheckStateIsDirty:FileTypeCheckStateIsDirty) =
let commandLineArgs = options.ProjectOptions |> Array.toList
// Build initial TC config
- let tcConfigB = CompilerEnvironment.CreateTcConfig(options.ProjectDirectory, commandLineArgs, options.UseScriptResolutionRules)
+ let tcConfigB = CompilerEnvironment.CreateTcConfig((if options.ProjectDirectory <> "" then options.ProjectDirectory else System.IO.Directory.GetCurrentDirectory()), commandLineArgs, options.UseScriptResolutionRules)
let _, _, assemblyName = tcConfigB.DecideNames sourceFiles
let tcConfig = TcConfig.Create(tcConfigB,validate=true)

0 comments on commit 470bf14

Please sign in to comment.