@@ -19,11 +19,10 @@ import { ILifecycleMainService, UnloadReason, LifecycleMainService, LifecycleMai
1919import { IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
2020import { ILogService } from 'vs/platform/log/common/log' ;
2121import { IWindowSettings , OpenContext , IPath , IWindowConfiguration , IPathsToWaitFor , isFileToOpen , isWorkspaceToOpen , isFolderToOpen , IWindowOpenable , IOpenEmptyWindowOptions , IAddFoldersRequest } from 'vs/platform/windows/common/windows' ;
22- import { INativeOpenDialogOptions } from 'vs/platform/dialogs/node/dialogs' ;
2322import { getLastActiveWindow , findBestWindowOrFolderForFile , findWindowOnWorkspace , findWindowOnExtensionDevelopmentPath , findWindowOnWorkspaceOrFolderUri } from 'vs/platform/windows/node/window' ;
2423import { Event as CommonEvent , Emitter } from 'vs/base/common/event' ;
2524import product from 'vs/platform/product/common/product' ;
26- import { ITelemetryService , ITelemetryData } from 'vs/platform/telemetry/common/telemetry' ;
25+ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry' ;
2726import { IWindowsMainService , IOpenConfiguration , IWindowsCountChangedEvent , ICodeWindow , IWindowState as ISingleWindowState , WindowMode } from 'vs/platform/windows/electron-main/windows' ;
2827import { IWorkspacesHistoryMainService } from 'vs/platform/workspaces/electron-main/workspacesHistoryMainService' ;
2928import { IProcessEnvironment , isMacintosh , isWindows } from 'vs/base/common/platform' ;
@@ -32,7 +31,6 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
3231import { mnemonicButtonLabel } from 'vs/base/common/labels' ;
3332import { Schemas } from 'vs/base/common/network' ;
3433import { URI } from 'vs/base/common/uri' ;
35- import { dirExists } from 'vs/base/node/pfs' ;
3634import { getComparisonKey , isEqual , normalizePath , originalFSPath , hasTrailingPathSeparator , removeTrailingPathSeparator } from 'vs/base/common/resources' ;
3735import { getRemoteAuthority } from 'vs/platform/remote/common/remoteHosts' ;
3836import { restoreWindowsState , WindowsStateStorageData , getWindowsStateStoreData } from 'vs/code/electron-main/windowsStateStorage' ;
@@ -1718,6 +1716,7 @@ export class WindowsManager extends Disposable implements IWindowsMainService {
17181716 type : WindowError ;
17191717 } ;
17201718 this . telemetryService . publicLog2 < WindowErrorEvent , WindowErrorClassification > ( 'windowerror' , { type : error } ) ;
1719+
17211720 // Unresponsive
17221721 if ( error === WindowError . UNRESPONSIVE ) {
17231722 if ( window . isExtensionDevelopmentHost || window . isExtensionTestHost || ( window . win && window . win . webContents && window . win . webContents . isDevToolsOpened ( ) ) ) {
@@ -1790,80 +1789,6 @@ export class WindowsManager extends Disposable implements IWindowsMainService {
17901789 this . _onWindowClose . fire ( win . id ) ;
17911790 }
17921791
1793- async pickFileFolderAndOpen ( options : INativeOpenDialogOptions , win ?: ICodeWindow ) : Promise < void > {
1794- const paths = await this . dialogMainService . pickFileFolder ( options ) ;
1795- if ( paths ) {
1796- this . sendPickerTelemetry ( paths , options . telemetryEventName || 'openFileFolder' , options . telemetryExtraData ) ;
1797- const urisToOpen = await Promise . all ( paths . map ( async path => {
1798- const isDir = await dirExists ( path ) ;
1799-
1800- return isDir ? { folderUri : URI . file ( path ) } : { fileUri : URI . file ( path ) } ;
1801- } ) ) ;
1802- this . open ( {
1803- context : OpenContext . DIALOG ,
1804- contextWindowId : win ? win . id : undefined ,
1805- cli : this . environmentService . args ,
1806- urisToOpen,
1807- forceNewWindow : options . forceNewWindow
1808- } ) ;
1809- }
1810- }
1811-
1812- async pickFolderAndOpen ( options : INativeOpenDialogOptions , win ?: ICodeWindow ) : Promise < void > {
1813- const paths = await this . dialogMainService . pickFolder ( options ) ;
1814- if ( paths ) {
1815- this . sendPickerTelemetry ( paths , options . telemetryEventName || 'openFolder' , options . telemetryExtraData ) ;
1816- this . open ( {
1817- context : OpenContext . DIALOG ,
1818- contextWindowId : win ? win . id : undefined ,
1819- cli : this . environmentService . args ,
1820- urisToOpen : paths . map ( path => ( { folderUri : URI . file ( path ) } ) ) ,
1821- forceNewWindow : options . forceNewWindow
1822- } ) ;
1823- }
1824- }
1825-
1826- async pickFileAndOpen ( options : INativeOpenDialogOptions , win ?: ICodeWindow ) : Promise < void > {
1827- const paths = await this . dialogMainService . pickFile ( options ) ;
1828- if ( paths ) {
1829- this . sendPickerTelemetry ( paths , options . telemetryEventName || 'openFile' , options . telemetryExtraData ) ;
1830- this . open ( {
1831- context : OpenContext . DIALOG ,
1832- contextWindowId : win ? win . id : undefined ,
1833- cli : this . environmentService . args ,
1834- urisToOpen : paths . map ( path => ( { fileUri : URI . file ( path ) } ) ) ,
1835- forceNewWindow : options . forceNewWindow
1836- } ) ;
1837- }
1838- }
1839-
1840- async pickWorkspaceAndOpen ( options : INativeOpenDialogOptions , win ?: ICodeWindow ) : Promise < void > {
1841- const paths = await this . dialogMainService . pickWorkspace ( options ) ;
1842- if ( paths ) {
1843- this . sendPickerTelemetry ( paths , options . telemetryEventName || 'openWorkspace' , options . telemetryExtraData ) ;
1844- this . open ( {
1845- context : OpenContext . DIALOG ,
1846- contextWindowId : win ? win . id : undefined ,
1847- cli : this . environmentService . args ,
1848- urisToOpen : paths . map ( path => ( { workspaceUri : URI . file ( path ) } ) ) ,
1849- forceNewWindow : options . forceNewWindow
1850- } ) ;
1851- }
1852-
1853- }
1854-
1855- private sendPickerTelemetry ( paths : string [ ] , telemetryEventName : string , telemetryExtraData ?: ITelemetryData ) {
1856- const numberOfPaths = paths ? paths . length : 0 ;
1857-
1858- // Telemetry
1859- // __GDPR__TODO__ Dynamic event names and dynamic properties. Can not be registered statically.
1860- this . telemetryService . publicLog ( telemetryEventName , {
1861- ...telemetryExtraData ,
1862- outcome : numberOfPaths ? 'success' : 'canceled' ,
1863- numberOfPaths
1864- } ) ;
1865- }
1866-
18671792 quit ( ) : void {
18681793
18691794 // If the user selected to exit from an extension development host window, do not quit, but just
0 commit comments