Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Support env variables in project configurations

Đang mở
#562 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
72/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
dart, flutter, lua, neovim
Lĩnh vực
devtools

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Lua
Star
1.4k
Fork
117
Merge trung bình
9 giờ 54 phút
Pull request đã merge (30 ngày)
22

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của nvim-flutter/flutter-tools.nvim

Tất cả issue của nvim-flutter/flutter-tools.nvim

Issue tương tự

Thêm issue về Lua

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.