Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
df403aa0
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,发现更多精彩内容 >>
提交
df403aa0
编写于
2月 21, 2020
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
show the name of the formatter that's running long, #90851
上级
b2e0925b
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
12 addition
and
8 deletion
+12
-8
src/vs/editor/contrib/format/format.ts
src/vs/editor/contrib/format/format.ts
+3
-0
src/vs/editor/contrib/format/formatActions.ts
src/vs/editor/contrib/format/formatActions.ts
+2
-1
src/vs/platform/progress/common/progress.ts
src/vs/platform/progress/common/progress.ts
+2
-2
src/vs/workbench/contrib/codeEditor/browser/saveParticipants.ts
.../workbench/contrib/codeEditor/browser/saveParticipants.ts
+1
-1
src/vs/workbench/services/bulkEdit/browser/bulkEditService.ts
...vs/workbench/services/bulkEdit/browser/bulkEditService.ts
+2
-2
src/vs/workbench/test/browser/workbenchTestServices.ts
src/vs/workbench/test/browser/workbenchTestServices.ts
+2
-2
未找到文件。
src/vs/editor/contrib/format/format.ts
浏览文件 @
df403aa0
...
...
@@ -27,6 +27,7 @@ import { IDisposable } from 'vs/base/common/lifecycle';
import
{
LinkedList
}
from
'
vs/base/common/linkedList
'
;
import
{
CommandsRegistry
}
from
'
vs/platform/commands/common/commands
'
;
import
{
assertType
}
from
'
vs/base/common/types
'
;
import
{
IProgressStep
,
IProgress
}
from
'
vs/platform/progress/common/progress
'
;
export
function
alertFormattingEdits
(
edits
:
ISingleEditOperation
[]):
void
{
...
...
@@ -209,6 +210,7 @@ export async function formatDocumentWithSelectedProvider(
accessor
:
ServicesAccessor
,
editorOrModel
:
ITextModel
|
IActiveCodeEditor
,
mode
:
FormattingMode
,
progress
:
IProgress
<
IProgressStep
>
,
token
:
CancellationToken
):
Promise
<
void
>
{
...
...
@@ -217,6 +219,7 @@ export async function formatDocumentWithSelectedProvider(
const
provider
=
getRealAndSyntheticDocumentFormattersOrdered
(
model
);
const
selected
=
await
FormattingConflicts
.
select
(
provider
,
model
,
mode
);
if
(
selected
)
{
progress
.
report
({
message
:
nls
.
localize
(
'
formattingWith
'
,
"
Formatting with '{0}'
"
,
selected
.
displayName
||
selected
.
extensionId
&&
selected
.
extensionId
.
value
||
'
???
'
)
});
await
instaService
.
invokeFunction
(
formatDocumentWithProvider
,
selected
,
editorOrModel
,
mode
,
token
);
}
}
...
...
src/vs/editor/contrib/format/formatActions.ts
浏览文件 @
df403aa0
...
...
@@ -25,6 +25,7 @@ import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegis
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
import
{
EditorOption
}
from
'
vs/editor/common/config/editorOptions
'
;
import
{
Progress
}
from
'
vs/platform/progress/common/progress
'
;
class
FormatOnType
implements
IEditorContribution
{
...
...
@@ -230,7 +231,7 @@ class FormatDocumentAction extends EditorAction {
async
run
(
accessor
:
ServicesAccessor
,
editor
:
ICodeEditor
):
Promise
<
void
>
{
if
(
editor
.
hasModel
())
{
const
instaService
=
accessor
.
get
(
IInstantiationService
);
await
instaService
.
invokeFunction
(
formatDocumentWithSelectedProvider
,
editor
,
FormattingMode
.
Explicit
,
CancellationToken
.
None
);
await
instaService
.
invokeFunction
(
formatDocumentWithSelectedProvider
,
editor
,
FormattingMode
.
Explicit
,
Progress
.
None
,
CancellationToken
.
None
);
}
}
}
...
...
src/vs/platform/progress/common/progress.ts
浏览文件 @
df403aa0
...
...
@@ -86,8 +86,6 @@ export interface IProgressRunner {
done
():
void
;
}
export
const
emptyProgress
:
IProgress
<
IProgressStep
>
=
{
report
:
()
=>
{
}
};
export
const
emptyProgressRunner
:
IProgressRunner
=
Object
.
freeze
({
total
()
{
},
worked
()
{
},
...
...
@@ -100,6 +98,8 @@ export interface IProgress<T> {
export
class
Progress
<
T
>
implements
IProgress
<
T
>
{
static
readonly
None
:
IProgress
<
any
>
=
Object
.
freeze
({
report
()
{
}
});
private
_value
?:
T
;
get
value
():
T
|
undefined
{
return
this
.
_value
;
}
...
...
src/vs/workbench/contrib/codeEditor/browser/saveParticipants.ts
浏览文件 @
df403aa0
...
...
@@ -215,7 +215,7 @@ class FormatOnSaveParticipant implements ITextFileSaveParticipant {
progress
.
report
({
message
:
localize
(
'
formatting
'
,
"
Formatting
"
)
});
const
editorOrModel
=
findEditor
(
model
,
this
.
codeEditorService
)
||
model
;
await
this
.
instantiationService
.
invokeFunction
(
formatDocumentWithSelectedProvider
,
editorOrModel
,
FormattingMode
.
Silent
,
token
);
await
this
.
instantiationService
.
invokeFunction
(
formatDocumentWithSelectedProvider
,
editorOrModel
,
FormattingMode
.
Silent
,
progress
,
token
);
}
}
...
...
src/vs/workbench/services/bulkEdit/browser/bulkEditService.ts
浏览文件 @
df403aa0
...
...
@@ -18,7 +18,7 @@ import { localize } from 'vs/nls';
import
{
IFileService
,
FileSystemProviderCapabilities
}
from
'
vs/platform/files/common/files
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
IProgress
,
IProgressStep
,
empty
Progress
}
from
'
vs/platform/progress/common/progress
'
;
import
{
IProgress
,
IProgressStep
,
Progress
}
from
'
vs/platform/progress/common/progress
'
;
import
{
IEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
ITextFileService
}
from
'
vs/workbench/services/textfile/common/textfiles
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
...
...
@@ -242,7 +242,7 @@ class BulkEdit {
@
IConfigurationService
private
readonly
_configurationService
:
IConfigurationService
)
{
this
.
_editor
=
editor
;
this
.
_progress
=
progress
||
emptyProgress
;
this
.
_progress
=
progress
||
Progress
.
None
;
this
.
_edits
=
edits
;
}
...
...
src/vs/workbench/test/browser/workbenchTestServices.ts
浏览文件 @
df403aa0
...
...
@@ -90,7 +90,7 @@ import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/
import
{
createTextBufferFactoryFromStream
}
from
'
vs/editor/common/model/textModel
'
;
import
{
IRemotePathService
}
from
'
vs/workbench/services/path/common/remotePathService
'
;
import
{
Direction
}
from
'
vs/base/browser/ui/grid/grid
'
;
import
{
IProgressService
,
IProgressOptions
,
IProgressWindowOptions
,
IProgressNotificationOptions
,
IProgressCompositeOptions
,
IProgress
,
IProgressStep
,
empty
Progress
}
from
'
vs/platform/progress/common/progress
'
;
import
{
IProgressService
,
IProgressOptions
,
IProgressWindowOptions
,
IProgressNotificationOptions
,
IProgressCompositeOptions
,
IProgress
,
IProgressStep
,
Progress
}
from
'
vs/platform/progress/common/progress
'
;
import
{
IWorkingCopyFileService
,
WorkingCopyFileService
}
from
'
vs/workbench/services/workingCopy/common/workingCopyFileService
'
;
import
{
UndoRedoService
}
from
'
vs/platform/undoRedo/common/undoRedoService
'
;
import
{
IUndoRedoService
}
from
'
vs/platform/undoRedo/common/undoRedo
'
;
...
...
@@ -260,7 +260,7 @@ export class TestProgressService implements IProgressService {
task
:
(
progress
:
IProgress
<
IProgressStep
>
)
=>
Promise
<
any
>
,
onDidCancel
?:
((
choice
?:
number
|
undefined
)
=>
void
)
|
undefined
):
Promise
<
any
>
{
return
task
(
emptyProgress
);
return
task
(
Progress
.
None
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录