Skip to content
68 changes: 30 additions & 38 deletions extensions/ql-vscode/package-lock.json

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

8 changes: 4 additions & 4 deletions extensions/ql-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2080,8 +2080,8 @@
"nanoid": "^5.0.7",
"p-queue": "^8.0.1",
"proper-lockfile": "^4.1.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.2.3",
"react-dom": "^19.2.3",
"semver": "^7.6.2",
"source-map": "^0.7.6",
"source-map-support": "^0.5.21",
Expand Down Expand Up @@ -2135,8 +2135,8 @@
"@types/js-yaml": "^4.0.6",
"@types/node": "22.19.*",
"@types/proper-lockfile": "^4.1.4",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react": "^19.2.3",
"@types/react-dom": "^19.2.3",
"@types/sarif": "^2.1.2",
"@types/semver": "^7.5.8",
"@types/stream-json": "^1.7.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const ModelAlertsResults = ({
[modelAlerts.model],
);

const ref = useRef<HTMLElement>();
const ref = useRef<HTMLElement | undefined>(undefined);

useEffect(() => {
if (
Expand Down
2 changes: 1 addition & 1 deletion extensions/ql-vscode/src/view/model-editor/MethodRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export type MethodRowProps = {
export const MethodRow = (props: MethodRowProps) => {
const { method, methodCanBeModeled, revealedMethodSignature } = props;

const ref = useRef<HTMLElement>();
const ref = useRef<HTMLElement | undefined>(undefined);

useEffect(() => {
if (method.signature === revealedMethodSignature) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface Props {
pathIndex: number;
resultIndex: number;
selectedItem: undefined | ResultKey;
selectedItemRef: React.RefObject<HTMLTableRowElement>;
selectedItemRef: React.RefObject<HTMLTableRowElement | null>;
databaseUri: string;
sourceLocationPrefix: string;
run?: Run;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface Props {
resultIndex: number;
currentPathExpanded: boolean;
selectedItem: undefined | ResultKey;
selectedItemRef: React.RefObject<HTMLTableRowElement>;
selectedItemRef: React.RefObject<HTMLTableRowElement | null>;
databaseUri: string;
sourceLocationPrefix: string;
run?: Run;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export interface Props {
resultIndex: number;
expanded: Set<string>;
selectedItem: undefined | ResultKey;
selectedItemRef: React.RefObject<HTMLTableRowElement>;
selectedItemRef: React.RefObject<HTMLTableRowElement | null>;
databaseUri: string;
sourceLocationPrefix: string;
run?: Run;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import { createMockResults } from "../../../../test/factories/results/mockresult

describe(AlertTablePathRow.name, () => {
const render = (props?: Props) => {
const mockRef = { current: null } as React.RefObject<HTMLTableRowElement>;
const mockRef = {
current: null,
} as React.RefObject<HTMLTableRowElement | null>;
const results = createMockResults();
const threadFlow = results[0]?.codeFlows?.[0]?.threadFlows?.[0];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import { createMockResults } from "../../../../test/factories/results/mockresult

describe(AlertTableResultRow.name, () => {
const render = (props?: Props) => {
const mockRef = { current: null } as React.RefObject<HTMLTableRowElement>;
const mockRef = {
current: null,
} as React.RefObject<HTMLTableRowElement | null>;
const results = createMockResults();

reactRender(
Expand Down
4 changes: 2 additions & 2 deletions extensions/ql-vscode/src/view/results/useScrollIntoView.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { RefObject } from "react";
import { useEffect } from "react";

export function useScrollIntoView<T>(
export function useScrollIntoView<T, E extends HTMLElement = HTMLElement>(
selectedElement: T | undefined,
selectedElementRef: RefObject<HTMLElement>,
selectedElementRef: RefObject<E | null>,
) {
useEffect(() => {
const element = selectedElementRef.current;
Expand Down