From 2d105003165ef08ddd59d937cd05432161a1521f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix?= <142559040+kapitche@users.noreply.github.com> Date: Sun, 13 Oct 2024 01:28:49 -0400 Subject: [PATCH] fixed dummy keywods to mnemonics only --- package.json | 2 +- src/extension.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 0dc4001..e747ace 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "x86-assembly-syntax", "displayName": "Universal Assembly Syntax Highlighting", "description": "Syntax highlighting extension for x86, x64 and ARM assembly both for Intel and AT&T syntax", - "version": "1.0.7", + "version": "1.0.8", "engines": { "vscode": "^1.60.0" }, diff --git a/src/extension.js b/src/extension.js index 0e19564..50c7f5e 100644 --- a/src/extension.js +++ b/src/extension.js @@ -18,11 +18,12 @@ function activate(context) { return new vscode.Hover(instructionInfo); } } else { - return new vscode.Hover(`Unrecognized mnemonic: ${word}`); + // Only show hover for recognized mnemonics + return undefined; // Return undefined if not a valid mnemonic } } - return undefined; + return undefined; // Return undefined if no word found } }); @@ -82,7 +83,7 @@ async function fetchInstructionInfo(instruction) { async function findDefinition(word) { // Get all x86 assembly files in the workspace - const files = await vscode.workspace.findFiles('**/*.s', '**/node_modules/**'); + const files = await vscode.workspace.findFiles('**/*.s', '**/*.asm', '**/*.nasm', '**/*.S', "**/*.asmx", "**/*.inc"); for (const file of files) { const document = await vscode.workspace.openTextDocument(file);