Skip to content
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
3 changes: 0 additions & 3 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,16 @@ html, body, #root {

.class-token-decoration-pointer {
color: var(--token-class) !important;
cursor: pointer;
}

.field-token-decoration-pointer,
.parameter-token-decoration-pointer,
.local-token-decoration-pointer {
color: var(--token-field) !important;
cursor: pointer;
}

.method-token-decoration-pointer {
color: var(--token-method) !important;
cursor: pointer;
}

/* Control comment marker and content color, eg "/*" */
Expand Down
2 changes: 1 addition & 1 deletion src/ui/CodeHoverProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export function createHoverProvider(
) {
return {
provideHover(model: editor.ITextModel, position: IPosition) {
const token = findTokenAtPosition(editorRef.current!, decompileResultRef.current, classListRef.current, false);
const token = findTokenAtPosition(editorRef.current!, decompileResultRef.current, classListRef.current, position, false);

// Check for tokens first (classes, methods, fields, etc.)
if (token) {
Expand Down
8 changes: 6 additions & 2 deletions src/ui/CodeUtils.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
import { editor } from "monaco-editor";
import { editor, type IPosition } from "monaco-editor";
import { type Token } from '../logic/Tokens';
import { toClassFilePath, type ClassFilePath } from "../utils/Names";

export function findTokenAtPosition(
editor: editor.ICodeEditor,
decompileResult: { tokens: Token[]; } | undefined,
classList: ClassFilePath[] | undefined,
position: IPosition | undefined | null = undefined,
useClassList = true
): Token | null {
const model = editor.getModel();
if (!model || !decompileResult || (useClassList && !classList)) {
return null;
}

const position = editor.getPosition();
if (!position) {
position = editor.getPosition();
}

if (!position) {
return null;
}
Expand Down
Loading