Add "Import All Lambdas (no prefix)" command#225
Merged
Conversation
Adds a sibling palette entry that bulk-imports every lambda from every configured library with bare names, alongside the existing prefix-applying "Import All Lambdas". ImportAllLambdasCommand.Run now takes an applyPrefix flag (default true); when false it passes an empty prefix to the loaders, which yields bare names with no function-reference rewriting (PrefixRewriter.Apply / LoadWithPrefix), and stamps the cell comment with the empty prefix to match. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Summary
Adds a second command-palette entry, "Import All Lambdas (no prefix)", that bulk-imports every lambda from every configured library with bare names — alongside the existing "Import All Lambdas", which continues to apply each library's
default_prefix.Requested by Tim: an option to import all libraries without prefixes, surfaced smoothly in the popup. The command-palette idiom (a sibling entry) was chosen for discoverability and zero extra keystrokes.
Changes
ImportAllLambdasCommand.Runnow takes anapplyPrefixflag (defaulttrue). Whenfalse, it passes an empty prefix to the loaders — which yields bare names with no function-reference rewriting (PrefixRewriter.Apply/FetchedLibrary.LoadWithPrefix) — and stamps the cell comment with the empty prefix to match.SlashCommandentry "Import All Lambdas (no prefix)" wired toRun(applyPrefix: false).Behaviour note
With no prefix, if two libraries define a lambda with the same bare name (e.g. both expose
SUM), the later import overwrites the earlier in the Name Manager. This is inherent to flattening and matches existing single-library no-prefix loads; the summary's "updated" count reflects it.Testing
dotnet build addin/lambda-boss.slnx— succeeds.dotnet test addin/lambda-boss.Tests— 1002 passed, 0 failed.LoadLibraryAsync_EmptyPrefix_ReturnsBarenames.🤖 Generated with Claude Code