Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
eecec905
V
Vscode
项目概览
徽霖
/
Vscode
通知
9
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,发现更多精彩内容 >>
提交
eecec905
编写于
7月 16, 2019
作者:
P
pi1024e
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "Fixed formatting"
This reverts commit ff8fc9aa75edd7d30d135ef49738754d421fa4fd.
上级
bc78d523
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
55 addition
and
45 deletion
+55
-45
src/vs/platform/telemetry/common/errorTelemetry.ts
src/vs/platform/telemetry/common/errorTelemetry.ts
+21
-19
src/vs/workbench/contrib/files/browser/fileActions.ts
src/vs/workbench/contrib/files/browser/fileActions.ts
+34
-26
未找到文件。
src/vs/platform/telemetry/common/errorTelemetry.ts
浏览文件 @
eecec905
...
...
@@ -34,9 +34,7 @@ export namespace ErrorEvent {
export
function
compare
(
a
:
ErrorEvent
,
b
:
ErrorEvent
)
{
if
(
a
.
callstack
<
b
.
callstack
)
{
return
-
1
;
}
if
(
a
.
callstack
>
b
.
callstack
)
{
}
else
if
(
a
.
callstack
>
b
.
callstack
)
{
return
1
;
}
return
0
;
...
...
@@ -77,21 +75,25 @@ export default abstract class BaseErrorTelemetry {
private
_onErrorEvent
(
err
:
any
):
void
{
if
(
err
)
{
// unwrap nested errors from loader
if
(
err
.
detail
&&
err
.
detail
.
stack
)
{
err
=
err
.
detail
;
}
if
(
!
err
)
{
return
;
}
// unwrap nested errors from loader
if
(
err
.
detail
&&
err
.
detail
.
stack
)
{
err
=
err
.
detail
;
}
// work around behavior in workerServer.ts that breaks up Error.stack
let
callstack
=
Array
.
isArray
(
err
.
stack
)
?
err
.
stack
.
join
(
'
\n
'
)
:
err
.
stack
;
let
msg
=
err
.
message
?
err
.
message
:
safeStringify
(
err
);
// work around behavior in workerServer.ts that breaks up Error.stack
let
callstack
=
Array
.
isArray
(
err
.
stack
)
?
err
.
stack
.
join
(
'
\n
'
)
:
err
.
stack
;
let
msg
=
err
.
message
?
err
.
message
:
safeStringify
(
err
);
// errors without a stack are not useful telemetry
if
(
callstack
)
{
this
.
_enqueue
({
msg
,
callstack
});
}
// errors without a stack are not useful telemetry
if
(
!
callstack
)
{
return
;
}
this
.
_enqueue
({
msg
,
callstack
});
}
protected
_enqueue
(
e
:
ErrorEvent
):
void
{
...
...
@@ -100,10 +102,10 @@ export default abstract class BaseErrorTelemetry {
if
(
idx
<
0
)
{
e
.
count
=
1
;
this
.
_buffer
.
splice
(
~
idx
,
0
,
e
);
}
else
if
(
!
this
.
_buffer
[
idx
].
count
)
{
this
.
_buffer
[
idx
].
count
=
0
;
}
else
{
}
else
{
if
(
!
this
.
_buffer
[
idx
].
count
)
{
this
.
_buffer
[
idx
].
count
=
0
;
}
this
.
_buffer
[
idx
].
count
!
+=
1
;
}
...
...
src/vs/workbench/contrib/files/browser/fileActions.ts
浏览文件 @
eecec905
...
...
@@ -332,7 +332,11 @@ export function findValidPasteFileTarget(targetFolder: ExplorerItem, fileToPaste
let
name
=
resources
.
basenameOrAuthority
(
fileToPaste
.
resource
);
let
candidate
=
resources
.
joinPath
(
targetFolder
.
resource
,
name
);
while
(
!
(
fileToPaste
.
allowOverwrite
||
targetFolder
.
root
.
find
(
candidate
)))
{
while
(
true
&&
!
fileToPaste
.
allowOverwrite
)
{
if
(
!
targetFolder
.
root
.
find
(
candidate
))
{
break
;
}
name
=
incrementFileName
(
name
,
!!
fileToPaste
.
isDirectory
);
candidate
=
resources
.
joinPath
(
targetFolder
.
resource
,
name
);
}
...
...
@@ -947,42 +951,46 @@ export const deleteFileHandler = (accessor: ServicesAccessor) => {
let
pasteShouldMove
=
false
;
export
const
copyFileHandler
=
(
accessor
:
ServicesAccessor
)
=>
{
const
listService
=
accessor
.
get
(
IListService
);
if
(
listService
.
lastFocusedList
)
{
const
explorerContext
=
getContext
(
listService
.
lastFocusedList
);
const
explorerService
=
accessor
.
get
(
IExplorerService
);
if
(
explorerContext
.
stat
)
{
const
stats
=
explorerContext
.
selection
.
length
>
1
?
explorerContext
.
selection
:
[
explorerContext
.
stat
];
explorerService
.
setToCopy
(
stats
,
false
);
pasteShouldMove
=
false
;
}
if
(
!
listService
.
lastFocusedList
)
{
return
;
}
const
explorerContext
=
getContext
(
listService
.
lastFocusedList
);
const
explorerService
=
accessor
.
get
(
IExplorerService
);
if
(
explorerContext
.
stat
)
{
const
stats
=
explorerContext
.
selection
.
length
>
1
?
explorerContext
.
selection
:
[
explorerContext
.
stat
];
explorerService
.
setToCopy
(
stats
,
false
);
pasteShouldMove
=
false
;
}
};
export
const
cutFileHandler
=
(
accessor
:
ServicesAccessor
)
=>
{
const
listService
=
accessor
.
get
(
IListService
);
if
(
listService
.
lastFocusedList
)
{
const
explorerContext
=
getContext
(
listService
.
lastFocusedList
);
const
explorerService
=
accessor
.
get
(
IExplorerService
);
if
(
explorerContext
.
stat
)
{
const
stats
=
explorerContext
.
selection
.
length
>
1
?
explorerContext
.
selection
:
[
explorerContext
.
stat
];
explorerService
.
setToCopy
(
stats
,
true
);
pasteShouldMove
=
true
;
}
if
(
!
listService
.
lastFocusedList
)
{
return
;
}
const
explorerContext
=
getContext
(
listService
.
lastFocusedList
);
const
explorerService
=
accessor
.
get
(
IExplorerService
);
if
(
explorerContext
.
stat
)
{
const
stats
=
explorerContext
.
selection
.
length
>
1
?
explorerContext
.
selection
:
[
explorerContext
.
stat
];
explorerService
.
setToCopy
(
stats
,
true
);
pasteShouldMove
=
true
;
}
};
export
const
DOWNLOAD_COMMAND_ID
=
'
explorer.download
'
;
const
downloadFileHandler
=
(
accessor
:
ServicesAccessor
)
=>
{
const
listService
=
accessor
.
get
(
IListService
);
if
(
listService
.
lastFocusedList
)
{
const
explorerContext
=
getContext
(
listService
.
lastFocusedList
);
const
textFileService
=
accessor
.
get
(
ITextFileService
);
if
(
explorerContext
.
stat
)
{
const
stats
=
explorerContext
.
selection
.
length
>
1
?
explorerContext
.
selection
:
[
explorerContext
.
stat
];
stats
.
forEach
(
async
s
=>
{
await
textFileService
.
saveAs
(
s
.
resource
,
undefined
,
{
availableFileSystems
:
[
Schemas
.
file
]
});
});
}
if
(
!
listService
.
lastFocusedList
)
{
return
;
}
const
explorerContext
=
getContext
(
listService
.
lastFocusedList
);
const
textFileService
=
accessor
.
get
(
ITextFileService
);
if
(
explorerContext
.
stat
)
{
const
stats
=
explorerContext
.
selection
.
length
>
1
?
explorerContext
.
selection
:
[
explorerContext
.
stat
];
stats
.
forEach
(
async
s
=>
{
await
textFileService
.
saveAs
(
s
.
resource
,
undefined
,
{
availableFileSystems
:
[
Schemas
.
file
]
});
});
}
};
CommandsRegistry
.
registerCommand
({
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录