Skip to content

Commit

Permalink
[infoview] Port to React
Browse files Browse the repository at this point in the history
This is prerequisite to implement / fix effectively #143 and #216 for
example; the current Info View rendering using strings doesn't scale
anymore to the kind of DOM manipulation we need.

Why React? That was a careful choice for many reasons, in particular
seems like the best fit for our use case (so far); moreover, 3rd party
package support is the best.
  • Loading branch information
ejgallego committed Jan 27, 2023
1 parent 6c85ee5 commit ca44e06
Show file tree
Hide file tree
Showing 13 changed files with 508 additions and 190 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
fixes #224)
- In `_CoqProject`, `-impredicative-set` is now parsed correctly
(@artagnon, #241)
- InfoView is not written in React (@ejgallego, #223)

# coq-lsp 0.1.3: Event
----------------------
Expand Down
2 changes: 1 addition & 1 deletion editor/code/esbuild.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ function viewBuild(file) {
.catch(() => process.exit(1));
}

var infoView = viewBuild("./views/info/index.ts");
var infoView = viewBuild("./views/info/index.tsx");

await Promise.all[(client, infoView)];
8 changes: 5 additions & 3 deletions editor/code/lib/types.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { VersionedTextDocumentIdentifier } from "vscode-languageclient";
import { Position } from "vscode";
import {
VersionedTextDocumentIdentifier,
Position,
} from "vscode-languageserver-types";

export interface Hyp<Pp> {
names: Pp;
names: Pp[];
def?: Pp;
ty: Pp;
}
Expand Down
195 changes: 194 additions & 1 deletion editor/code/package-lock.json

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

11 changes: 9 additions & 2 deletions editor/code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,23 @@
},
"devDependencies": {
"@types/node": "^16.11.7",
"@types/object-hash": "^3.0.2",
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
"@types/throttle-debounce": "^5.0.0",
"@types/vscode-webview": "^1.57.1",
"@types/vscode": "^1.73.0",
"@types/vscode-webview": "^1.57.1",
"esbuild": "^0.16.13",
"prettier": "^2.8.1",
"typescript": "^4.9.4"
},
"dependencies": {
"object-hash": "^3.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"throttle-debounce": "^5.0.0",
"vscode-languageclient": "^8.0.2"
"vscode-languageclient": "^8.0.2",
"vscode-languageserver-types": "^3.17.2"
},
"main": "./out/src/client.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion editor/code/src/goals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class InfoPanel {
<title>Coq's info panel</title>
</head>
<body>
<div id="coq-info-body">
<div id="root">
</div>
</body>
</html>`;
Expand Down
Loading

0 comments on commit ca44e06

Please sign in to comment.