Skip to content

Refactors picker usage to decouple PlatformIO command logic from UI implementation.#70

Merged
anurag3301 merged 9 commits into
mainfrom
telescope-detach
May 12, 2026
Merged

Refactors picker usage to decouple PlatformIO command logic from UI implementation.#70
anurag3301 merged 9 commits into
mainfrom
telescope-detach

Conversation

@anurag3301
Copy link
Copy Markdown
Owner

This PR creates ability to add more picker as asked in #43 and #62

  • Introduced a shared picker interface under lua/platformio/pickers/ with backend selection via picker_backend (auto | telescope | ui_select).
  • Added backend modules:
    • pickers/telescope.lua
    • pickers/ui_select.lua
  • Refactored :Pioinit to separate:
    • board/framework data + init flow logic
    • picker UI rendering
  • Refactored :Piolib to separate:
    • API fetch + install flow logic
    • picker UI rendering
  • Refactored :PioTermList:
    • moved command logic to lua/platformio/piotermlist.lua
    • routed terminal selection through picker abstraction
    • removed inline Telescope setup from command path
  • Added help docs for picker config:
    • :help platformio-picker in doc/platformio.txt

Why

  • Makes picker engine swappable without changing command logic.
  • Enables adding new picker backends with the same API.
  • Reduces coupling and side effects (especially around Telescope config in runtime commands).

Config

  require('platformio').setup({
    picker_backend = 'auto', -- auto | telescope | ui_select
  })

Notes

  • auto prefers Telescope and falls back to vim.ui.select.
  • Existing command behavior is preserved; only picker/UI plumbing was reorganized.

@anurag3301 anurag3301 merged commit e65fd65 into main May 12, 2026
1 check passed
@anurag3301 anurag3301 deleted the telescope-detach branch May 12, 2026 06:27
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