Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ANSI escape sequence in trace explorer web view. #321

Merged
merged 5 commits into from
Jan 8, 2024
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '14.17'
node-version: '18.19'
- name: Install dependencies
run: |
npm install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '14.17'
node-version: '18.19'
- name: Get current version
id: version
run: echo "::set-output name=version::$(jq -r .version package.json)"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '14.17'
node-version: '18.19'
- name: Get (nightly) TLC
run: wget https://nightly.tlapl.us/dist/tla2tools.jar -O tools/tla2tools.jar
- name: Get (nightly) CommunityModules
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '14.17'
node-version: '18.19'
- name: Get current version
id: version
run: echo "::set-output name=version::$(jq -r .version package.json)"
Expand Down
33 changes: 29 additions & 4 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@
"@typescript-eslint/eslint-plugin": "^5.59.5",
"@typescript-eslint/parser": "^5.59.5",
"@vscode/debugadapter-testsupport": "^1.63.0",
"@vscode/test-electron": "^2.3.2",
"@vscode/test-electron": "^2.3.8",
"esbuild": "^0.17.19",
"eslint": "^8.40.0",
"glob": "^8.1.0",
Expand All @@ -515,6 +515,7 @@
"moment": "^2.29.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"@cocalc/ansi-to-react": "^7.0.0",
"vscode-uri": "^3.0.7"
}
}
2 changes: 1 addition & 1 deletion src/panels/checkResultView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class CheckResultViewPanel {
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src ${webview.cspSource}; font-src ${webview.cspSource}; script-src 'nonce-${nonce}';">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline' ${webview.cspSource}; font-src ${webview.cspSource}; script-src 'nonce-${nonce}';">
<link rel="stylesheet" href="${styleUri}">
<title>Model checking</title>
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { CollectionValue } from '../../../model/check';
import { VSCodeTreeItem } from '../tree';
import { vscode } from '../vscode';
import { ErrorTraceSettings } from './errorTrace';
import Ansi from '@cocalc/ansi-to-react';

interface ErrorTraceVariableI {value: CollectionValue, stateId: number, settings: ErrorTraceSettings}
export const ErrorTraceVariable = React.memo(({value, stateId, settings}: ErrorTraceVariableI) => {
Expand Down Expand Up @@ -42,7 +43,7 @@ export const ErrorTraceVariable = React.memo(({value, stateId, settings}: ErrorT
</div>

<div className={'var-value ' + changeTypeClass} title={changeHints[value.changeType]}>
{value.str}
<Ansi>{value.str}</Ansi>
</div>

<div className="var-menu">
Expand Down
5 changes: 5 additions & 0 deletions src/webview/checkResultView/errorTraceSection/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,8 @@
.value-M {
text-decoration: underline dotted var(--vscode-gitDecoration-modifiedResourceForeground);
}

code {
color: inherit; /* Reset the text color */
background: inherit; /* Remove the gray-ish background */
}
Loading