Skip to content

Commit 9b1310d

Browse files
committed
Update source generator content
1 parent b81c1b4 commit 9b1310d

11 files changed

Lines changed: 127 additions & 16 deletions

File tree

TestApp.Generated/Models/Account.model

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ repo {
3535
dbo.Account_GetWithPassword(string email)
3636
=> Account.WithPassword,
3737

38-
dbo.Account_SetResetToken(string email, string resetToken)
38+
dbo.Account_SetResetToken(
39+
string email,
40+
string resetToken)
3941
=> Account.WithReset,
4042

4143
dbo.Account_GetByResetToken(string resetToken)
@@ -44,23 +46,33 @@ repo {
4446
dbo.Account_GetWithRoles(int id)
4547
=> Account.WithRoles,
4648

47-
dbo.Account_ResetPassword(string resetToken, string passwordScheme, string passwordHash, string passwordSalt)
49+
dbo.Account_ResetPassword(
50+
string resetToken,
51+
string passwordScheme,
52+
string passwordHash,
53+
string passwordSalt)
4854
=> Account
4955
}
5056

5157
service {
52-
AttemptLogin(string email, string password)
58+
AttemptLogin(
59+
string email,
60+
string password)
5361
=> Account.WithSession,
5462

5563
LogOut(),
5664

57-
Refresh(string accessToken, string refreshToken)
65+
Refresh(
66+
string accessToken,
67+
string refreshToken)
5868
=> Account.WithSession,
5969

6070
BeginReset(string email),
6171

6272
GetResetDetails(string resetToken)
6373
=> Account,
6474

65-
ResetPassword(string resetToken, string password)
75+
ResetPassword(
76+
string resetToken,
77+
string password)
6678
}

TestApp.Generated/Views/Projects/Drawer.view

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ interface {
77
Toggle()
88
}
99

10-
child({0})
10+
div(| class = {"_Drawer"} |
11+
child({0})
12+
)
1113

1214
div(|
1315
class = {"d-flex flex-row"},

TestApp.Generated/Views/Projects/SourceGeneration/DatalayerColumns.view

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ div(| class = {"d-flex flex-row flex-wrap"} |
1616

1717
c(
1818
pre(| class = {"code-preview"} |
19-
{await inliner.PreLoad(links.GetNamed("Account.model"))}
19+
unsafe({await inliner.PreLoad(links.GetNamed("Account.model"))})
2020
)
2121
)
2222

TestApp.Generated/Views/Projects/SourceGeneration/SourceGenShowcase.view

Lines changed: 58 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,74 @@ Drawer drawer(| startOpen = {page?.Get<string>("openDrawer") == "Source Generati
5050
</">
5151
)
5252

53-
if ({drawer.GetNullable<bool>("open") ?? drawer.Get<bool>("startOpen")}
53+
if({drawer.GetNullable<bool>("open") ?? drawer.Get<bool>("startOpen")}
5454

5555
<>
5656
SourceGenTabs()
57-
p(| class = {"my-4"} |
57+
58+
p(| class = {"mt-4 mb-4"} |
5859
<">
5960
The developer can build large portions of the application codebase from
6061
succinct lines leveraging structured generation patterns.
6162
</">
6263
)
64+
65+
h5(<">Language Server with Visual Studio integration</">)
66+
center(
67+
img(|
68+
src = {"images/sg/language-server.png"},
69+
alt = {"Language server and Visual Studio 2022"},
70+
style = {"max-width: 100%;height: auto;"},
71+
class = {"mt-4 mb-2"}
72+
|)
73+
br()
74+
i(| class = {"mb-5"} |
75+
<">(above: source generation language server running next to Visual Studio 2022)</">
76+
)
77+
)
78+
p(| class = {"mb-5"} |)
79+
80+
h5(<">Syntax highlighting and validation</">)
81+
center(
82+
img(|
83+
src = {"images/sg/vs-view-highlighting.png"},
84+
alt = {"Custom syntax highlighting"},
85+
style = {"max-width: 100%;height: auto;"},
86+
class = {"mt-4 mb-2"}
87+
|)
88+
br()
89+
i(| class = {"mb-5"} |
90+
<">(above: custom syntax highlighting extension with semantic colors)</">
91+
)
92+
)
93+
center(
94+
img(|
95+
src = {"images/sg/syntax-invalid.png"},
96+
alt = {"Rudimentary syntax error messages"},
97+
style = {"max-width: 100%;height: auto;"},
98+
class = {"mt-4 mb-2"}
99+
|)
100+
br()
101+
i(| class = {"mb-5"} |
102+
<">(above: simple validation messages for syntax correctness)</">
103+
)
104+
)
105+
p(| class = {"mb-4"} |)
63106
</>
64107

65-
div(| style = {"height: 4.5rem;overflow: hidden;pointer-events: none;"} |
66-
SourceGenTabs()
108+
div(| style = {"position: relative;"} |
109+
110+
div(|
111+
style = {"position: absolute;z-index: 1;width: 100%;height: 12.5rem;cursor: pointer;"
112+
+ "background: linear-gradient(0deg, rgba(255,255,255,0.2) 0%, rgb(119 119 119 / 15%) 19%, rgba(255,255,255,0) 100%);"},
113+
onclick = {"dispatch(this.closest('._Drawer'), 'Toggle');"},
114+
title = {"Click for more"}
115+
|)
116+
117+
div(| style = {"height: 12.5rem;overflow: hidden;pointer-events: none;"} |
118+
SourceGenTabs()
119+
)
120+
67121
)
68122
)
69123
</>

TestApp.Web/TestApp.Web.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
</ItemGroup>
2020

2121
<ItemGroup>
22+
<None Update="assets\Account.model.html">
23+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
24+
</None>
2225
<None Update="assets\Account.model.txt">
2326
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
2427
</None>

TestApp.Web/appsettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"ImguiFork": "https://github.com/zgoethel/imgui-java",
5151
"Fsa.cs": "https://github.com/jibini-net/SourceGeneration/blob/master/SourceGenerator/Fsa.cs",
5252
"TokenStream.cs": "https://github.com/jibini-net/SourceGeneration/blob/master/SourceGenerator/TokenStream.cs",
53-
"Account.model": "../assets/Account.model.txt",
53+
"Account.model": "../assets/Account.model.html",
5454
"RecursiveDescentDemo.cs": "../assets/RecursiveDescentDemo.cs.txt",
5555
"UpDownDemo.view": "https://raw.githubusercontent.com/jibini-net/SourceGeneration/master/TestApp.Generated/Views/Projects/ThisSite/UpDownDemo.view",
5656
"UpDownDemo.cs": "https://raw.githubusercontent.com/jibini-net/SourceGeneration/master/TestApp/Views/UpDownDemo.cs",

TestApp.Web/assets/Account.model.html

Lines changed: 36 additions & 0 deletions
Large diffs are not rendered by default.
303 KB
Loading
41.7 KB
Loading
191 KB
Loading

0 commit comments

Comments
 (0)