Skip to content

Commit

Permalink
license etc
Browse files Browse the repository at this point in the history
  • Loading branch information
guyutongxue committed Jan 30, 2024
1 parent 27572b3 commit 6459aa1
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 4 deletions.
19 changes: 19 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2024 Guyutongxue

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This repo contains a build script for clangd on WebAssembly (TBD), and an exampl

## How to build

I'm working on the build instruction, but you can take a look at `build.sh`.
You can take a look at `build.sh` for how to build clangd to WASM. Once `clangd.wasm` generated at `public/wasm`, you can build those frontend code using `pnpm install` and `pnpm build`.

## About the example page

Expand Down
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
<div id="buildPanelBody">
<div id="buildPanelHeader">
<button class="success" id="run">
<i class="icon icon-run"></i>Run code
<i class="icon icon-run"></i>
Run code
</button>
<div class="button-group" id="buildPanelTab">
<button>Input</button>
Expand Down
4 changes: 4 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ body {
overflow: auto;
user-select: text;
}

hr {
border-color: var(--c-bg-lighter);
}
}

.spacer {
Expand Down
8 changes: 6 additions & 2 deletions src/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@ function showInput() {
outputEl.classList.add("display-none");
}
const EMPTY_HINT_HTML = `<span style="user-select: none; color: var(--c-text-light)">No output.</span>`;
const RESULT_COPY_HTML = `
<hr><span style="user-select: none; color: var(--c-text-light)">Compilation provided by <a href="https://godbolt.org" target="_blank">Compiler Explorer</a></span>`;
function showOutput(text: string) {
if (text === "") {
text = EMPTY_HINT_HTML;
}
outputEl.innerHTML = text;
outputEl.innerHTML = text + RESULT_COPY_HTML;
outputEl.classList.remove("display-none");
inputEl.classList.add("display-none");
}
Expand Down Expand Up @@ -135,7 +137,9 @@ function toggleTheme() {
}
toggleThemeBtn.addEventListener("click", toggleTheme);

export function setClangdStatus(status: "ready" | "indeterminate" | "disabled"): void;
export function setClangdStatus(
status: "ready" | "indeterminate" | "disabled"
): void;
export function setClangdStatus(value: number, max: number): void;
export function setClangdStatus(strOrVal: string | number, max?: number) {
if (typeof strOrVal === "number") {
Expand Down

0 comments on commit 6459aa1

Please sign in to comment.