Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
c0cfb1a6
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
GitCode(gitcode.net)2024年7月9日维护升级公告
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
c0cfb1a6
编写于
1月 04, 2017
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
💄
上级
cafc25cc
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
25 addition
and
63 deletion
+25
-63
src/vs/base/common/arrays.ts
src/vs/base/common/arrays.ts
+2
-2
src/vs/base/common/async.ts
src/vs/base/common/async.ts
+4
-4
src/vs/base/common/dates.ts
src/vs/base/common/dates.ts
+0
-38
src/vs/base/common/map.ts
src/vs/base/common/map.ts
+3
-3
src/vs/base/common/mime.ts
src/vs/base/common/mime.ts
+2
-2
src/vs/base/common/network.ts
src/vs/base/common/network.ts
+6
-6
src/vs/base/common/paths.ts
src/vs/base/common/paths.ts
+5
-5
src/vs/base/common/stopwatch.ts
src/vs/base/common/stopwatch.ts
+1
-1
src/vs/base/common/strings.ts
src/vs/base/common/strings.ts
+2
-2
未找到文件。
src/vs/base/common/arrays.ts
浏览文件 @
c0cfb1a6
...
...
@@ -18,7 +18,7 @@ export function equals<T>(one: T[], other: T[], itemEquals: (a: T, b: T) => bool
return
false
;
}
for
(
var
i
=
0
,
len
=
one
.
length
;
i
<
len
;
i
++
)
{
for
(
let
i
=
0
,
len
=
one
.
length
;
i
<
len
;
i
++
)
{
if
(
!
itemEquals
(
one
[
i
],
other
[
i
]))
{
return
false
;
}
...
...
@@ -177,7 +177,7 @@ export function first<T>(array: T[], fn: (item: T) => boolean, notFoundValue: T
export
function
commonPrefixLength
<
T
>
(
one
:
T
[],
other
:
T
[],
equals
:
(
a
:
T
,
b
:
T
)
=>
boolean
=
(
a
,
b
)
=>
a
===
b
):
number
{
let
result
=
0
;
for
(
var
i
=
0
,
len
=
Math
.
min
(
one
.
length
,
other
.
length
);
i
<
len
&&
equals
(
one
[
i
],
other
[
i
]);
i
++
)
{
for
(
let
i
=
0
,
len
=
Math
.
min
(
one
.
length
,
other
.
length
);
i
<
len
&&
equals
(
one
[
i
],
other
[
i
]);
i
++
)
{
result
++
;
}
...
...
src/vs/base/common/async.ts
浏览文件 @
c0cfb1a6
...
...
@@ -71,8 +71,8 @@ export interface ITask<T> {
* The throttler implements this via the queue() method, by providing it a task
* factory. Following the example:
*
*
var
throttler = new Throttler();
*
var
letters = [];
*
const
throttler = new Throttler();
*
const
letters = [];
*
* function deliver() {
* const lettersToDeliver = letters;
...
...
@@ -166,8 +166,8 @@ export class SimpleThrottler {
* to be executed and the waiting period (delay) must be passed in as arguments. Following
* the example:
*
*
var
delayer = new Delayer(WAITING_PERIOD);
*
var
letters = [];
*
const
delayer = new Delayer(WAITING_PERIOD);
*
const
letters = [];
*
* function letterReceived(l) {
* letters.push(l);
...
...
src/vs/base/common/dates.ts
已删除
100644 → 0
浏览文件 @
cafc25cc
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
nls
=
require
(
'
vs/nls
'
);
export
function
since
(
date
:
Date
):
string
{
var
seconds
=
(
new
Date
().
getTime
()
-
date
.
getTime
())
/
1000
;
if
(
seconds
<
60
)
{
return
nls
.
localize
(
'
diff.seconds.verbose
'
,
"
just now
"
);
}
var
minutes
=
seconds
/
60
;
if
(
minutes
<
60
)
{
return
Math
.
floor
(
minutes
)
===
1
?
nls
.
localize
(
'
diff.minute.verbose
'
,
"
1 minute ago
"
)
:
nls
.
localize
(
'
diff.minutes.verbose
'
,
"
{0} minutes ago
"
,
Math
.
floor
(
minutes
));
}
var
hours
=
minutes
/
60
;
if
(
hours
<
24
)
{
return
Math
.
floor
(
hours
)
===
1
?
nls
.
localize
(
'
diff.hour.verbose
'
,
"
1 hour ago
"
)
:
nls
.
localize
(
'
diff.hours.verbose
'
,
"
{0} hours ago
"
,
Math
.
floor
(
hours
));
}
var
days
=
hours
/
24
;
if
(
Math
.
floor
(
days
)
===
1
)
{
return
nls
.
localize
(
'
diff.days.yesterday
'
,
"
yesterday
"
);
}
if
(
days
>
6
&&
days
<
8
)
{
return
nls
.
localize
(
'
diff.days.week
'
,
"
a week ago
"
);
}
if
(
days
>
30
&&
days
<
40
)
{
return
nls
.
localize
(
'
diff.days.month
'
,
"
a month ago
"
);
}
return
nls
.
localize
(
'
diff.days.verbose
'
,
"
{0} days ago
"
,
Math
.
floor
(
days
));
}
\ No newline at end of file
src/vs/base/common/map.ts
浏览文件 @
c0cfb1a6
...
...
@@ -52,7 +52,7 @@ export class LinkedMap<K extends Key, T> {
}
public
keys
():
K
[]
{
var
keys
:
K
[]
=
[];
const
keys
:
K
[]
=
[];
for
(
let
key
in
this
.
map
)
{
keys
.
push
(
this
.
map
[
key
].
key
);
}
...
...
@@ -60,7 +60,7 @@ export class LinkedMap<K extends Key, T> {
}
public
values
():
T
[]
{
var
values
:
T
[]
=
[];
const
values
:
T
[]
=
[];
for
(
let
key
in
this
.
map
)
{
values
.
push
(
this
.
map
[
key
].
value
);
}
...
...
@@ -68,7 +68,7 @@ export class LinkedMap<K extends Key, T> {
}
public
entries
():
Entry
<
K
,
T
>
[]
{
var
entries
:
Entry
<
K
,
T
>
[]
=
[];
const
entries
:
Entry
<
K
,
T
>
[]
=
[];
for
(
let
key
in
this
.
map
)
{
entries
.
push
(
this
.
map
[
key
]);
}
...
...
src/vs/base/common/mime.ts
浏览文件 @
c0cfb1a6
...
...
@@ -143,7 +143,7 @@ function guessMimeTypeByPath(path: string, filename: string, associations: IText
let
patternMatch
:
ITextMimeAssociationItem
;
let
extensionMatch
:
ITextMimeAssociationItem
;
for
(
var
i
=
0
;
i
<
associations
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
associations
.
length
;
i
++
)
{
let
association
=
associations
[
i
];
// First exact name match
...
...
@@ -243,7 +243,7 @@ export function isUnspecific(mime: string[] | string): boolean {
}
export
function
suggestFilename
(
langId
:
string
,
prefix
:
string
):
string
{
for
(
var
i
=
0
;
i
<
registeredAssociations
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
registeredAssociations
.
length
;
i
++
)
{
let
association
=
registeredAssociations
[
i
];
if
(
association
.
userConfigured
)
{
continue
;
// only support registered ones
...
...
src/vs/base/common/network.ts
浏览文件 @
c0cfb1a6
...
...
@@ -12,23 +12,23 @@ export namespace Schemas {
* A schema that is used for models that exist in memory
* only and that have no correspondence on a server or such.
*/
export
var
inMemory
:
string
=
'
inmemory
'
;
export
const
inMemory
:
string
=
'
inmemory
'
;
/**
* A schema that is used for setting files
*/
export
var
vscode
:
string
=
'
vscode
'
;
export
const
vscode
:
string
=
'
vscode
'
;
/**
* A schema that is used for internal private files
*/
export
var
internal
:
string
=
'
private
'
;
export
const
internal
:
string
=
'
private
'
;
export
var
http
:
string
=
'
http
'
;
export
const
http
:
string
=
'
http
'
;
export
var
https
:
string
=
'
https
'
;
export
const
https
:
string
=
'
https
'
;
export
var
file
:
string
=
'
file
'
;
export
const
file
:
string
=
'
file
'
;
}
export
interface
IXHROptions
{
...
...
src/vs/base/common/paths.ts
浏览文件 @
c0cfb1a6
...
...
@@ -11,12 +11,12 @@ import { CharCode } from 'vs/base/common/charCode';
/**
* The forward slash path separator.
*/
export
var
sep
=
'
/
'
;
export
const
sep
=
'
/
'
;
/**
* The native path separator depending on the OS.
*/
export
var
nativeSep
=
isWindows
?
'
\\
'
:
'
/
'
;
export
const
nativeSep
=
isWindows
?
'
\\
'
:
'
/
'
;
export
function
relative
(
from
:
string
,
to
:
string
):
string
{
const
originalNormalizedFrom
=
normalize
(
from
);
...
...
@@ -50,7 +50,7 @@ export function relative(from: string, to: string): string {
* @returns the directory name of a path.
*/
export
function
dirname
(
path
:
string
):
string
{
var
idx
=
~
path
.
lastIndexOf
(
'
/
'
)
||
~
path
.
lastIndexOf
(
'
\\
'
);
const
idx
=
~
path
.
lastIndexOf
(
'
/
'
)
||
~
path
.
lastIndexOf
(
'
\\
'
);
if
(
idx
===
0
)
{
return
'
.
'
;
}
else
if
(
~
idx
===
0
)
{
...
...
@@ -64,7 +64,7 @@ export function dirname(path: string): string {
* @returns the base name of a path.
*/
export
function
basename
(
path
:
string
):
string
{
var
idx
=
~
path
.
lastIndexOf
(
'
/
'
)
||
~
path
.
lastIndexOf
(
'
\\
'
);
const
idx
=
~
path
.
lastIndexOf
(
'
/
'
)
||
~
path
.
lastIndexOf
(
'
\\
'
);
if
(
idx
===
0
)
{
return
path
;
}
else
if
(
~
idx
===
path
.
length
-
1
)
{
...
...
@@ -79,7 +79,7 @@ export function basename(path: string): string {
*/
export
function
extname
(
path
:
string
):
string
{
path
=
basename
(
path
);
var
idx
=
~
path
.
lastIndexOf
(
'
.
'
);
const
idx
=
~
path
.
lastIndexOf
(
'
.
'
);
return
idx
?
path
.
substring
(
~
idx
)
:
''
;
}
...
...
src/vs/base/common/stopwatch.ts
浏览文件 @
c0cfb1a6
...
...
@@ -6,7 +6,7 @@
import
{
globals
}
from
'
vs/base/common/platform
'
;
var
hasPerformanceNow
=
(
globals
.
performance
&&
typeof
globals
.
performance
.
now
===
'
function
'
);
const
hasPerformanceNow
=
(
globals
.
performance
&&
typeof
globals
.
performance
.
now
===
'
function
'
);
export
class
StopWatch
{
...
...
src/vs/base/common/strings.ts
浏览文件 @
c0cfb1a6
...
...
@@ -607,8 +607,8 @@ export function safeBtoa(str: string): string {
}
export
function
repeat
(
s
:
string
,
count
:
number
):
string
{
var
result
=
''
;
for
(
var
i
=
0
;
i
<
count
;
i
++
)
{
let
result
=
''
;
for
(
let
i
=
0
;
i
<
count
;
i
++
)
{
result
+=
s
;
}
return
result
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录