silkyfowl / avalonia.funcui.liveview Goto Github PK
View Code? Open in Web Editor NEWLive fs/fsx previewer for Avalonia.FuncUI.
License: MIT License
Live fs/fsx previewer for Avalonia.FuncUI.
License: MIT License
The current implementation assumes that only the file being edited is Analyzed.
However, the Analyzer's behavior has changed so that every time one source code is edited, the project's files are analyzed.
This has caused a bug.
Moved from Avalonia.FuncUI issues.
I tried to use LiveView with my https://github.com/JordanMarr/FSharp.ChordParser project, but I have not yet been able to get it to work.
nuget
to install the analyzer to packages/analyzers
:nuget install SilkyFowl.Avalonia.FuncUI.LiveView.Analyzer -Version 0.0.1-alpha2 -OutputDirectory packages/analyzers
<PackageReference Include="SilkyFowl.Avalonia.FuncUI.LiveView" Version="0.0.1-alpha2" />
But the LivePreview window says "the FuncUiAnalyzer server is not active":
My changes here in the LivePreview branch:
https://github.com/JordanMarr/FSharp.ChordParser/tree/LivePreview
Exception has occurred: CLR/System.TypeInitializationException
An unhandled exception of type 'System.TypeInitializationException' occurred in Avalonia.FuncUI.LiveView.dll: 'The type initializer for '<StartupCode$Avalonia-FuncUI-LiveView>.$LiveView' threw an exception.'
Inner exceptions found, see $exception in variables window for more details.
Innermost exception System.Exception : Error creating evaluation session: StopProcessingExn
at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1448.Invoke(String message)
at FSharp.Compiler.Interactive.Shell.FsiEvaluationSession..ctor(FsiEvaluationSessionHostConfig fsi, String[] argv, TextReader inReader, TextWriter outWriter, TextWriter errorWriter, Boolean fsiCollectible, FSharpOption1 legacyReferenceResolver) at FSharp.Compiler.Interactive.Shell.FsiEvaluationSession.Create(FsiEvaluationSessionHostConfig fsiConfig, String[] argv, TextReader inReader, TextWriter outWriter, TextWriter errorWriter, FSharpOption
1 collectible, FSharpOption`1 legacyReferenceResolver)
at Avalonia.FuncUI.LiveView.FsiSession.create()
at <StartupCode$Avalonia-FuncUI-LiveView>.$LiveView..cctor()
Greetings!
Recently, FuncUI has been officially added to the Avalonia family, which has allowed us to change the NuGet package name from JaggerJo.Avalonia.FuncUI
to Avalonia.FuncUI
.
Would it be possible to release a new version of LiveView that works with the latest Avalonia.FuncUI
package?
To support #17, v0.0.1-alpha4 is released as v0.0.1.
After v0.0.2-alpha1, it will support the new Avalonia.FuncUI package.
SilkyFowl.Avalonia.FuncUI.LiveView contains a LiveViewWindow
that previews a function with a LivePreviewAttribute
. Because of this, a dependency of LiveViewWindow
, which is not necessary, is mixed into the project that wants to be previewed.
Since LivePreviewAttribute
itself has no dependency, it can be solved by separating LiveViewWindow
into a separate library.
Hey, I was trying to get this to work, and it seems like it doesn't like a change that's happened in avalonia funcui version 1
Unhandled exception. System.TypeLoadException: Could not load type 'Avalonia.FuncUI.Builder.ViewBuilder' from assembly 'Avalonia.FuncUI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
at Avalonia.FuncUI.LiveView.StateStoreModule.init()
at Avalonia.FuncUI.LiveView.LiveViewWindow..ctor()
how would you recommend working around this?
As soon as the contents are finalized, they will be included in README.md.
Aim to PR in Avalonia.FuncUI.
context:
Things to do in this repository before creating a PR
LIVEPREVIEW
directive
DEBUG
directive?If you want to achieve PR, you need to do something about the current situation where IP address and Port are fixed.
XAML Studio
for that?LivePreview cannot be performed if an fsharp code contains a "DU with values in all Cases" such as the following:
type Bar =
| Hoge of int
| Fuga of string
// A single valued DU can also cause problems.
type Foo= Foo of id:int
However, if there is more than one Case with no value, there is no problem.
type Foo = Foo
type Bar =
| Hoge
| Fuga of string
type Bar<'t> =
| Hoge
| Fuga of string
| A of {|a:int; b:string; c: bool * string|}
| B of ('t -> unit)
Avalonia.FuncUI.LiveView/src/Sample/ElmishSample.fs
Lines 1 to 60 in dc88338
Avalonia.FuncUI.LiveView/src/Sample/Types.fs
Lines 13 to 22 in dc88338
Avalonia.FuncUI.LiveView
uses FSharp.Compiler.Service
to perform TypedAST pattern matching to determine if Preview is performed.
However, if a DU with values in all cases is included in some fsharp code, the following error occurs.
FSharp.Compiler.Service cannot yet return this kind of pattern match
Originally posted by @SilkyFowl in #1 (comment)
Work
// Some code...
type AnyDuHasNoValueLabelCase =
| Foo
| Bar of int
Not Work(Error Message: typecheck error Duplicate definition of type, exception or module 'Counter
)
// Some code...
// So far, I can analyze it correctly.
type AnyDuHasNoValueLabelCase =
| Foo
| Bar of int
// Other some code...
// Not work
Test Code is here.
Originally posted by @SilkyFowl in #1 (comment)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.