Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
- run: npm install -g vsce
- run: npm install
- run: npm run build
- run: npm run test
- run: vsce package

- name: Save Artifact
Expand Down
2 changes: 1 addition & 1 deletion media/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ html, body
font-size: 14px;
line-height: 1.5;
height: 100%;
background-color: transparent;
/* background-color: transparent; */
}

.aside
Expand Down
25 changes: 17 additions & 8 deletions media/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// This script will be run within the webview itself
// It cannot access the main VS Code APIs directly.
import * as E from 'shared/elaborator/index.mjs';
(function () {
const vscode = acquireVsCodeApi();

Expand All @@ -9,8 +10,16 @@
switch (message.type) {
case 'trace':
clear();
trace(message.trace);
$("#trace-information").val(message.file + ' on ' + new Date().toISOString());
try {
trace(E.elaborate(message.source))
$("#trace-information").val(message.file + ' on ' + new Date().toISOString());
} catch (e) {
console.error('Error while elaborating trace', e)
vscode.postMessage({
command: 'notify',
value: `The trace file appears to be broken: ${e}`
})
}
break;
case 'clear':
clear();
Expand Down Expand Up @@ -972,15 +981,15 @@ ${step.value.findall_solution_text}
rule_text_full = rule_text
}

if (rule_type == "BuiltinRule")
if (element.value.name) {// v2
rule_text = element.value.kind.kind + ' - ' + element.value.name + ': ' + element.value.payload.join('\n');
rule_text_full = element.value.payload.join('\n');
if (rule_type == "BuiltinRule") {
rule_text = element.value.kind.kind + ' - ' + element.value.name;
if (element.value.payload.length !== 0) {// v2
rule_text_full = element.value.payload.join('\n')
rule_text += ': ' + rule_text_full;
} else { //v1
rule_text = element.value.kind + ' - ' + element.value.value;
rule_text_full = rule_text
}
// rule_text = rule_text.trim();
}

let fmt = `
<div class="panel-element">
Expand Down
878 changes: 878 additions & 0 deletions media/vscodeStub.css

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions media/vscodeStub.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
window.acquireVsCodeApi = () => ({
postMessage: (...args) => {
console.log('"Handling" message', ...args)
}
})
74 changes: 48 additions & 26 deletions package-lock.json

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

23 changes: 16 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"license": "MIT",
"engines": {
"vscode": "^1.50.0"
"vscode": "^1.101.0"
},
"extensionKind": [
"ui",
Expand All @@ -29,7 +29,7 @@
"onCommand:elpi.trace",
"onCommand:elpi.clear"
],
"main": "./out/extension.js",
"main": "./out/extension/extension.js",
"contributes": {
"commands": [
{
Expand Down Expand Up @@ -147,21 +147,30 @@
},
"scripts": {
"build": "mustache elpiLexicalConventions.js syntaxes/elpi.tmLanguage.mustache > syntaxes/elpi.tmLanguage.json",
"build:web": "npm run compile:ssg && npm run run:ssg",
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"compile": "tsc -b ./src/extension",
"compile:tests": "tsc -b ./src/tests",
"compile:ssg": "tsc -b ./src/ssg",
"lint": "eslint . --ext .ts,.tsx",
"watch": "tsc -w -p ./",
"watch": "npm run compile -- -w",
"watch:tests": "npm run compile:tests -- -w",
"run:test": "node --test './out/**/*.test.mjs'",
"run:promote": "node --test-update-snapshots --test './**/*.test.mjs'",
"run:ssg": "node ./out/ssg/ssg.mjs",
"test": "npm run compile:tests && npm run run:test",
"promote": "npm run compile:tests && npm run run:promote",
"deploy": "vsce publish"
},
"devDependencies": {
"@types/node": "^17.0.35",
"@types/vscode": "^1.50.0",
"@types/node": "^22",
"@types/vscode": "~1.101",
"@typescript-eslint/eslint-plugin": "^5.19.0",
"@typescript-eslint/parser": "^5.19.0",
"@vscode/vsce": "^2.19.0",
"eslint": "^8.13.0",
"mustache": "^4.0.1",
"typescript": "^4.6.3"
"typescript": "^5.3"
},
"dependencies": {
"@creativebulma/bulma-collapsible": "^1.0.4",
Expand Down
File renamed without changes.
Loading
Loading