Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
6d973fef
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,发现更多精彩内容 >>
提交
6d973fef
编写于
2月 10, 2019
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Strict null work on main thread
上级
f9687fc5
变更
19
显示空白变更内容
内联
并排
Showing
19 changed file
with
70 addition
and
61 deletion
+70
-61
src/vs/editor/browser/services/bulkEditService.ts
src/vs/editor/browser/services/bulkEditService.ts
+1
-1
src/vs/editor/standalone/browser/simpleServices.ts
src/vs/editor/standalone/browser/simpleServices.ts
+1
-1
src/vs/platform/files/common/files.ts
src/vs/platform/files/common/files.ts
+1
-1
src/vs/workbench/api/electron-browser/mainThreadDecorations.ts
...s/workbench/api/electron-browser/mainThreadDecorations.ts
+8
-4
src/vs/workbench/api/electron-browser/mainThreadDocuments.ts
src/vs/workbench/api/electron-browser/mainThreadDocuments.ts
+2
-2
src/vs/workbench/api/electron-browser/mainThreadDocumentsAndEditors.ts
...nch/api/electron-browser/mainThreadDocumentsAndEditors.ts
+12
-12
src/vs/workbench/api/electron-browser/mainThreadEditor.ts
src/vs/workbench/api/electron-browser/mainThreadEditor.ts
+3
-4
src/vs/workbench/api/electron-browser/mainThreadEditors.ts
src/vs/workbench/api/electron-browser/mainThreadEditors.ts
+4
-4
src/vs/workbench/api/electron-browser/mainThreadLanguageFeatures.ts
...kbench/api/electron-browser/mainThreadLanguageFeatures.ts
+7
-7
src/vs/workbench/api/electron-browser/mainThreadTreeViews.ts
src/vs/workbench/api/electron-browser/mainThreadTreeViews.ts
+5
-2
src/vs/workbench/api/electron-browser/mainThreadWebview.ts
src/vs/workbench/api/electron-browser/mainThreadWebview.ts
+6
-6
src/vs/workbench/api/node/extHostTypeConverters.ts
src/vs/workbench/api/node/extHostTypeConverters.ts
+6
-3
src/vs/workbench/api/node/extHostTypes.ts
src/vs/workbench/api/node/extHostTypes.ts
+2
-2
src/vs/workbench/browser/parts/editor/resourceViewer.ts
src/vs/workbench/browser/parts/editor/resourceViewer.ts
+1
-1
src/vs/workbench/common/editor/binaryEditorModel.ts
src/vs/workbench/common/editor/binaryEditorModel.ts
+2
-2
src/vs/workbench/services/decorations/browser/decorations.ts
src/vs/workbench/services/decorations/browser/decorations.ts
+1
-1
src/vs/workbench/services/decorations/browser/decorationsService.ts
...kbench/services/decorations/browser/decorationsService.ts
+1
-1
src/vs/workbench/services/extensions/electron-browser/extensionService.ts
.../services/extensions/electron-browser/extensionService.ts
+5
-5
src/vs/workbench/services/extensions/node/extensionDescriptionRegistry.ts
.../services/extensions/node/extensionDescriptionRegistry.ts
+2
-2
未找到文件。
src/vs/editor/browser/services/bulkEditService.ts
浏览文件 @
6d973fef
...
...
@@ -23,6 +23,6 @@ export interface IBulkEditResult {
export
interface
IBulkEditService
{
_serviceBrand
:
any
;
apply
(
edit
:
WorkspaceEdit
,
options
:
IBulkEditOptions
):
Promise
<
IBulkEditResult
>
;
apply
(
edit
:
WorkspaceEdit
,
options
?
:
IBulkEditOptions
):
Promise
<
IBulkEditResult
>
;
}
src/vs/editor/standalone/browser/simpleServices.ts
浏览文件 @
6d973fef
...
...
@@ -576,7 +576,7 @@ export class SimpleBulkEditService implements IBulkEditService {
//
}
apply
(
workspaceEdit
:
WorkspaceEdit
,
options
:
IBulkEditOptions
):
Promise
<
IBulkEditResult
>
{
apply
(
workspaceEdit
:
WorkspaceEdit
,
options
?
:
IBulkEditOptions
):
Promise
<
IBulkEditResult
>
{
let
edits
=
new
Map
<
ITextModel
,
TextEdit
[]
>
();
...
...
src/vs/platform/files/common/files.ts
浏览文件 @
6d973fef
...
...
@@ -419,7 +419,7 @@ export interface IBaseStat {
* A unique identifier thet represents the
* current state of the file or directory.
*/
etag
:
string
;
etag
?
:
string
;
/**
* The resource is readonly.
...
...
src/vs/workbench/api/electron-browser/mainThreadDecorations.ts
浏览文件 @
6d973fef
...
...
@@ -109,13 +109,17 @@ export class MainThreadDecorations implements MainThreadDecorationsShape {
}
$onDidChange
(
handle
:
number
,
resources
:
UriComponents
[]):
void
{
const
[
emitter
]
=
this
.
_provider
.
get
(
handle
);
const
provider
=
this
.
_provider
.
get
(
handle
);
if
(
provider
)
{
const
[
emitter
]
=
provider
;
emitter
.
fire
(
resources
&&
resources
.
map
(
URI
.
revive
));
}
}
$unregisterDecorationProvider
(
handle
:
number
):
void
{
if
(
this
.
_provider
.
has
(
handle
))
{
dispose
(
this
.
_provider
.
get
(
handle
));
const
provider
=
this
.
_provider
.
get
(
handle
);
if
(
provider
)
{
dispose
(
provider
);
this
.
_provider
.
delete
(
handle
);
}
}
...
...
src/vs/workbench/api/electron-browser/mainThreadDocuments.ts
浏览文件 @
6d973fef
...
...
@@ -130,14 +130,14 @@ export class MainThreadDocuments implements MainThreadDocumentsShape {
private
_shouldHandleFileEvent
(
e
:
TextFileModelChangeEvent
):
boolean
{
const
model
=
this
.
_modelService
.
getModel
(
e
.
resource
);
return
model
&&
shouldSynchronizeModel
(
model
);
return
!!
model
&&
shouldSynchronizeModel
(
model
);
}
private
_onModelAdded
(
model
:
ITextModel
):
void
{
// Same filter as in mainThreadEditorsTracker
if
(
!
shouldSynchronizeModel
(
model
))
{
// don't synchronize too large models
return
null
;
return
;
}
let
modelUrl
=
model
.
uri
;
this
.
_modelIsSynced
[
modelUrl
.
toString
()]
=
true
;
...
...
src/vs/workbench/api/electron-browser/mainThreadDocumentsAndEditors.ts
浏览文件 @
6d973fef
...
...
@@ -7,7 +7,7 @@ import { Emitter, Event } from 'vs/base/common/event';
import
{
IDisposable
,
combinedDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
values
}
from
'
vs/base/common/map
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
ICodeEditor
,
isCodeEditor
,
isDiffEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
ICodeEditor
,
isCodeEditor
,
isDiffEditor
,
IActiveCodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
IBulkEditService
}
from
'
vs/editor/browser/services/bulkEditService
'
;
import
{
ICodeEditorService
}
from
'
vs/editor/browser/services/codeEditorService
'
;
import
{
IEditor
}
from
'
vs/editor/common/editorCommon
'
;
...
...
@@ -70,7 +70,7 @@ class TextEditorSnapshot {
readonly
id
:
string
;
constructor
(
readonly
editor
:
ICodeEditor
,
readonly
editor
:
I
Active
CodeEditor
,
)
{
this
.
id
=
`
${
editor
.
getId
()}
,
${
editor
.
getModel
().
id
}
`
;
}
...
...
@@ -85,8 +85,8 @@ class DocumentAndEditorStateDelta {
readonly
addedDocuments
:
ITextModel
[],
readonly
removedEditors
:
TextEditorSnapshot
[],
readonly
addedEditors
:
TextEditorSnapshot
[],
readonly
oldActiveEditor
:
string
,
readonly
newActiveEditor
:
string
,
readonly
oldActiveEditor
:
string
|
undefined
,
readonly
newActiveEditor
:
string
|
undefined
,
)
{
this
.
isEmpty
=
this
.
removedDocuments
.
length
===
0
&&
this
.
addedDocuments
.
length
===
0
...
...
@@ -131,7 +131,7 @@ class DocumentAndEditorState {
constructor
(
readonly
documents
:
Set
<
ITextModel
>
,
readonly
textEditors
:
Map
<
string
,
TextEditorSnapshot
>
,
readonly
activeEditor
:
string
,
readonly
activeEditor
:
string
|
undefined
,
)
{
//
}
...
...
@@ -230,14 +230,14 @@ class MainThreadDocumentAndEditorStateComputer {
// editor: only take those that have a not too large model
const
editors
=
new
Map
<
string
,
TextEditorSnapshot
>
();
let
activeEditor
:
string
|
null
=
null
;
let
activeEditor
:
string
|
undefined
=
undefined
;
for
(
const
editor
of
this
.
_codeEditorService
.
listCodeEditors
())
{
if
(
editor
.
isSimpleWidget
)
{
continue
;
}
const
model
=
editor
.
getModel
();
if
(
model
&&
shouldSynchronizeModel
(
model
)
if
(
editor
.
hasModel
()
&&
model
&&
shouldSynchronizeModel
(
model
)
&&
!
model
.
isDisposed
()
// model disposed
&&
Boolean
(
this
.
_modelService
.
getModel
(
model
.
uri
))
// model disposing, the flag didn't flip yet but the model service already removed it
)
{
...
...
@@ -282,7 +282,7 @@ class MainThreadDocumentAndEditorStateComputer {
}
}
private
_getActiveEditorFromPanel
():
IEditor
{
private
_getActiveEditorFromPanel
():
IEditor
|
undefined
{
let
panel
=
this
.
_panelService
.
getActivePanel
();
if
(
panel
instanceof
BaseTextEditor
&&
isCodeEditor
(
panel
.
getControl
()))
{
return
panel
.
getControl
();
...
...
@@ -444,8 +444,8 @@ export class MainThreadDocumentsAndEditors {
};
}
private
_findEditorPosition
(
editor
:
MainThreadTextEditor
):
EditorViewColumn
{
for
(
le
t
workbenchEditor
of
this
.
_editorService
.
visibleControls
)
{
private
_findEditorPosition
(
editor
:
MainThreadTextEditor
):
EditorViewColumn
|
undefined
{
for
(
cons
t
workbenchEditor
of
this
.
_editorService
.
visibleControls
)
{
if
(
editor
.
matches
(
workbenchEditor
))
{
return
editorGroupToViewColumn
(
this
.
_editorGroupService
,
workbenchEditor
.
group
);
}
...
...
@@ -453,8 +453,8 @@ export class MainThreadDocumentsAndEditors {
return
undefined
;
}
findTextEditorIdFor
(
editor
:
IWorkbenchEditor
):
string
{
for
(
le
t
id
in
this
.
_textEditors
)
{
findTextEditorIdFor
(
editor
:
IWorkbenchEditor
):
string
|
undefined
{
for
(
cons
t
id
in
this
.
_textEditors
)
{
if
(
this
.
_textEditors
[
id
].
matches
(
editor
))
{
return
id
;
}
...
...
src/vs/workbench/api/electron-browser/mainThreadEditor.ts
浏览文件 @
6d973fef
...
...
@@ -187,7 +187,7 @@ export class MainThreadTextEditor {
private
_focusTracker
:
IFocusTracker
;
private
_codeEditorListeners
:
IDisposable
[];
private
_properties
:
MainThreadTextEditorProperties
|
null
;
private
_properties
:
MainThreadTextEditorProperties
;
private
readonly
_onPropertiesChanged
:
Emitter
<
IEditorPropertiesChangeData
>
;
constructor
(
...
...
@@ -204,7 +204,6 @@ export class MainThreadTextEditor {
this
.
_modelService
=
modelService
;
this
.
_codeEditorListeners
=
[];
this
.
_properties
=
null
;
this
.
_onPropertiesChanged
=
new
Emitter
<
IEditorPropertiesChangeData
>
();
this
.
_modelListeners
=
[];
...
...
@@ -300,7 +299,7 @@ export class MainThreadTextEditor {
return
!!
this
.
_codeEditor
;
}
public
getProperties
():
MainThreadTextEditorProperties
|
null
{
public
getProperties
():
MainThreadTextEditorProperties
{
return
this
.
_properties
;
}
...
...
@@ -316,7 +315,7 @@ export class MainThreadTextEditor {
const
newSelections
=
selections
.
map
(
Selection
.
liftSelection
);
this
.
_setProperties
(
new
MainThreadTextEditorProperties
(
newSelections
,
this
.
_properties
!
.
options
,
this
.
_properties
!
.
visibleRanges
),
new
MainThreadTextEditorProperties
(
newSelections
,
this
.
_properties
.
options
,
this
.
_properties
.
visibleRanges
),
null
);
}
...
...
src/vs/workbench/api/electron-browser/mainThreadEditors.ts
浏览文件 @
6d973fef
...
...
@@ -36,7 +36,7 @@ export class MainThreadTextEditors implements MainThreadTextEditorsShape {
private
_documentsAndEditors
:
MainThreadDocumentsAndEditors
;
private
_toDispose
:
IDisposable
[];
private
_textEditorsListenersMap
:
{
[
editorId
:
string
]:
IDisposable
[];
};
private
_editorPositionData
:
ITextEditorPositionData
;
private
_editorPositionData
:
ITextEditorPositionData
|
null
;
private
_registeredDecorationTypes
:
{
[
decorationType
:
string
]:
boolean
;
};
constructor
(
...
...
@@ -145,7 +145,7 @@ export class MainThreadTextEditors implements MainThreadTextEditorsShape {
options
:
{
preserveFocus
:
false
}
},
viewColumnToEditorGroup
(
this
.
_editorGroupService
,
position
)).
then
(()
=>
{
return
;
});
}
return
undefined
;
return
Promise
.
resolve
()
;
}
$tryHideEditor
(
id
:
string
):
Promise
<
void
>
{
...
...
@@ -158,7 +158,7 @@ export class MainThreadTextEditors implements MainThreadTextEditorsShape {
}
}
}
return
undefined
;
return
Promise
.
resolve
()
;
}
$trySetSelections
(
id
:
string
,
selections
:
ISelection
[]):
Promise
<
void
>
{
...
...
@@ -192,7 +192,7 @@ export class MainThreadTextEditors implements MainThreadTextEditorsShape {
return
Promise
.
reject
(
disposed
(
`TextEditor(
${
id
}
)`
));
}
this
.
_documentsAndEditors
.
getEditor
(
id
).
revealRange
(
range
,
revealType
);
return
undefined
;
return
Promise
.
resolve
()
;
}
$trySetOptions
(
id
:
string
,
options
:
ITextEditorConfigurationUpdate
):
Promise
<
void
>
{
...
...
src/vs/workbench/api/electron-browser/mainThreadLanguageFeatures.ts
浏览文件 @
6d973fef
...
...
@@ -198,7 +198,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
$registerHoverProvider
(
handle
:
number
,
selector
:
ISerializedDocumentFilter
[]):
void
{
this
.
_registrations
[
handle
]
=
modes
.
HoverProviderRegistry
.
register
(
typeConverters
.
LanguageSelector
.
from
(
selector
),
<
modes
.
HoverProvider
>
{
provideHover
:
(
model
:
ITextModel
,
position
:
EditorPosition
,
token
:
CancellationToken
):
Promise
<
modes
.
Hover
>
=>
{
provideHover
:
(
model
:
ITextModel
,
position
:
EditorPosition
,
token
:
CancellationToken
):
Promise
<
modes
.
Hover
|
undefined
>
=>
{
return
this
.
_proxy
.
$provideHover
(
handle
,
model
.
uri
,
position
,
token
);
}
});
...
...
@@ -208,7 +208,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
$registerDocumentHighlightProvider
(
handle
:
number
,
selector
:
ISerializedDocumentFilter
[]):
void
{
this
.
_registrations
[
handle
]
=
modes
.
DocumentHighlightProviderRegistry
.
register
(
typeConverters
.
LanguageSelector
.
from
(
selector
),
<
modes
.
DocumentHighlightProvider
>
{
provideDocumentHighlights
:
(
model
:
ITextModel
,
position
:
EditorPosition
,
token
:
CancellationToken
):
Promise
<
modes
.
DocumentHighlight
[]
>
=>
{
provideDocumentHighlights
:
(
model
:
ITextModel
,
position
:
EditorPosition
,
token
:
CancellationToken
):
Promise
<
modes
.
DocumentHighlight
[]
|
undefined
>
=>
{
return
this
.
_proxy
.
$provideDocumentHighlights
(
handle
,
model
.
uri
,
position
,
token
);
}
});
...
...
@@ -243,7 +243,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
$registerDocumentFormattingSupport
(
handle
:
number
,
selector
:
ISerializedDocumentFilter
[],
displayName
:
string
):
void
{
this
.
_registrations
[
handle
]
=
modes
.
DocumentFormattingEditProviderRegistry
.
register
(
typeConverters
.
LanguageSelector
.
from
(
selector
),
<
modes
.
DocumentFormattingEditProvider
>
{
displayName
,
provideDocumentFormattingEdits
:
(
model
:
ITextModel
,
options
:
modes
.
FormattingOptions
,
token
:
CancellationToken
):
Promise
<
ISingleEditOperation
[]
>
=>
{
provideDocumentFormattingEdits
:
(
model
:
ITextModel
,
options
:
modes
.
FormattingOptions
,
token
:
CancellationToken
):
Promise
<
ISingleEditOperation
[]
|
undefined
>
=>
{
return
this
.
_proxy
.
$provideDocumentFormattingEdits
(
handle
,
model
.
uri
,
options
,
token
);
}
});
...
...
@@ -252,7 +252,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
$registerRangeFormattingSupport
(
handle
:
number
,
selector
:
ISerializedDocumentFilter
[],
displayName
:
string
):
void
{
this
.
_registrations
[
handle
]
=
modes
.
DocumentRangeFormattingEditProviderRegistry
.
register
(
typeConverters
.
LanguageSelector
.
from
(
selector
),
<
modes
.
DocumentRangeFormattingEditProvider
>
{
displayName
,
provideDocumentRangeFormattingEdits
:
(
model
:
ITextModel
,
range
:
EditorRange
,
options
:
modes
.
FormattingOptions
,
token
:
CancellationToken
):
Promise
<
ISingleEditOperation
[]
>
=>
{
provideDocumentRangeFormattingEdits
:
(
model
:
ITextModel
,
range
:
EditorRange
,
options
:
modes
.
FormattingOptions
,
token
:
CancellationToken
):
Promise
<
ISingleEditOperation
[]
|
undefined
>
=>
{
return
this
.
_proxy
.
$provideDocumentRangeFormattingEdits
(
handle
,
model
.
uri
,
range
,
options
,
token
);
}
});
...
...
@@ -263,7 +263,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
autoFormatTriggerCharacters
,
provideOnTypeFormattingEdits
:
(
model
:
ITextModel
,
position
:
EditorPosition
,
ch
:
string
,
options
:
modes
.
FormattingOptions
,
token
:
CancellationToken
):
Promise
<
ISingleEditOperation
[]
>
=>
{
provideOnTypeFormattingEdits
:
(
model
:
ITextModel
,
position
:
EditorPosition
,
ch
:
string
,
options
:
modes
.
FormattingOptions
,
token
:
CancellationToken
):
Promise
<
ISingleEditOperation
[]
|
undefined
>
=>
{
return
this
.
_proxy
.
$provideOnTypeFormattingEdits
(
handle
,
model
.
uri
,
position
,
ch
,
options
,
token
);
}
});
...
...
@@ -272,7 +272,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
// --- navigate type
$registerNavigateTypeSupport
(
handle
:
number
):
void
{
let
lastResultId
:
number
;
let
lastResultId
:
number
|
undefined
;
this
.
_registrations
[
handle
]
=
search
.
WorkspaceSymbolProviderRegistry
.
register
(
<
search
.
IWorkspaceSymbolProvider
>
{
provideWorkspaceSymbols
:
(
search
:
string
,
token
:
CancellationToken
):
Promise
<
search
.
IWorkspaceSymbol
[]
>
=>
{
return
this
.
_proxy
.
$provideWorkspaceSymbols
(
handle
,
search
,
token
).
then
(
result
=>
{
...
...
@@ -298,7 +298,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
return
this
.
_proxy
.
$provideRenameEdits
(
handle
,
model
.
uri
,
position
,
newName
,
token
).
then
(
reviveWorkspaceEditDto
);
},
resolveRenameLocation
:
supportResolveLocation
?
(
model
:
ITextModel
,
position
:
EditorPosition
,
token
:
CancellationToken
):
Promise
<
modes
.
RenameLocation
>
=>
this
.
_proxy
.
$resolveRenameLocation
(
handle
,
model
.
uri
,
position
,
token
)
?
(
model
:
ITextModel
,
position
:
EditorPosition
,
token
:
CancellationToken
):
Promise
<
modes
.
RenameLocation
|
undefined
>
=>
this
.
_proxy
.
$resolveRenameLocation
(
handle
,
model
.
uri
,
position
,
token
)
:
undefined
});
}
...
...
src/vs/workbench/api/electron-browser/mainThreadTreeViews.ts
浏览文件 @
6d973fef
...
...
@@ -45,7 +45,10 @@ export class MainThreadTreeViews extends Disposable implements MainThreadTreeVie
return
this
.
viewsService
.
openView
(
treeViewId
,
options
.
focus
)
.
then
(()
=>
{
const
viewer
=
this
.
getTreeView
(
treeViewId
);
return
this
.
reveal
(
viewer
,
this
.
_dataProviders
.
get
(
treeViewId
),
item
,
parentChain
,
options
);
if
(
viewer
)
{
return
this
.
reveal
(
viewer
,
this
.
_dataProviders
.
get
(
treeViewId
)
!
,
item
,
parentChain
,
options
);
}
return
undefined
;
});
}
...
...
@@ -56,7 +59,7 @@ export class MainThreadTreeViews extends Disposable implements MainThreadTreeVie
const
itemsToRefresh
=
dataProvider
.
getItemsToRefresh
(
itemsToRefreshByHandle
);
return
viewer
.
refresh
(
itemsToRefresh
.
length
?
itemsToRefresh
:
undefined
);
}
return
null
;
return
Promise
.
resolve
()
;
}
$setMessage
(
treeViewId
:
string
,
message
:
string
|
IMarkdownString
):
void
{
...
...
src/vs/workbench/api/electron-browser/mainThreadWebview.ts
浏览文件 @
6d973fef
...
...
@@ -68,14 +68,14 @@ export class MainThreadWebviews implements MainThreadWebviewsShape, WebviewReviv
handle
:
WebviewPanelHandle
,
viewType
:
string
,
title
:
string
,
showOptions
:
{
viewColumn
:
EditorViewColumn
|
null
,
preserveFocus
:
boolean
},
showOptions
:
{
viewColumn
?:
EditorViewColumn
,
preserveFocus
?
:
boolean
},
options
:
WebviewInputOptions
,
extensionId
:
ExtensionIdentifier
,
extensionLocation
:
UriComponents
):
void
{
const
mainThreadShowOptions
:
ICreateWebViewShowOptions
=
Object
.
create
(
null
);
if
(
showOptions
)
{
mainThreadShowOptions
.
preserveFocus
=
showOptions
.
preserveFocus
;
mainThreadShowOptions
.
preserveFocus
=
!!
showOptions
.
preserveFocus
;
mainThreadShowOptions
.
group
=
viewColumnToEditorGroup
(
this
.
_editorGroupService
,
showOptions
.
viewColumn
);
}
...
...
@@ -129,7 +129,7 @@ export class MainThreadWebviews implements MainThreadWebviewsShape, WebviewReviv
const
targetGroup
=
this
.
_editorGroupService
.
getGroup
(
viewColumnToEditorGroup
(
this
.
_editorGroupService
,
showOptions
.
viewColumn
));
this
.
_webviewService
.
revealWebview
(
webview
,
targetGroup
||
this
.
_editorGroupService
.
activeGroup
,
showOptions
.
preserveFocus
);
this
.
_webviewService
.
revealWebview
(
webview
,
targetGroup
||
this
.
_editorGroupService
.
activeGroup
,
!!
showOptions
.
preserveFocus
);
}
public
$postMessage
(
handle
:
WebviewPanelHandle
,
message
:
any
):
Promise
<
boolean
>
{
...
...
@@ -137,7 +137,7 @@ export class MainThreadWebviews implements MainThreadWebviewsShape, WebviewReviv
const
editors
=
this
.
_editorService
.
visibleControls
.
filter
(
e
=>
e
instanceof
WebviewEditor
)
.
map
(
e
=>
e
as
WebviewEditor
)
.
filter
(
e
=>
e
.
input
.
matches
(
webview
));
.
filter
(
e
=>
e
.
input
!
.
matches
(
webview
));
for
(
const
editor
of
editors
)
{
editor
.
sendMessage
(
message
);
...
...
@@ -216,7 +216,7 @@ export class MainThreadWebviews implements MainThreadWebviewsShape, WebviewReviv
let
newActiveWebview
:
{
input
:
WebviewEditorInput
,
handle
:
WebviewPanelHandle
}
|
undefined
=
undefined
;
if
(
activeEditor
&&
activeEditor
.
input
instanceof
WebviewEditorInput
)
{
for
(
const
handle
of
map
.
keys
(
this
.
_webviews
))
{
const
input
=
this
.
_webviews
.
get
(
handle
);
const
input
=
this
.
_webviews
.
get
(
handle
)
!
;
if
(
input
.
matches
(
activeEditor
.
input
))
{
newActiveWebview
=
{
input
,
handle
};
break
;
...
...
@@ -240,7 +240,7 @@ export class MainThreadWebviews implements MainThreadWebviewsShape, WebviewReviv
if
(
oldActiveWebview
)
{
this
.
_proxy
.
$onDidChangeWebviewPanelViewState
(
this
.
_activeWebview
,
{
active
:
false
,
visible
:
this
.
_editorService
.
visibleControls
.
some
(
editor
=>
editor
.
input
&&
editor
.
input
.
matches
(
oldActiveWebview
)),
visible
:
this
.
_editorService
.
visibleControls
.
some
(
editor
=>
!!
editor
.
input
&&
editor
.
input
.
matches
(
oldActiveWebview
)),
position
:
editorGroupToViewColumn
(
this
.
_editorGroupService
,
oldActiveWebview
.
group
),
});
}
...
...
src/vs/workbench/api/node/extHostTypeConverters.ts
浏览文件 @
6d973fef
...
...
@@ -443,7 +443,7 @@ export namespace TextEdit {
export
function
to
(
edit
:
modes
.
TextEdit
):
types
.
TextEdit
{
const
result
=
new
types
.
TextEdit
(
Range
.
to
(
edit
.
range
),
edit
.
text
);
result
.
newEol
=
typeof
edit
.
eol
===
'
undefined
'
?
undefined
:
EndOfLine
.
to
(
edit
.
eol
)
;
result
.
newEol
=
(
typeof
edit
.
eol
===
'
undefined
'
?
undefined
:
EndOfLine
.
to
(
edit
.
eol
))
!
;
return
result
;
}
}
...
...
@@ -457,7 +457,7 @@ export namespace WorkspaceEdit {
const
[
uri
,
uriOrEdits
]
=
entry
;
if
(
Array
.
isArray
(
uriOrEdits
))
{
// text edits
const
doc
=
documents
?
documents
.
getDocument
(
uri
.
toString
())
:
undefined
;
const
doc
=
documents
&&
uri
?
documents
.
getDocument
(
uri
.
toString
())
:
undefined
;
result
.
edits
.
push
(
<
ResourceTextEditDto
>
{
resource
:
uri
,
modelVersionId
:
doc
&&
doc
.
version
,
edits
:
uriOrEdits
.
map
(
TextEdit
.
from
)
});
}
else
{
// resource edits
...
...
@@ -986,6 +986,9 @@ export namespace GlobPattern {
export
namespace
LanguageSelector
{
export
function
from
(
selector
:
undefined
):
undefined
;
export
function
from
(
selector
:
vscode
.
DocumentSelector
):
languageSelector
.
LanguageSelector
;
export
function
from
(
selector
:
vscode
.
DocumentSelector
|
undefined
):
languageSelector
.
LanguageSelector
|
undefined
;
export
function
from
(
selector
:
vscode
.
DocumentSelector
|
undefined
):
languageSelector
.
LanguageSelector
|
undefined
{
if
(
!
selector
)
{
return
undefined
;
...
...
@@ -997,7 +1000,7 @@ export namespace LanguageSelector {
return
<
languageSelector
.
LanguageFilter
>
{
language
:
selector
.
language
,
scheme
:
selector
.
scheme
,
pattern
:
GlobPattern
.
from
(
selector
.
pattern
),
pattern
:
typeof
selector
.
pattern
===
'
undefined
'
?
undefined
:
GlobPattern
.
from
(
selector
.
pattern
),
exclusive
:
selector
.
exclusive
};
}
...
...
src/vs/workbench/api/node/extHostTypes.ts
浏览文件 @
6d973fef
...
...
@@ -948,9 +948,9 @@ export class SymbolInformation {
kind
:
SymbolKind
;
containerName
:
string
|
undefined
;
constructor
(
name
:
string
,
kind
:
SymbolKind
,
containerName
:
string
,
location
:
Location
);
constructor
(
name
:
string
,
kind
:
SymbolKind
,
containerName
:
string
|
undefined
,
location
:
Location
);
constructor
(
name
:
string
,
kind
:
SymbolKind
,
range
:
Range
,
uri
?:
URI
,
containerName
?:
string
);
constructor
(
name
:
string
,
kind
:
SymbolKind
,
rangeOrContainer
:
string
|
Range
,
locationOrUri
?:
Location
|
URI
,
containerName
?:
string
)
{
constructor
(
name
:
string
,
kind
:
SymbolKind
,
rangeOrContainer
:
string
|
undefined
|
Range
,
locationOrUri
?:
Location
|
URI
,
containerName
?:
string
)
{
this
.
name
=
name
;
this
.
kind
=
kind
;
this
.
containerName
=
containerName
;
...
...
src/vs/workbench/browser/parts/editor/resourceViewer.ts
浏览文件 @
6d973fef
...
...
@@ -27,7 +27,7 @@ export interface IResourceDescriptor {
readonly
resource
:
URI
;
readonly
name
:
string
;
readonly
size
:
number
;
readonly
etag
:
string
;
readonly
etag
?
:
string
;
readonly
mime
:
string
;
}
...
...
src/vs/workbench/common/editor/binaryEditorModel.ts
浏览文件 @
6d973fef
...
...
@@ -16,7 +16,7 @@ export class BinaryEditorModel extends EditorModel {
private
name
:
string
;
private
resource
:
URI
;
private
size
:
number
;
private
etag
:
string
;
private
etag
?
:
string
;
private
mime
:
string
;
constructor
(
...
...
@@ -70,7 +70,7 @@ export class BinaryEditorModel extends EditorModel {
/**
* The etag of the binary resource if known.
*/
getETag
():
string
{
getETag
():
string
|
undefined
{
return
this
.
etag
;
}
...
...
src/vs/workbench/services/decorations/browser/decorations.ts
浏览文件 @
6d973fef
...
...
@@ -31,7 +31,7 @@ export interface IDecoration {
export
interface
IDecorationsProvider
{
readonly
label
:
string
;
readonly
onDidChange
:
Event
<
URI
[]
>
;
provideDecorations
(
uri
:
URI
,
token
:
CancellationToken
):
IDecorationData
|
Promise
<
IDecorationData
>
|
undefined
;
provideDecorations
(
uri
:
URI
,
token
:
CancellationToken
):
IDecorationData
|
Promise
<
IDecorationData
|
undefined
>
|
undefined
;
}
export
interface
IResourceDecorationChangeEvent
{
...
...
src/vs/workbench/services/decorations/browser/decorationsService.ts
浏览文件 @
6d973fef
...
...
@@ -301,7 +301,7 @@ class DecorationProviderWrapper {
const
source
=
new
CancellationTokenSource
();
const
dataOrThenable
=
this
.
_provider
.
provideDecorations
(
uri
,
source
.
token
);
if
(
!
isThenable
(
dataOrThenable
))
{
if
(
!
isThenable
<
IDecorationData
|
Promise
<
IDecorationData
|
undefined
>
|
undefined
>
(
dataOrThenable
))
{
// sync -> we have a result now
return
this
.
_keepItem
(
uri
,
dataOrThenable
);
...
...
src/vs/workbench/services/extensions/electron-browser/extensionService.ts
浏览文件 @
6d973fef
...
...
@@ -37,13 +37,13 @@ const NO_OP_VOID_PROMISE = Promise.resolve<void>(undefined);
schema
.
properties
.
engines
.
properties
.
vscode
.
default
=
`^
${
pkg
.
version
}
`
;
let
productAllowProposedApi
:
Set
<
string
>
=
null
;
let
productAllowProposedApi
:
Set
<
string
>
|
null
=
null
;
function
allowProposedApiFromProduct
(
id
:
ExtensionIdentifier
):
boolean
{
// create set if needed
if
(
productAllowProposedApi
===
null
)
{
if
(
!
productAllowProposedApi
)
{
productAllowProposedApi
=
new
Set
<
string
>
();
if
(
isNonEmptyArray
(
product
.
extensionAllowedProposedApi
))
{
product
.
extensionAllowedProposedApi
.
forEach
((
id
)
=>
productAllowProposedApi
.
add
(
ExtensionIdentifier
.
toKey
(
id
)));
product
.
extensionAllowedProposedApi
.
forEach
((
id
)
=>
productAllowProposedApi
!
.
add
(
ExtensionIdentifier
.
toKey
(
id
)));
}
}
return
productAllowProposedApi
.
has
(
ExtensionIdentifier
.
toKey
(
id
));
...
...
@@ -167,7 +167,7 @@ export class ExtensionService extends Disposable implements IExtensionService {
}
while
(
this
.
_deltaExtensionsQueue
.
length
>
0
)
{
const
item
=
this
.
_deltaExtensionsQueue
.
shift
();
const
item
=
this
.
_deltaExtensionsQueue
.
shift
()
!
;
try
{
this
.
_inHandleDeltaExtensions
=
true
;
await
this
.
_deltaExtensions
(
item
.
toAdd
,
item
.
toRemove
);
...
...
@@ -856,7 +856,7 @@ export class ExtensionService extends Disposable implements IExtensionService {
if
(
!
this
.
_extensionsMessages
.
has
(
extensionKey
))
{
this
.
_extensionsMessages
.
set
(
extensionKey
,
[]);
}
this
.
_extensionsMessages
.
get
(
extensionKey
).
push
({
this
.
_extensionsMessages
.
get
(
extensionKey
)
!
.
push
({
type
:
severity
,
message
:
message
,
extensionId
:
null
,
...
...
src/vs/workbench/services/extensions/node/extensionDescriptionRegistry.ts
浏览文件 @
6d973fef
...
...
@@ -189,8 +189,8 @@ export class ExtensionDescriptionRegistry {
return
this
.
_extensionsArr
.
slice
(
0
);
}
public
getExtensionDescription
(
extensionId
:
ExtensionIdentifier
|
string
):
IExtensionDescription
|
null
{
public
getExtensionDescription
(
extensionId
:
ExtensionIdentifier
|
string
):
IExtensionDescription
|
undefined
{
const
extension
=
this
.
_extensionsMap
.
get
(
ExtensionIdentifier
.
toKey
(
extensionId
));
return
extension
?
extension
:
null
;
return
extension
?
extension
:
undefined
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录