Skip to content

Commit

Permalink
fix bug in unsaved settings
Browse files Browse the repository at this point in the history
  • Loading branch information
goswinr committed Nov 3, 2024
1 parent fc66b3d commit 4cf75a1
Show file tree
Hide file tree
Showing 13 changed files with 65 additions and 70 deletions.
17 changes: 8 additions & 9 deletions FeshHosting.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
<Product>Fesh</Product>
<PackageId>Fesh</PackageId>

<Version>0.13.0</Version>
<AssemblyVersion>0.13.0</AssemblyVersion>
<FileVersion>0.13.0</FileVersion>
<Version>0.14.0</Version>
<AssemblyVersion>0.14.0</AssemblyVersion>
<FileVersion>0.14.0</FileVersion>

<PackageReleaseNotes>
- catch fsi startup errors
- fix bug in unsaved settings
</PackageReleaseNotes>

<Authors>GoswinR</Authors>
Expand All @@ -55,7 +55,7 @@
<RepositoryUrl>https://github.com/goswinr/Fesh</RepositoryUrl>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<PackageIcon>logo128.png</PackageIcon>
<PackageReadmeFile>READMEnuget.md</PackageReadmeFile><!-- using snupkg the readme does not pack https://github.com/NuGet/Home/issues/10791 -->
<PackageReadmeFile>README.md</PackageReadmeFile><!-- using snupkg the readme does not pack https://github.com/NuGet/Home/issues/10791 -->
<PackageDescription>A hostable fsharp scripting editor for Windows based on Avalonedit</PackageDescription>
<PackageTags>WPF TextEditor fsharp scripting FSI AvalonEdit fesh</PackageTags>
</PropertyGroup>
Expand All @@ -66,15 +66,14 @@
<PackageReference Include="FSharp.Compiler.Service" Version="43.8.400" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />

<PackageReference Include="Fittings" Version="0.6.0" />
<PackageReference Include="AvalonLog" Version="0.14.0" />
<PackageReference Include="Fittings" Version="0.8.0" />
<PackageReference Include="AvalonLog" Version="0.15.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
<!-- https://docs.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files#controlling-dependency-assets -->
</ItemGroup>

<ItemGroup>
<None Include="README.md" />
<None Include="Media/READMEnuget.md" Pack="true" PackagePath="\" />
<None Include="README.md" Pack="true" PackagePath="\" />
<None Include="Media/logo128.png" Pack="true" PackagePath="\" /> <!--PackagePath = "\" makes the file available to nuget pack tool-->
<EmbeddedResource Include="Media/logo.res" /> <!-- for Application Icon in explorer-->
<Resource Include="Media/logo.ico" /> <!-- for Application Icon in primary windows-->
Expand Down
14 changes: 7 additions & 7 deletions FeshStandalone.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<UseWindowsForms>true</UseWindowsForms> <!--inherited from Avalonedit ?-->
<TargetFrameworks>net472;net8.0-windows</TargetFrameworks>
<!-- <RuntimeIdentifiers>win-x64;win-x86</RuntimeIdentifiers> -->
<!-- <RuntimeIdentifier>win-x64</RuntimeIdentifier> -->
<DefineConstants Condition="'$(TargetFramework)' == 'net472'">NETFRAMEWORK</DefineConstants>

<LangVersion>preview</LangVersion> <!-- to enable indexing from end via ^ -->
Expand All @@ -29,9 +30,9 @@
<Title>Fesh</Title>
<Product>Fesh</Product>

<Version>0.13.0</Version>
<AssemblyVersion>0.13.0</AssemblyVersion>
<FileVersion>0.13.0</FileVersion>
<Version>0.14.0</Version>
<AssemblyVersion>0.14.0</AssemblyVersion>
<FileVersion>0.14.0</FileVersion>

<Company>Goswin Rothenthal</Company> <!-- <Company> shows up on file preview on fesh.exe in windows file explorer-->
<Authors>GoswinR</Authors>
Expand All @@ -54,8 +55,8 @@
<PackageReference Include="FSharp.Compiler.Service" Version="43.8.400" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />

<PackageReference Include="Fittings" Version="0.6.0" />
<PackageReference Include="AvalonLog" Version="0.14.0" />
<PackageReference Include="Fittings" Version="0.8.0" />
<PackageReference Include="AvalonLog" Version="0.15.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />


Expand All @@ -64,8 +65,7 @@
</ItemGroup>

<ItemGroup>
<None Include="README.md" />
<None Include="Media/READMEnuget.md" Pack="true" PackagePath="\" />
<None Include="README.md" Pack="true" PackagePath="\" />
<None Include="Media/logo128.png" Pack="true" PackagePath="\" /> <!--PackagePath = "\" makes the file available to nuget pack tool-->
<EmbeddedResource Include="Media/logo.res" /> <!-- for Application Icon in explorer-->
<Resource Include="Media/logo.ico" /> <!-- for Application Icon in primary windows-->
Expand Down
File renamed without changes.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
![code size](https://img.shields.io/github/languages/code-size/goswinr/Fesh.svg)
[![license](https://img.shields.io/github/license/goswinr/Fesh)](LICENSE)

Fesh is a **<ins>F</ins># <ins>E</ins>ditor & <ins>S</ins>cripting <ins>H</ins>ost**.\
Fesh is an ***F***# ***E***ditor & ***S***cripting ***H***ost.\
On Windows.

It is designed for embedding F# as application scripting tool.\
Expand Down Expand Up @@ -57,7 +57,7 @@ Initial static syntax highlighting is done via AvalonEdit's regex based highligh
See [SyntaxHighlightingFSharp.xshd](https://github.com/goswinr/Fesh/blob/main/Src/SyntaxHighlightingFSharp.xshd).\
The F# Compiler Service provides additional semantic highlighting.\
If you want different colors go the menu: `About` -> `Open and watch SyntaxHighlighting in VS Code`.\
You wil see any changes upon every save in VS Code.\
You wil see any changes upon every save in VS Code.

### Auto complete
Auto complete works on enter and dot, also when typing in the middle of a word.
Expand Down Expand Up @@ -85,6 +85,9 @@ Or via the menu: `About` -> `Open Settings Folder`.

## Release notes

`0.14.0`
- fix bug in unsaved settings

`0.13.0`
- fix crash on assembly load conflict
- faster completion window
Expand Down
4 changes: 2 additions & 2 deletions Src/CompileScript.fs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ module CompileScript =
gray "starting MSBuild.exe ..."
let msBuildFolders =
[
config.Settings.Get "MSBuild.exe" |> Option.defaultValue ""
config.Settings.TryGetString "MSBuild.exe" |> Option.defaultValue ""
@"C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe"
@"C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\MSBuild.exe"
@"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild.exe"
Expand All @@ -178,7 +178,7 @@ module CompileScript =
// TODO use https://github.com/microsoft/MSBuildLocator
IFeshLog.log.PrintfnIOErrorMsg "MSBuild.exe not found at:\r\n%s " (msBuildFolders |> String.concat Environment.NewLine)
IFeshLog.log.PrintfnIOErrorMsg "If you have MSBuild.exe on your PC please add the path to the settings file like this:"
IFeshLog.log.PrintfnAppErrorMsg "MSBuild.exe=C:\Folder\Where\it\is\MSBuild.exe"
IFeshLog.log.PrintfnAppErrorMsg "MSBuild.exe=C:/Folder/Where/it/is/MSBuild.exe"
IFeshLog.log.PrintfnIOErrorMsg "the settings file is at %s" config.RunContext.SettingsFileInfo.FullName
false
| Some msBuildexe ->
Expand Down
5 changes: 3 additions & 2 deletions Src/Fsi.fs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ type Fsi private (config:Config) =
| FSharpDiagnosticSeverity.Info -> () //log.PrintfnInfoMsg "EvalInteractionNonThrowing returned Info: %s" e.Message

//match evaluatedToValue with //|Some v -> log.PrintfnDebugMsg "Interaction evaluated to %A <%A>" v.ReflectionValue v.ReflectionType //|None-> ()
if config.Settings.GetBoolSaveDefault("printDoneAfterEval",false) then log.PrintfnInfoMsg "*Done!"
if config.Settings.GetBool("printDoneAfterEval",false) then log.PrintfnInfoMsg "*Done!"

|Choice2Of2 exn ->
match exn with
Expand Down Expand Up @@ -571,6 +571,8 @@ type Fsi private (config:Config) =
log.PrintfnFsiErrorMsg $"Then load the Fesh Editor first, that can solve assembly conflicts."
else
log.PrintfnFsiErrorMsg "Please try restarting Fesh."


}
|> Async.Start

Expand Down Expand Up @@ -675,7 +677,6 @@ type Fsi private (config:Config) =
mode <- sync
modeChangedEv.Trigger(sync)
setConfig()
config.Settings.Save()
initFsi (config)
| UserDoesntWantTo -> ()
| NotPossibleSync -> log.PrintfnInfoMsg "Wait till current synchronous evaluation completes before setting mode to Async."
Expand Down
2 changes: 1 addition & 1 deletion Src/Initialize.fs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module Initialize =
else
IFeshLog.log.PrintfnInfoMsg $"You are using the latest version of Fesh: {cv}"
with _ ->
IFeshLog.log.PrintfnInfoMsg "Could not check for updates on https://github.com/goswinr/Fesh/releases. Are you offline?"
IFeshLog.log.PrintfnInfoMsg "Could not check for updates on https://github.com/goswinr/Fesh/releases.\r\nAre you offline?"
}
|> Async.Start

Expand Down
Loading

0 comments on commit 4cf75a1

Please sign in to comment.