Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
7f4d4525
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
7f4d4525
编写于
10月 06, 2020
作者:
J
João Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove strings.pad
related to #103454
上级
e6cf885a
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
9 addition
and
32 deletion
+9
-32
src/vs/base/common/date.ts
src/vs/base/common/date.ts
+5
-6
src/vs/base/common/strings.ts
src/vs/base/common/strings.ts
+0
-14
src/vs/base/test/common/strings.test.ts
src/vs/base/test/common/strings.test.ts
+0
-7
src/vs/editor/contrib/parameterHints/parameterHintsWidget.ts
src/vs/editor/contrib/parameterHints/parameterHintsWidget.ts
+2
-2
src/vs/workbench/contrib/preferences/browser/preferencesSearch.ts
...orkbench/contrib/preferences/browser/preferencesSearch.ts
+1
-1
src/vs/workbench/services/extensions/common/extensionHostManager.ts
...kbench/services/extensions/common/extensionHostManager.ts
+1
-2
未找到文件。
src/vs/base/common/date.ts
浏览文件 @
7f4d4525
...
...
@@ -3,7 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
pad
}
from
'
./strings
'
;
import
{
localize
}
from
'
vs/nls
'
;
const
minute
=
60
;
...
...
@@ -121,11 +120,11 @@ export function fromNow(date: number | Date, appendAgoLabel?: boolean): string {
export
function
toLocalISOString
(
date
:
Date
):
string
{
return
date
.
getFullYear
()
+
'
-
'
+
pad
(
date
.
getMonth
()
+
1
,
2
)
+
'
-
'
+
pad
(
date
.
getDate
(),
2
)
+
'
T
'
+
pad
(
date
.
getHours
(),
2
)
+
'
:
'
+
pad
(
date
.
getMinutes
(),
2
)
+
'
:
'
+
pad
(
date
.
getSeconds
(),
2
)
+
'
-
'
+
String
(
date
.
getMonth
()
+
1
).
padStart
(
2
,
'
0
'
)
+
'
-
'
+
String
(
date
.
getDate
()).
padStart
(
2
,
'
0
'
)
+
'
T
'
+
String
(
date
.
getHours
()).
padStart
(
2
,
'
0
'
)
+
'
:
'
+
String
(
date
.
getMinutes
()).
padStart
(
2
,
'
0
'
)
+
'
:
'
+
String
(
date
.
getSeconds
()).
padStart
(
2
,
'
0
'
)
+
'
.
'
+
(
date
.
getMilliseconds
()
/
1000
).
toFixed
(
3
).
slice
(
2
,
5
)
+
'
Z
'
;
}
src/vs/base/common/strings.ts
浏览文件 @
7f4d4525
...
...
@@ -13,20 +13,6 @@ export function isFalsyOrWhitespace(str: string | undefined): boolean {
return
str
.
trim
().
length
===
0
;
}
/**
* @deprecated ES6: use `String.padStart`
*/
export
function
pad
(
n
:
number
,
l
:
number
,
char
:
string
=
'
0
'
):
string
{
const
str
=
''
+
n
;
const
r
=
[
str
];
for
(
let
i
=
str
.
length
;
i
<
l
;
i
++
)
{
r
.
push
(
char
);
}
return
r
.
reverse
().
join
(
''
);
}
const
_formatRegexp
=
/{
(\d
+
)
}/g
;
/**
...
...
src/vs/base/test/common/strings.test.ts
浏览文件 @
7f4d4525
...
...
@@ -125,13 +125,6 @@ suite('Strings', () => {
assert
.
strictEqual
(
strings
.
lcut
(
'
a
'
,
10
),
'
a
'
);
});
test
(
'
pad
'
,
()
=>
{
assert
.
strictEqual
(
strings
.
pad
(
1
,
0
),
'
1
'
);
assert
.
strictEqual
(
strings
.
pad
(
1
,
1
),
'
1
'
);
assert
.
strictEqual
(
strings
.
pad
(
1
,
2
),
'
01
'
);
assert
.
strictEqual
(
strings
.
pad
(
0
,
2
),
'
00
'
);
});
test
(
'
escape
'
,
()
=>
{
assert
.
strictEqual
(
strings
.
escape
(
''
),
''
);
assert
.
strictEqual
(
strings
.
escape
(
'
foo
'
),
'
foo
'
);
...
...
src/vs/editor/contrib/parameterHints/parameterHintsWidget.ts
浏览文件 @
7f4d4525
...
...
@@ -22,7 +22,7 @@ import { IOpenerService } from 'vs/platform/opener/common/opener';
import
{
editorHoverBackground
,
editorHoverBorder
,
textCodeBlockBackground
,
textLinkForeground
,
editorHoverForeground
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
registerThemingParticipant
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
ParameterHintsModel
,
TriggerContext
}
from
'
vs/editor/contrib/parameterHints/parameterHintsModel
'
;
import
{
pad
,
escapeRegExpCharacters
}
from
'
vs/base/common/strings
'
;
import
{
escapeRegExpCharacters
}
from
'
vs/base/common/strings
'
;
import
{
registerIcon
,
Codicon
}
from
'
vs/base/common/codicons
'
;
import
{
assertIsDefined
}
from
'
vs/base/common/types
'
;
import
{
ColorScheme
}
from
'
vs/platform/theme/common/theme
'
;
...
...
@@ -247,7 +247,7 @@ export class ParameterHintsWidget extends Disposable implements IContentWidget {
dom
.
toggleClass
(
this
.
domNodes
.
docs
,
'
empty
'
,
!
hasDocs
);
this
.
domNodes
.
overloads
.
textContent
=
pad
(
hints
.
activeSignature
+
1
,
hints
.
signatures
.
length
.
toString
().
length
)
+
'
/
'
+
hints
.
signatures
.
length
;
String
(
hints
.
activeSignature
+
1
).
padStart
(
hints
.
signatures
.
length
.
toString
().
length
,
'
0
'
)
+
'
/
'
+
hints
.
signatures
.
length
;
if
(
activeParameter
)
{
const
labelToAnnounce
=
this
.
getParameterLabel
(
signature
,
activeParameterIndex
);
...
...
src/vs/workbench/contrib/preferences/browser/preferencesSearch.ts
浏览文件 @
7f4d4525
...
...
@@ -402,7 +402,7 @@ class RemoteSearchProvider implements ISearchProvider {
const
uuid
=
ext
.
identifier
.
uuid
;
const
versionString
=
ext
.
manifest
.
version
.
split
(
'
.
'
)
.
map
(
versionPart
=>
strings
.
pad
(
<
any
>
versionPart
,
10
)
)
.
map
(
versionPart
=>
String
(
versionPart
).
padStart
(
10
),
'
0
'
)
.
join
(
''
);
return
`(packageid eq '
${
uuid
}
' and startbuildno le '
${
versionString
}
' and endbuildno ge '
${
versionString
}
')`
;
...
...
src/vs/workbench/services/extensions/common/extensionHostManager.ts
浏览文件 @
7f4d4525
...
...
@@ -6,7 +6,6 @@
import
*
as
errors
from
'
vs/base/common/errors
'
;
import
{
Emitter
,
Event
}
from
'
vs/base/common/event
'
;
import
{
Disposable
,
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
*
as
strings
from
'
vs/base/common/strings
'
;
import
{
IMessagePassingProtocol
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
IInstantiationService
,
ServicesAccessor
}
from
'
vs/platform/instantiation/common/instantiation
'
;
...
...
@@ -344,7 +343,7 @@ class RPCLogger implements IRPCProtocolLogger {
const
colorTable
=
colorTables
[
initiator
];
const
color
=
LOG_USE_COLORS
?
colorTable
[
req
%
colorTable
.
length
]
:
'
#000000
'
;
let
args
=
[
`%c[
${
direction
}
]%c[
${
strings
.
pad
(
totalLength
,
7
,
'
'
)}
]%c[len:
${
strings
.
pad
(
msgLength
,
5
,
'
'
)}
]%c
${
strings
.
pad
(
req
,
5
,
'
'
)}
-
${
str
}
`
,
'
color: darkgreen
'
,
'
color: grey
'
,
'
color: grey
'
,
`color:
${
color
}
`
];
let
args
=
[
`%c[
${
direction
}
]%c[
${
String
(
totalLength
).
padStart
(
7
)}
]%c[len:
${
String
(
msgLength
).
padStart
(
5
)}
]%c
${
String
(
req
).
padStart
(
5
)}
-
${
str
}
`
,
'
color: darkgreen
'
,
'
color: grey
'
,
'
color: grey
'
,
`color:
${
color
}
`
];
if
(
/
\(
$/
.
test
(
str
))
{
args
=
args
.
concat
(
data
);
args
.
push
(
'
)
'
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录