Skip to content

Commit

Permalink
fsxc: also write comments for other preprocessors
Browse files Browse the repository at this point in the history
In a similar vain to [1], we should write lines when
encountering these other cases.

[1] bd7ae17
  • Loading branch information
knocte committed Sep 3, 2024
1 parent 42ef0d2 commit a8662ee
Showing 1 changed file with 36 additions and 2 deletions.
38 changes: 36 additions & 2 deletions fsxc/Fsxc.fs
Original file line number Diff line number Diff line change
Expand Up @@ -594,8 +594,21 @@ let fsi = { CommandLineArgs = System.Environment.GetCommandLineArgs() }
)

match action with
| PreProcessorAction.Skip -> ()
| PreProcessorAction.Skip ->
File.AppendAllText(
autogeneratedFile.FullName,
startCommentInFSharp
+ line
+ Environment.NewLine
)
| PreProcessorAction.Load fileName ->
File.AppendAllText(
autogeneratedFile.FullName,
startCommentInFSharp
+ line
+ Environment.NewLine
)

let file =
FileInfo(
Path.Combine(
Expand All @@ -608,6 +621,14 @@ let fsi = { CommandLineArgs = System.Environment.GetCommandLineArgs() }

#if LEGACY_FRAMEWORK
| PreProcessorAction.NugetRef(nugetPkgName, version) ->

File.AppendAllText(
autogeneratedFile.FullName,
startCommentInFSharp
+ line
+ Environment.NewLine
)

let downloadedRef =
nugetRefToNormalRef
origScript
Expand All @@ -618,9 +639,22 @@ let fsi = { CommandLineArgs = System.Environment.GetCommandLineArgs() }
#else

| PreProcessorAction.NugetRef(_nugetPkgName, _version) ->
()
File.AppendAllText(
autogeneratedFile.FullName,
startCommentInFSharp
+ line
+ Environment.NewLine
)
#endif
| PreProcessorAction.Ref refName ->

File.AppendAllText(
autogeneratedFile.FullName,
startCommentInFSharp
+ line
+ Environment.NewLine
)

let maybeFile =
FileInfo(
Path.Combine(
Expand Down

0 comments on commit a8662ee

Please sign in to comment.