Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/fsharp/service/service.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3383,3 +3383,5 @@ module PrettyNaming =
let QuoteIdentifierIfNeeded id = Lexhelp.Keywords.QuoteIdentifierIfNeeded id
let KeywordNames = Lexhelp.Keywords.keywordNames

module FSharpFileUtilities =
let isScriptFile (fileName: string) = CompileOps.IsScript fileName
3 changes: 3 additions & 0 deletions src/fsharp/service/service.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -766,3 +766,6 @@ module public PrettyNaming =
/// All the keywords in the F# language
val KeywordNames : string list

/// A set of helpers for dealing with F# files.
module FSharpFileUtilities =
val isScriptFile : string -> bool
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ open System.ComponentModel.Composition
open System.IO
open System.Linq
open Microsoft.CodeAnalysis
open FSharp.Compiler.CompileOps
open FSharp.Compiler.SourceCodeServices
open Microsoft.VisualStudio
open Microsoft.VisualStudio.FSharp.Editor
Expand Down Expand Up @@ -358,7 +357,7 @@ type internal FSharpProjectOptionsManager
let parsingOptions =
match reactor.TryGetCachedOptionsByProjectId(document.Project.Id) with
| Some (_, parsingOptions, _) -> parsingOptions
| _ -> { FSharpParsingOptions.Default with IsInteractive = IsScript document.Name }
| _ -> { FSharpParsingOptions.Default with IsInteractive = FSharpFileUtilities.isScriptFile document.Name }
CompilerEnvironment.GetCompilationDefinesForEditing parsingOptions

member this.TryGetOptionsByProject(project) =
Expand Down