-
-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: support migration between v1 and v2 * docs: update for version 2 * fix: bug in Windows line end parsing affecting CSS * feat: add a -w parameter to choose how many cores to use during templ generation * feat: use the number of CPUs available to the machine * feat: improve the formatting behaviour * feat: add style and script elements that ignore the contents * refactor: migrate to go.lsp.dev/protocol * feat: migrate the LSP server and rewrite functionality to go.lsp.dev * feat: add sourcemap visualisation * security: CVE-2022-28948 * chore: upgrade goquery to 1.8.0 * chore: move example to _example to get Go tools to ignore from the top level * feat: add LSO declaration and definition support * feat: update LSP edits, replace SourceGraph code * refactor: use an array of lines to store content, instead of storing the string, to make updates less expensive * fix: update snippets for new syntax * docs: add updated GIF * fix: DidChange storage of updates
- Loading branch information
Showing
155 changed files
with
10,371 additions
and
1,701 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package generatecmd | ||
|
||
css row() { | ||
display: flex; | ||
} | ||
|
||
css column() { | ||
flex: 50%; | ||
} | ||
|
||
css code() { | ||
font-family: monospace; | ||
} | ||
|
||
templ visualisation(templFileName string, left, right templ.Component) { | ||
<html> | ||
<head> | ||
<title>{ templFileName } - Source Map Visualisation</title> | ||
<style type="text/css"> | ||
.mapped { background-color: green } | ||
.highlighted { background-color: yellow } | ||
</style> | ||
</head> | ||
<body> | ||
<h1>{ templFileName }</h1> | ||
|
||
<div class={ templ.Classes(row()) }> | ||
<div class={ templ.Classes(column(), code()) }> | ||
{! left } | ||
</div> | ||
<div class={ templ.Classes(column(), code()) }> | ||
{! right } | ||
</div> | ||
</div> | ||
</body> | ||
</html> | ||
} | ||
|
||
script highlight(sourceId, targetId string) { | ||
let items = document.getElementsByClassName(sourceId); | ||
for(let i = 0; i < items.length; i ++) { | ||
items[i].classList.add("highlighted"); | ||
} | ||
items = document.getElementsByClassName(targetId); | ||
for(let i = 0; i < items.length; i ++) { | ||
items[i].classList.add("highlighted"); | ||
} | ||
} | ||
|
||
script removeHighlight(sourceId, targetId string) { | ||
let items = document.getElementsByClassName(sourceId); | ||
for(let i = 0; i < items.length; i ++) { | ||
items[i].classList.remove("highlighted"); | ||
} | ||
items = document.getElementsByClassName(targetId); | ||
for(let i = 0; i < items.length; i ++) { | ||
items[i].classList.remove("highlighted"); | ||
} | ||
} | ||
|
||
templ mappedCharacter(s string, sourceID, targetID string) { | ||
<span class={ templ.Classes(templ.Class("mapped"), templ.Class(sourceID), templ.Class(targetID)) } onMouseOver={ highlight(sourceID, targetID) } onMouseOut={ removeHighlight(sourceID, targetID) }>{ s }</span> | ||
} |
Oops, something went wrong.