Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Support env variables in project configurations

Aperta
#562 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
dart, flutter, lua, neovim
Ambito
devtools

Direzione di ricerca

Start by tracing how setup_project configurations reach FlutterRun, then inspect the job runner's plenary Job environment and the debugger launch config environment. Add an optional per-configuration env field that merges with Neovim's environment for run and debug processes only. Done means those processes receive the selected configuration's values while other jobs, such as pub get and devices, remain unchanged.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Today there is no way to set environment variables for the flutter run command per project configuration. The process started by FlutterRun inherits Neovim's environment, so env vars have to be exported in the shell before starting Neovim, or set with vim.env in pre_run_callback. The vim.env approach leaks the value into the whole Neovim session and is not undone when switching to another configuration.

Other editors support this per run configuration (IntelliJ "Environment variables", VS Code launch.json "env").

Proposal: add an optional env field to setup_project configurations:

require("flutter-tools").setup_project({
  {
    name = "Dev",
    flavor = "dev",
    env = { API_KEY = "abc", LOG_LEVEL = "debug" },
  },
})

The values would be merged on top of Neovim's environment and only applied to the run/debug process of that configuration: the job runner (plenary Job env) and the debugger runner (launch config env). Other jobs like pub get or devices stay unchanged, which keeps the scope small (see #89).

Happy to open a PR if this sounds good.

Lingua principale
Lua
Stelle
1.4k
Fork
117
Merge medio
9h 54m
PR unite (30g)
22

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nvim-flutter/flutter-tools.nvim

Tutte le issue di nvim-flutter/flutter-tools.nvim

Issue simili

Altre issue su Lua

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.