Skip to content

Add "Import All Lambdas (no prefix)" command#225

Merged
jimmytacks merged 1 commit into
mainfrom
import-all-no-prefix
Jun 3, 2026
Merged

Add "Import All Lambdas (no prefix)" command#225
jimmytacks merged 1 commit into
mainfrom
import-all-no-prefix

Conversation

@jimmytacks
Copy link
Copy Markdown
Collaborator

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.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 / FetchedLibrary.LoadWithPrefix) — and stamps the cell comment with the empty prefix to match.
  • New SlashCommand entry "Import All Lambdas (no prefix)" wired to Run(applyPrefix: false).
  • Clarified the existing command's description to "…using each library's default prefix".

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.
  • Empty-prefix → bare-name behaviour is already covered by LoadLibraryAsync_EmptyPrefix_ReturnsBarenames.

🤖 Generated with Claude Code

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>
@jimmytacks jimmytacks merged commit 1def1c2 into main Jun 3, 2026
1 check passed
@jimmytacks jimmytacks deleted the import-all-no-prefix branch June 3, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant