@@ -17,7 +17,6 @@ import {
17
17
SketchesServiceClientImpl ,
18
18
} from '../../../common/protocol/sketches-service-client-impl' ;
19
19
import { SaveAsSketch } from '../../contributions/save-as-sketch' ;
20
- import { SingleTextInputDialog } from '@theia/core/lib/browser' ;
21
20
import { nls } from '@theia/core/lib/common' ;
22
21
23
22
@injectable ( )
@@ -161,20 +160,26 @@ export class WorkspaceCommandContribution extends TheiaWorkspaceCommandContribut
161
160
return ;
162
161
}
163
162
const initialValue = uri . path . base ;
164
- const dialog = new SingleTextInputDialog ( {
165
- title : nls . localize ( 'theia/workspace/newFileName' , 'New name for file' ) ,
166
- initialValue,
167
- initialSelectionRange : {
168
- start : 0 ,
169
- end : uri . path . name . length ,
170
- } ,
171
- validate : ( name , mode ) => {
172
- if ( initialValue === name && mode === 'preview' ) {
173
- return false ;
174
- }
175
- return this . validateFileName ( name , parent , false ) ;
163
+ const parentUri = parent . resource ;
164
+
165
+ const dialog = new WorkspaceInputDialog (
166
+ {
167
+ title : nls . localize ( 'theia/workspace/newFileName' , 'New name for file' ) ,
168
+ initialValue,
169
+ parentUri,
170
+ initialSelectionRange : {
171
+ start : 0 ,
172
+ end : uri . path . name . length ,
173
+ } ,
174
+ validate : ( name , mode ) => {
175
+ if ( initialValue === name && mode === 'preview' ) {
176
+ return false ;
177
+ }
178
+ return this . validateFileName ( name , parent , false ) ;
179
+ } ,
176
180
} ,
177
- } ) ;
181
+ this . labelProvider
182
+ ) ;
178
183
const newName = await dialog . open ( ) ;
179
184
const newNameWithExt = this . maybeAppendInoExt ( newName ) ;
180
185
if ( newNameWithExt ) {
0 commit comments