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

Convert CharPos to number in renderInterpreter. #116

Merged
merged 2 commits into from
Sep 27, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ let FrameView = ({
frame: MFrame<CharRange>;
}) => {
let code = useContext(CodeContext);
let snippet = codeRange(code, frame.location);
let snippet = codeRange(code!, frame.location);
return (
<div className="frame">
<Header className="frame-header">{frame.name}</Header>
Expand Down Expand Up @@ -820,8 +820,8 @@ export function renderInterpreter(
widgetRanges = sortedMarks;
trace.steps = filteredSteps;
} else {
widgetRanges = trace.steps.map(
step => _.last(step.stack.frames)!.location.end
widgetRanges = trace.steps.map(step =>
linecolToPosition(_.last(step.stack.frames)!.location.end, view.state.doc)
);
}

Expand Down
2 changes: 2 additions & 0 deletions frontend/packages/aquascope-embed/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"@codemirror/view": "^6.4.0",
"@floating-ui/react-dom": "^1.3.0",
"@lezer/highlight": "^1.1.3",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.2.0",
"@vitejs/plugin-react": "^4.0.3",
"aquascope-editor": "workspace:*",
"puppeteer": "^19.6.0",
Expand Down
2 changes: 1 addition & 1 deletion frontend/packages/aquascope-embed/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ let BugReporter = () => (
<ContextProvider title={"Report a bug"} buttonText={"🐞"}>
{close => {
let code = useContext(CodeContext);
let onSubmit: React.FormEventHandler<HTMLFormElement> = event => {
let onSubmit: React.FormEventHandler<HTMLFormElement> = (event: any) => {
let data = new FormData(event.target as any);
let feedback = data.get("feedback")!.toString();
window.telemetry!.log("aquascopeBug", { code, feedback });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { afterAll, beforeAll, beforeEach, describe, expect, it } from "vitest";

const permStackSelector = ".permission-stack";
const permStepSelector = ".step-widget-container";
const interpSelector = ".interpreter";
const _interpSelector = ".interpreter";

describe("Aquascope Standalone", () => {
let browser: Browser;
Expand Down
54 changes: 15 additions & 39 deletions frontend/pnpm-lock.yaml

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

5 changes: 3 additions & 2 deletions frontend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"declaration": true,
"jsx": "react",
"esModuleInterop": true,
"allowJs": true
"allowJs": true,
"strict": true
}
}
}
Loading