Skip to content

Commit 53f8ea1

Browse files
cartermpKevinRansom
authored andcommitted
Clean projectinfomanager (#6850)
* Expose IsScript from CompileOps so IVT is not needed * Undo rename of internal VersionStamp in PatternMatcher
1 parent be0a374 commit 53f8ea1

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/fsharp/service/service.fs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3325,3 +3325,5 @@ module PrettyNaming =
33253325
let QuoteIdentifierIfNeeded id = Lexhelp.Keywords.QuoteIdentifierIfNeeded id
33263326
let KeywordNames = Lexhelp.Keywords.keywordNames
33273327

3328+
module FSharpFileUtilities =
3329+
let isScriptFile (fileName: string) = CompileOps.IsScript fileName

src/fsharp/service/service.fsi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,3 +761,6 @@ module public PrettyNaming =
761761
/// All the keywords in the F# language
762762
val KeywordNames : string list
763763

764+
/// A set of helpers for dealing with F# files.
765+
module FSharpFileUtilities =
766+
val isScriptFile : string -> bool

vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ open System.ComponentModel.Composition
1010
open System.IO
1111
open System.Linq
1212
open Microsoft.CodeAnalysis
13-
open FSharp.Compiler.CompileOps
1413
open FSharp.Compiler.SourceCodeServices
1514
open Microsoft.VisualStudio
1615
open Microsoft.VisualStudio.FSharp.Editor
@@ -359,7 +358,7 @@ type internal FSharpProjectOptionsManager
359358
let parsingOptions =
360359
match reactor.TryGetCachedOptionsByProjectId(document.Project.Id) with
361360
| Some (_, parsingOptions, _) -> parsingOptions
362-
| _ -> { FSharpParsingOptions.Default with IsInteractive = IsScript document.Name }
361+
| _ -> { FSharpParsingOptions.Default with IsInteractive = FSharpFileUtilities.isScriptFile document.Name }
363362
CompilerEnvironment.GetCompilationDefinesForEditing parsingOptions
364363

365364
member this.TryGetOptionsByProject(project) =

0 commit comments

Comments
 (0)