Repository navigation
Refactor: readability and performance improvements across the codebase - #33
Merged
Merged
Conversation
Agent-Logs-Url: https://github.com/DaanV2/vscode-go-asm/sessions/c76598ff-acae-4b85-bada-0ccd0e8232d7 Co-authored-by: DaanV2 <2393905+DaanV2@users.noreply.github.com>
DaanV2
approved these changes
Apr 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Broad readability and performance pass — removes dead code, eliminates duplication, fixes a latent crash, and improves O(n²) hot paths.
Performance
commands/commands.ts: replacedstdout += data.toString()accumulation (O(n²)) withBufferchunk arrays +Buffer.concat()at close (O(n)) — matters for large assembly outputDead code & duplication
view/webview.ts: removed the never-calledhighlightLine()function; extracted its 5 regex replacements into a sharedsyntaxHighlight()helper called fromcreateAssemblyLine()env/goenv.ts: added a privateselectEnvVar()helper to collapse 5 identical QuickPick methods (~75 lines → ~15 lines):Bug fix
assembly/info.ts: bounds guard added to the leading-commentwhileloop — input with no trailing newline (e.g."# comment") previously crashed withCannot read properties of undefinedMinor clarity fixes
assembly/content.ts: replaced mutation-inside-filter-predicate anti-pattern withflatMapassembly/info.ts: renamedl→line; removed redundant.trim()on already-trimmed headersdocuments/tracker.ts: fixed "unsubscripe" typo; addedvoidto intentional fire-and-forgetPromise.allSettled()extension.ts: corrected misleading log message ononDidSaveTextDocument("show assembly"→"file saved, checking for assembly updates")go/symbols.ts:/[\(\)\*]/gim→/[()*]/g— removed unnecessary escaping and inapplicablei/mflagsview/webview.ts: removedmflag from single-line comment regex insyntaxHighlight()