Skip to content

feat: Generate .vscode/launch.json with Flutter as default and full-stack debugging - #4509

Merged
marcelomendoncasoares merged 12 commits into
mainfrom
copilot/reorder-launch-json-config
Mar 3, 2026
Merged

marcelomendoncasoares merged 12 commits into
mainfrom
copilot/reorder-launch-json-config

Conversation

Copilot AI commented Dec 26, 2025 •

Copy link
Copy Markdown
Contributor

When creating a new Serverpod project and pressing F5 in VS Code, users encounter an error because VS Code has no default launch configuration. This creates unnecessary friction for beginners.

This PR generates a .vscode/launch.json file with proper debugging configurations for Serverpod projects, including individual configurations for Flutter and Server, plus a compound configuration for full-stack debugging.

Changes

  • Added launch configuration template at templates/serverpod_templates/vscode/launch.json

    • Two individual configurations: Flutter (default) and Server
    • Flutter configuration listed first to become VS Code's F5 default
    • Compound configuration for full-stack debugging that runs both server and Flutter together
    • Template uses projectname placeholder for automatic substitution
    • Client configuration excluded as it's a library package, not a runnable application
  • Modified CLI project creation in tools/serverpod_cli/lib/src/create/create.dart

    • Added vscodeDir to ServerpodDirectories class
    • Copy .vscode template during project creation (server template only)
    • Skip .vscode generation during upgrades to preserve user customizations
  • Added tests in tests/bootstrap_project/test/project_test.dart

    • Verify launch.json exists in generated projects
    • Verify Flutter configuration appears before server configuration
    • Verify compound configuration for full-stack debugging is present

Behavior

Server template (serverpod create myproject): Generates .vscode/launch.json at project root with three launch options:

  1. Flutter app (default when pressing F5)
  2. Server
  3. Full stack (compound that runs both server and Flutter together)

Mini template: No .vscode directory (no Flutter app).

Upgrades (serverpod create .): Skips .vscode generation to avoid overwriting user customizations.

Pre-launch Checklist

  • I read the Contribute page and followed the process outlined there for submitting PRs.
  • This update contains only one single feature or bug fix and nothing else. (If you are submitting multiple fixes, please make multiple PRs.)
  • I read and followed the Dart Style Guide and formatted the code with dart format.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///), and made sure that the documentation follows the same style as other Serverpod documentation. I checked spelling and grammar.
  • I added new tests to check the change I am making.
  • All existing and new tests are passing.
  • Any breaking changes are documented below.

If you need help, consider asking for advice on the discussion board.

Breaking changes

None. This is a purely additive feature that only affects newly created projects.

Original prompt

This section details on the original issue you should resolve

<issue_title>Reorder .vscode/launch.json so .._flutter launch option is default</issue_title>
<issue_description>### Problem to Solve

I propose to be able to start the flutter app of a serverpod project using Run -> Start debugging (F5) in VS Code with zero configuration.

Steps to reproduce:

  1. Create a new serverpod project
  2. Open the root folder of the project in VS Code
  3. Press F5 or menu option Run -> Start debugging

This does not start the app. Instead VS Code opens .vscode/launch.json and I get an error "Set the 'program' value in your launch config (eg 'lib/main.dart') then launch again"

The reason for this error is because it tries to use the first launch option which is to start the .._client launch option which doesn't have a main.dart file.

Proposal

Reorder .vscode/launch.json so the .._flutter configuration is the first one in the list, which will make VS Code pick that one by default.

Use Case

Serverpod beginners or users who are not aware of how to change which launch configuration to use by VS Code.

Alternatives

Press ctrl + shift + p and enter View: Show Run and Debug. This opens a Run and debug panel on the left of VS Code.

In the top of the "Run and debug" panel, there is a dropdown to change which launch configuration that VS Code uses.

IMHO, it is not given that all/many developers know that this dropdown exist as not all projects uses multiple launch configurations and implementing this Feature will lower the barrier to get started with Serverpod.

Additional context

No response

How experienced are you with this library?

Beginner - Just getting started with this library

Are you interested in working on a PR for this?

  • I want to work on this</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Reorder .vscode/launch.json for default flutter launch feat: Generate .vscode/launch.json with Flutter as default configuration Dec 26, 2025
@marcelomendoncasoares
marcelomendoncasoares requested review from exaby73 and removed request for marcelomendoncasoares December 30, 2025 20:26

Copilot AI commented Dec 31, 2025

Copy link
Copy Markdown
Contributor Author

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.mixpanel.com
    • Triggering command: /opt/hostedtoolcache/flutter/stable-3.38.4-x64/bin/cache/dart-sdk/bin/dartvm /opt/hostedtoolcache/flutter/stable-3.38.4-x64/bin/cache/dart-sdk/bin/dartvm --resolved_executable_name=/opt/hostedtoolcache/flutter/stable-3.38.4-x64/bin/cache/dart-sdk/bin/dart --executable_name=dart /home/REDACTED/work/serverpod/serverpod/tools/serverpod_cli/bin/serverpod_cli.dart create test_no_client_config --template server (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from exaby73 December 31, 2025 12:03

Copilot AI commented Jan 2, 2026

Copy link
Copy Markdown
Contributor Author

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.mixpanel.com
    • Triggering command: /opt/hostedtoolcache/flutter/stable-3.38.4-x64/bin/cache/dart-sdk/bin/dartvm /opt/hostedtoolcache/flutter/stable-3.38.4-x64/bin/cache/dart-sdk/bin/dartvm --resolved_executable_name=/opt/hostedtoolcache/flutter/stable-3.38.4-x64/bin/cache/dart-sdk/bin/dart --executable_name=dart /home/REDACTED/work/serverpod/serverpod/tools/serverpod_cli/bin/serverpod_cli.dart create test_compound_config --template server (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title feat: Generate .vscode/launch.json with Flutter as default configuration feat: Generate .vscode/launch.json with Flutter as default and full-stack debugging Jan 2, 2026
Copilot AI requested a review from exaby73 January 2, 2026 13:44
@exaby73
exaby73 force-pushed the copilot/reorder-launch-json-config branch from 7afb9d4 to 5a799de Compare February 25, 2026 12:01
@exaby73
exaby73 marked this pull request as ready for review February 25, 2026 12:16
@exaby73
exaby73 removed their request for review February 25, 2026 12:16
@exaby73
exaby73 requested a review from a team February 25, 2026 12:16
@marcelomendoncasoares
marcelomendoncasoares requested review from a team and exaby73 February 26, 2026 18:59

@nielsenko nielsenko left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should consider dropping the info regarding F5 eventually, but for the next release I think it is good for discoverability.

@marcelomendoncasoares
marcelomendoncasoares merged commit 6c7a2f7 into main Mar 3, 2026
72 checks passed
@marcelomendoncasoares
marcelomendoncasoares deleted the copilot/reorder-launch-json-config branch March 3, 2026 02:28
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reorder .vscode/launch.json so .._flutter launch option is default

4 participants