@@ -10,7 +10,7 @@ import { ITextModel } from 'vs/editor/common/model';
1010import { Selection } from 'vs/editor/common/core/selection' ;
1111import { VariableResolver , Variable , Text } from 'vs/editor/contrib/snippet/snippetParser' ;
1212import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry' ;
13- import { getLeadingWhitespace , commonPrefixLength , isFalsyOrWhitespace , pad , endsWith } from 'vs/base/common/strings' ;
13+ import { getLeadingWhitespace , commonPrefixLength , isFalsyOrWhitespace } from 'vs/base/common/strings' ;
1414import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace' ;
1515import { isSingleFolderWorkspaceIdentifier , toWorkspaceIdentifier , WORKSPACE_EXTENSION , IWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces' ;
1616import { ILabelService } from 'vs/platform/label/common/label' ;
@@ -244,15 +244,15 @@ export class TimeBasedVariableResolver implements VariableResolver {
244244 } else if ( name === 'CURRENT_YEAR_SHORT' ) {
245245 return String ( new Date ( ) . getFullYear ( ) ) . slice ( - 2 ) ;
246246 } else if ( name === 'CURRENT_MONTH' ) {
247- return pad ( ( new Date ( ) . getMonth ( ) . valueOf ( ) + 1 ) , 2 ) ;
247+ return String ( new Date ( ) . getMonth ( ) . valueOf ( ) + 1 ) . padStart ( 2 , '0' ) ;
248248 } else if ( name === 'CURRENT_DATE' ) {
249- return pad ( new Date ( ) . getDate ( ) . valueOf ( ) , 2 ) ;
249+ return String ( new Date ( ) . getDate ( ) . valueOf ( ) ) . padStart ( 2 , '0' ) ;
250250 } else if ( name === 'CURRENT_HOUR' ) {
251- return pad ( new Date ( ) . getHours ( ) . valueOf ( ) , 2 ) ;
251+ return String ( new Date ( ) . getHours ( ) . valueOf ( ) ) . padStart ( 2 , '0' ) ;
252252 } else if ( name === 'CURRENT_MINUTE' ) {
253- return pad ( new Date ( ) . getMinutes ( ) . valueOf ( ) , 2 ) ;
253+ return String ( new Date ( ) . getMinutes ( ) . valueOf ( ) ) . padStart ( 2 , '0' ) ;
254254 } else if ( name === 'CURRENT_SECOND' ) {
255- return pad ( new Date ( ) . getSeconds ( ) . valueOf ( ) , 2 ) ;
255+ return String ( new Date ( ) . getSeconds ( ) . valueOf ( ) ) . padStart ( 2 , '0' ) ;
256256 } else if ( name === 'CURRENT_DAY_NAME' ) {
257257 return TimeBasedVariableResolver . dayNames [ new Date ( ) . getDay ( ) ] ;
258258 } else if ( name === 'CURRENT_DAY_NAME_SHORT' ) {
@@ -300,7 +300,7 @@ export class WorkspaceBasedVariableResolver implements VariableResolver {
300300 }
301301
302302 let filename = path . basename ( workspaceIdentifier . configPath . path ) ;
303- if ( endsWith ( filename , WORKSPACE_EXTENSION ) ) {
303+ if ( filename . endsWith ( WORKSPACE_EXTENSION ) ) {
304304 filename = filename . substr ( 0 , filename . length - WORKSPACE_EXTENSION . length - 1 ) ;
305305 }
306306 return filename ;
@@ -312,7 +312,7 @@ export class WorkspaceBasedVariableResolver implements VariableResolver {
312312
313313 let filename = path . basename ( workspaceIdentifier . configPath . path ) ;
314314 let folderpath = workspaceIdentifier . configPath . fsPath ;
315- if ( endsWith ( folderpath , filename ) ) {
315+ if ( folderpath . endsWith ( filename ) ) {
316316 folderpath = folderpath . substr ( 0 , folderpath . length - filename . length - 1 ) ;
317317 }
318318 return ( folderpath ? normalizeDriveLetter ( folderpath ) : '/' ) ;
0 commit comments