Update to objdiff 3.5.1

This commit is contained in:
Luke Street
2025-12-23 12:54:33 -07:00
parent ce70580816
commit 102fab23fa
4 changed files with 39 additions and 15 deletions
+3 -3
View File
@@ -3,7 +3,7 @@
"displayName": "objdiff",
"description": "A local diffing tool for decompilation projects",
"publisher": "decomp-dev",
"version": "3.4.4",
"version": "3.5.1",
"repository": {
"type": "git",
"url": "https://github.com/encounter/objdiff-web"
@@ -24,7 +24,7 @@
"@vscode/codicons": "^0.0.36",
"clsx": "^2.1.1",
"memoize-one": "^6.0.0",
"objdiff-wasm": "=3.4.4",
"objdiff-wasm": "=3.5.1",
"picomatch": "^4.0.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
@@ -65,7 +65,7 @@
"node": ">=20.0.0",
"vscode": "^1.96.0"
},
"packageManager": "pnpm@10.6.1",
"packageManager": "pnpm@10.26.2",
"browserslist": [
"chrome 128"
],
+5 -5
View File
@@ -18,8 +18,8 @@ importers:
specifier: ^6.0.0
version: 6.0.0
objdiff-wasm:
specifier: '=3.4.4'
version: 3.4.4
specifier: '=3.5.1'
version: 3.5.1
picomatch:
specifier: ^4.0.2
version: 4.0.2
@@ -1613,8 +1613,8 @@ packages:
nth-check@2.1.1:
resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==}
objdiff-wasm@3.4.4:
resolution: {integrity: sha512-v1/HVA36yQcPlIuAg/H0GAW1fHixba5m5CL9i/baxIjbJY/Ob3SCUtJlDDqalybT9JCl1AlfPM4un9gndAX+4w==}
objdiff-wasm@3.5.1:
resolution: {integrity: sha512-2KSWQeaKMs1hbjEcLtRavNsKhoNM1xa1ChaOC1RAFyUPDPRUqr+g5r34ANK47/c4roJbU3MKIS0fH+VITBorzA==}
object-inspect@1.13.4:
resolution: {integrity: sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==}
@@ -3795,7 +3795,7 @@ snapshots:
dependencies:
boolbase: 1.0.0
objdiff-wasm@3.4.4: {}
objdiff-wasm@3.5.1: {}
object-inspect@1.13.4: {}
+6 -4
View File
@@ -189,10 +189,12 @@ export function renderContextItems(
key={key}
className={styles.contextMenuItem}
onClick={() => {
navigator.clipboard.writeText(item.val.value).then(
() => close(),
(e) => console.warn('Failed to copy:', e),
);
navigator.clipboard
.writeText(item.val.copyString || item.val.value)
.then(
() => close(),
(e) => console.warn('Failed to copy:', e),
);
}}
>
<span className={styles.contextMenuItemLabel}>Copy "</span>
+25 -3
View File
@@ -2,7 +2,7 @@ import styles from './FunctionView.module.css';
import clsx from 'clsx';
import { type diff, display } from 'objdiff-wasm';
import { memo, useCallback, useMemo } from 'react';
import { memo, useCallback, useMemo, useRef } from 'react';
import { FixedSizeList, areEqual } from 'react-window';
import type { ListChildComponentProps, ListOnScrollProps } from 'react-window';
import { useShallow } from 'zustand/react/shallow';
@@ -52,6 +52,7 @@ const AsmCell = ({
column,
highlight: highlightState,
setHighlight,
listRef,
}: {
obj: diff.ObjectDiff | undefined;
config: diff.DiffConfig;
@@ -60,6 +61,7 @@ const AsmCell = ({
column: number;
highlight: HighlightState;
setHighlight: (highlight: HighlightState) => void;
listRef: React.RefObject<FixedSizeList<ItemData>>;
}) => {
const onContextMenu = useInstructionContextMenu();
const tooltipContent: InstructionTooltipContent = useMemo(
@@ -152,6 +154,10 @@ const AsmCell = ({
text = t.val.toString(16);
isToken = true;
break;
case 'branch-arrow':
text = ' ~> ';
isToken = true;
break;
case 'symbol':
text = t.val.demangledName || t.val.name;
isToken = true;
@@ -180,7 +186,9 @@ const AsmCell = ({
[styles.highlighted]: highlightMatches(highlight, t),
})}
onClick={(e) => {
if (isToken) {
if (t.tag === 'branch-arrow') {
listRef.current?.scrollToItem(t.val, 'center');
} else if (isToken) {
setHighlight(updateHighlight(highlightState, t, column));
e.stopPropagation();
}
@@ -234,13 +242,22 @@ type ItemData = {
rightSymbol: display.SymbolDisplay | null;
highlight: HighlightState;
setHighlight: (highlight: HighlightState) => void;
listRef: React.RefObject<FixedSizeList<ItemData>>;
};
const AsmRow = memo(
({
index,
style,
data: { result, config, leftSymbol, rightSymbol, highlight, setHighlight },
data: {
result,
config,
leftSymbol,
rightSymbol,
highlight,
setHighlight,
listRef,
},
}: ListChildComponentProps<ItemData>) => {
return (
<div
@@ -265,6 +282,7 @@ const AsmRow = memo(
column={0}
highlight={highlight}
setHighlight={setHighlight}
listRef={listRef}
/>
<AsmCell
obj={result.right}
@@ -274,6 +292,7 @@ const AsmRow = memo(
column={1}
highlight={highlight}
setHighlight={setHighlight}
listRef={listRef}
/>
</div>
);
@@ -294,6 +313,7 @@ export const InstructionList = ({
leftSymbol: display.SymbolDisplay | null;
rightSymbol: display.SymbolDisplay | null;
}) => {
const listRef = useRef<FixedSizeList<ItemData>>(null);
const { configProperties, currentUnit } = useExtensionStore(
useShallow((state) => ({
configProperties: state.configProperties,
@@ -325,6 +345,7 @@ export const InstructionList = ({
rightSymbol,
highlight,
setHighlight,
listRef,
};
}, [
diff,
@@ -355,6 +376,7 @@ export const InstructionList = ({
);
return (
<FixedSizeList
ref={listRef}
height={height}
itemCount={itemData.itemCount}
itemSize={itemSize}