Repository navigation
fix: offer the NativeScript debugger without a launch.json - #304
Open
NathanWalker wants to merge 2 commits into
Open
NathanWalker wants to merge 2 commits into
NathanWalker wants to merge 2 commits into
Conversation
The debugger only declared javascript and typescript, so VS Code left it out of the debugger picker for .tsx/.jsx/.vue/.svelte files, and nothing resolved a configuration when debugging started without a launch.json. Declare those languages for the debugger and breakpoints, list "Launch on iOS/Android" as dynamic configurations for NativeScript workspaces, and ask for the platform when F5 starts with an empty configuration.
edusperoni
reviewed
Nov 10, 2026
edusperoni
left a comment
Contributor
There was a problem hiding this comment.
Looks good. The empty-configuration check matches the VS Code sample, returning undefined from the platform pick correctly cancels the launch, iOS is only offered on macOS (where IosProject can run), and leaving out provideDebugConfigurations keeps the full initialConfigurations for new launch.json files.
Non-blocking notes:
- Picker scope: declaring
javascriptreact/typescriptreact/vue/sveltealso puts "NativeScript" in the F5 debugger picker for any React/Vue/Svelte web project (already the case for plain JS/TS). A follow-up could add awhenclause on the debugger, backed by a context key set onworkspaceContains:activation for NativeScript config files. - Monorepos: detection and the generated
appRoot: ${workspaceFolder}assume the app is at the workspace root. In Nx the config lives inapps/<app>/, while the rootpackage.jsonusually has@nativescript/core, so the dynamic entries appear but point at the wrong root. Not a blocker; Nx users can keep a custom-commandlaunch.json. tsrx: I couldn't confirm that language id independently; an unknown id is harmless, just flagging it.
As noted in the description: after #303 lands, rebase and have isNativeScriptProject reuse its hasDependency (the only conflict is the test imports).
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In a NativeScript project with no
launch.json, Run and Debug did nothing useful:nativescriptdebugger only declaredjavascriptandtypescriptinlanguages. VS Code's debugger picker lists the debuggers that handle the active editor's language, so with a.tsxfile open NativeScript wasn't offered, and the picker suggested installing a TypeScript JSX extension instead..jsx,.vue, and.sveltehad the same problem.DebugConfigurationProviderwas registered. Nothing listed NativeScript configurations without alaunch.json, and nothing resolved the empty configuration VS Code sends when you press F5 without one.onDebugResolve:nativescript, so it stayed unloaded until a NativeScript configuration already existed.Change
contributes.debuggers[0].languagesandcontributes.breakpointsaddjavascriptreact,typescriptreact,vue,svelte, andtsrx(Octane; the id registered by the TSRX extension).DynamicConfigurationProvider(Dynamic trigger) lists Launch on iOS / Launch on Android for NativeScript workspaces; iOS is listed only on macOS. Workspaces are detected bynativescript.config.*,nsconfig.json, or an@nativescript/coredependency. The entries show up in the Run and Debug dropdown, and as "More NativeScript options…" in the picker.ConfigurationResolverturns an empty configuration (F5 with nolaunch.json) into a launch configuration. It asks for the platform, or picks Android directly when that's the only option; dismissing the pick cancels the launch. Configurations fromlaunch.jsonpass through unchanged.provideDebugConfigurations, so a newlaunch.jsonis still seeded from the sixinitialConfigurationsinpackage.json.onDebugDynamicConfigurations:nativescripttoactivationEvents.Verification
isNativeScriptProject; the full suite, typecheck, lint, and format pass.Merging with #303
Merging this alongside #303 conflicts only in the
projectInfo.test.tsimports; keep both sides. Whichever lands second should also haveisNativeScriptProjectreuse #303'shasDependencyhelper.