-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v0.0.1 #1
Conversation
- FSharp.Compiler.Service 41.0.3
- Changed to display previews when a function with a LivePreviewAttribute that satisfies the condition exists in editing file. - This enables previewing of multiple variations.
- Change in LiveView expansion method - Updated sample code
- EvalResult: change `IWritable<obj>` to `IWritable<IView>` - Enable AttachDevTools - Change sample script to edge case
PREVIEW → LIVEPREVIEW
- Edit environment variable to control LivePreview startup - Updated sample code
Fix to load required services
- Condition was changed to only "single argument of `unit` function".
WHAT!?
oh... |
I think I saw that error once though I don't remember well. I will try to check. Is the Analyzers SDK used only to update the UI on the fly? Can the UI be updated when the file is saved? That's what Fable does. |
- When there is a pattern that FSharp.Compiler.Service cannot analyze Warning message is output when there is a pattern that FSharp.Compiler.Service cannot analyze. - WIP:Add test cases
Thank you very much.
I can't do it at the moment, but I think it could be achieved by using FileSystemWatcher or by monitoring file update times. I hope to achieve this at some point. |
Since this bug is related to code analysis, it should not be a problem if the DU is precompiled. In other words, if I don't write the DU in the code I want to Preview, I should be able to work around it. |
What specific construct is being used that is triggering that error? |
@dsyme Thanks for your comments, I see great potential in Analyzer.SDK and the draft of Modernizing F# Analysis (dotnet/fsharp#11057) that would follow in its footsteps. We have not fully verified this yet, so this is current result. Work // Some code...
type AnyDuHasNoValueLabelCase =
| Foo
| Bar of int
Not Work // Some code...
// So far, I can analyze it correctly.
type AnyDuHasNoValueLabelCase =
| Foo
| Bar of int
// Other some code...
// Not work
Test Code is here. Avalonia.FuncUI.LiveView/tests/Avalonia.FuncUI.LiveView.Core.Tests/FuncUIAnalysisTests.fs Lines 231 to 360 in f991cb3
|
- Since adding more cases by hand is the source of bugs like this one, I would like to change to an implementation using reflection at some point.
- change to an implementation using reflection.
- add FUNCUI_LIVEPREVIEW on linux.
If it''s considered v0.0.1, it looks good? livepreview.mp4 |
How to use(memo) {
"FSharp.enableAnalyzers": true,
"FSharp.analyzersPath": [
- "packages/Analyzers",
+ "packages/analyzers",
"analyzers"
]
}
--- a/./src/LivePreviewApp/Counter.fs
+++ b/./src/LivePreviewApp/Counter.fs
@@ -1,14 +1,18 @@
-namespace LivePreviewApp
+namespace LivePreviewApp
module Counter =
open Avalonia.Controls
open Avalonia.FuncUI
open Avalonia.FuncUI.DSL
+ open Avalonia.FuncUI.LiveView.Core.Types
open Avalonia.Layout
- let view =
- Component(fun ctx ->
- let state = ctx.useState 0
+ let counter name num =
+ Component.create(
+ name,
+ fun ctx ->
+ let state = ctx.usePassed num
+
DockPanel.create [
DockPanel.verticalAlignment VerticalAlignment.Center
DockPanel.horizontalAlignment HorizontalAlignment.Center
@@ -46,3 +50,16 @@ module Counter =
]
]
)
+
+ [<LivePreview>]
+ let preview()=
+ let state = new State<_> 0
+ counter "counter" state
+
+ let view =
+ Component(fun ctx ->
+ let state = ctx.useState 0
+ counter "counter" state
+ )
+
+ |
- Add Launch LivePreview Infp
@alfonsogarciacaro @dsyme |
No description provided.