Code change:
const editorService = accessor.get(IEditorService); const editorGroupService = accessor.get(IEditorGroupsService); const openerService = accessor.get(IOpenerService); <ins> const pathService = accessor.get(IPathService); </ins> const resource = URI.revive(resourceArg); const [columnArg, optionsArg] = columnAndOptions ?? []; <del> // use editor options or editor view column as a hint to use the editor service for opening if (optionsArg || typeof columnArg === 'number') { </del> <ins> // use editor options or editor view column or resource scheme // as a hint to use the editor service for opening directly if (optionsArg || typeof columnArg === 'number' || resource.scheme === Schemas.untitled) { </ins> const [options, column] = mixinContext(context, optionsArg, columnArg); <del> await editorService.openEditor({ resource, options, label }, columnToEditorGroup(editorGroupService, column)); </del> <ins> let input: IResourceEditorInput | IUntitledTextResourceEditorInput; if (resource.scheme === Schemas.untitled && resource.path.length > 1) { // special case for untitled: we are getting a resource with meaningful // path from an extension to use for the untitled editor. as such, we // have to assume it as an associated resource to use when saving. we // do so by setting the `forceUntitled: true` and changing the scheme // to a file based one. the untitled editor service takes care to // associate the path properly then. input = { resource: resource.with({ scheme: pathService.defaultUriScheme }), forceUntitled: true, options, label }; } else { // use any other resource as is input = { resource, options, label }; } await editorService.openEditor(input, columnToEditorGroup(editorGroupService, column)); </ins> } // do not allow to execute commands from here

Related discussion:
text: Issue Type: <bBug</bCreating an untitled document (from a file URI amended with the scheme) results in different states depending on whether the document is created with the command or the function. I tried to reduce the problem to a failing test case and failed, but maybe can still be useful for debugging. Create an untitled URI for a new file () Open an editor for that URI with / Type some text Save the file Notice that the save dialog starts with the we had providedCreate a new untitled URI for a new file Open an editor for that URI with Type some text Save the file The save dialog starts with the we had provided, just like with the other method. The save dialog starts with the text we typed instead of the we had provided. VS Code version: Code 1.63.0 (, 2021-12-07T05:16:45.441Z) OS version: Linux x64 5.15.6-200.fc35.x8664 Restricted Mode: No <details<summarySystem Info</summary </details<details<summaryExtensions (38)</summaryExtensionVersion ------ vscode-unfancy-file-icons3.15.0 icons-carbon0.2.4 chalice-icon-theme1.2.16 awk-ide-vscode0.6.2 vscode-fish1.0.24 init-script0.1.3 make-task-provider2.1.1 npm-intellisense1.4.0 path-intellisense2.6.0 vscode-eslint2.2.2 EditorConfig0.16.4 gtk-dark-titlebar1.2.3 vscode-pull-request-github0.34.0 go0.29.0 terraform2.17.0 nix-ide0.1.18 language-julia1.5.6 rust-analyzer0.2.842 git-graph1.30.0 fluent-icons0.0.15 direnv0.3.0 vscode-docker1.18.0 python2021.12. vscode-pylance2021.12.1 jupyter2021.11.