Skip to content

Commit

Permalink
Revert parsing APIs (fallback to the new ones), fix VFT projects
Browse files Browse the repository at this point in the history
  • Loading branch information
auduchinok committed Sep 20, 2017
1 parent c9cd271 commit 5d098c4
Show file tree
Hide file tree
Showing 10 changed files with 137 additions and 60 deletions.
4 changes: 2 additions & 2 deletions src/fsharp/CompileOptions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1125,11 +1125,11 @@ let GetCoreFsiCompilerOptions (tcConfigB: TcConfigBuilder) =
testingAndQAFlags tcConfigB])
]

let ApplyCommandLineArgs(tcConfigB: TcConfigBuilder, sourceFiles: string list, commandLineArgs) =
let ApplyCommandLineArgs(tcConfigB: TcConfigBuilder, sourceFiles: string list, argv) =
try
let sourceFilesAcc = ResizeArray(sourceFiles)
let collect name = if not (Filename.isDll name) then sourceFilesAcc.Add(name)
ParseCompilerOptions(collect, GetCoreServiceCompilerOptions tcConfigB, commandLineArgs)
ParseCompilerOptions(collect, GetCoreServiceCompilerOptions tcConfigB, argv)
ResizeArray.toList(sourceFilesAcc)
with e ->
errorRecovery e range0
Expand Down
4 changes: 2 additions & 2 deletions src/fsharp/CompileOptions.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ val GetCoreFscCompilerOptions : TcConfigBuilder -> CompilerOptionBlock list
val GetCoreFsiCompilerOptions : TcConfigBuilder -> CompilerOptionBlock list
val GetCoreServiceCompilerOptions : TcConfigBuilder -> CompilerOptionBlock list

// Apply args to TcConfigBuilder and return new list of source files
val ApplyCommandLineArgs: TcConfigBuilder * string list * string list -> string list
/// Apply args to TcConfigBuilder and return new list of source files
val ApplyCommandLineArgs: tcConfigB: TcConfigBuilder * sourceFiles: string list * argv: string list -> string list

// Expose the "setters" for some user switches, to enable setting of defaults
val SetOptimizeSwitch : TcConfigBuilder -> OptionSwitch -> unit
Expand Down
6 changes: 6 additions & 0 deletions src/fsharp/vs/IncrementalBuild.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1189,6 +1189,11 @@ type IncrementalBuilder(tcGlobals,frameworkTcImports, nonFrameworkAssemblyInputs
for r in nonFrameworkResolutions do
yield r.resolvedPath ]

let allDependencies =
[ yield! basicDependencies
for (_,f,_) in sourceFiles do
yield f ]

// The IncrementalBuilder needs to hold up to one item that needs to be disposed, which is the tcImports for the incremental
// build.
let mutable cleanupItem = None: TcImports option
Expand Down Expand Up @@ -1532,6 +1537,7 @@ type IncrementalBuilder(tcGlobals,frameworkTcImports, nonFrameworkAssemblyInputs
member __.FileChecked = fileChecked.Publish
member __.ProjectChecked = projectChecked.Publish
member __.ImportedCcusInvalidated = importsInvalidated.Publish
member __.AllDependenciesDeprecated = allDependencies

#if EXTENSIONTYPING
member __.ThereAreLiveTypeProviders =
Expand Down
2 changes: 2 additions & 0 deletions src/fsharp/vs/IncrementalBuild.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ type internal IncrementalBuilder =
/// Raised when a type provider invalidates the build.
member ImportedCcusInvalidated : IEvent<string>

/// The list of files the build depends on
member AllDependenciesDeprecated : string list
#if EXTENSIONTYPING
/// Whether there are any 'live' type providers that may need a refresh when a project is Cleaned
member ThereAreLiveTypeProviders : bool
Expand Down
5 changes: 4 additions & 1 deletion src/fsharp/vs/ServiceUntypedParse.fs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ type CompletionContext =
//----------------------------------------------------------------------------

[<Sealed>]
type FSharpParseFileResults(errors : FSharpErrorInfo[], input : Ast.ParsedInput option, parseHadErrors : bool) =
type FSharpParseFileResults(errors: FSharpErrorInfo[], input: Ast.ParsedInput option, parseHadErrors: bool, dependencyFiles: string[]) =

member scope.Errors = errors

Expand Down Expand Up @@ -379,6 +379,9 @@ type FSharpParseFileResults(errors : FSharpErrorInfo[], input : Ast.ParsedInput
(fun msg ->
Trace.TraceInformation(sprintf "FCS: recovering from error in ValidateBreakpointLocationImpl: '%s'" msg)
None)

/// When these files appear or disappear the configuration for the current project is invalidated.
member scope.DependencyFiles = dependencyFiles

member scope.FileName =
match input with
Expand Down
5 changes: 4 additions & 1 deletion src/fsharp/vs/ServiceUntypedParse.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,16 @@ type internal FSharpParseFileResults =
/// Return the inner-most range associated with a possible breakpoint location
member ValidateBreakpointLocation : pos:pos -> range option

/// When these files change then the build is invalid
member DependencyFiles : string[]

/// Get the errors and warnings for the parse
member Errors : FSharpErrorInfo[]

/// Indicates if any errors occurred during the parse
member ParseHadErrors : bool

internal new: errors: FSharpErrorInfo[] * input: Ast.ParsedInput option * parseHadErrors: bool -> FSharpParseFileResults
internal new: errors: FSharpErrorInfo[] * input: Ast.ParsedInput option * parseHadErrors: bool * dependencyFiles: string[] -> FSharpParseFileResults

/// Information about F# source file names
#if COMPILER_PUBLIC_API
Expand Down
Loading

0 comments on commit 5d098c4

Please sign in to comment.