Skip to content

Commit

Permalink
use static urls for progress svgs, attempt 2; v1.0.19
Browse files Browse the repository at this point in the history
  • Loading branch information
joneugster committed Aug 8, 2024
1 parent ec2743a commit 4846bcf
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion demo/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions demo/server/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ wss.addListener("connection", function(ws, req) {
const socketConnection = jsonrpcserver.createConnection(reader, writer, () => ws.close())
const serverConnection = jsonrpcserver.createProcessStreamConnection(ps)
socketConnection.forward(serverConnection, message => {
console.log(`CLIENT: ${JSON.stringify(message)}`)
// console.log(`CLIENT: ${JSON.stringify(message)}`)
return message;
})
serverConnection.forward(socketConnection, message => {
console.log(`SERVER: ${JSON.stringify(message)}`)
// console.log(`SERVER: ${JSON.stringify(message)}`)
return message;
});

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lean4monaco",
"version": "1.0.18",
"version": "1.0.19",
"description": "Monaco Editor support for the Lean 4 theorem prover.",
"keywords": [
"lean",
Expand Down
12 changes: 11 additions & 1 deletion src/leanmonaco.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,17 @@ export type LeanMonacoOptions = {
checkLean4ProjectPreconditions
)

this.taskGutter = new LeanTaskGutter(this.clientProvider, {asAbsolutePath: (path: string) => Uri.parse(`${new URL('vscode-lean4/vscode-lean4/' + path, import.meta.url)}`),} as any)
const asAbsolutePath = (path: string) => {
switch (path) {
// url.pathToFileURL
case "media/progress-light.svg": return Uri.parse(`${new URL('./vscode-lean4/vscode-lean4/media/progress-light.svg', import.meta.url)}`)
case "media/progress-dark.svg": return Uri.parse(`${new URL('./vscode-lean4/vscode-lean4/media/progress-dark.svg', import.meta.url)}`)
case "media/progress-error-light.svg": return Uri.parse(`${new URL('./vscode-lean4/vscode-lean4/media/progress-error-light.svg', import.meta.url)}`)
case "media/progress-error-dark.svg": return Uri.parse(`${new URL('./vscode-lean4/vscode-lean4/media/progress-error-dark.svg', import.meta.url)}`)
}
}

this.taskGutter = new LeanTaskGutter(this.clientProvider, {asAbsolutePath: asAbsolutePath} as any)

const fontFile = new FontFace(
"JuliaMono",
Expand Down

0 comments on commit 4846bcf

Please sign in to comment.