Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
57b3fc8a
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,发现更多精彩内容 >>
提交
57b3fc8a
编写于
2月 14, 2019
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Explicitly convert undefined and null to false if they are used in place of boolean value
part of strict null work
上级
48db68b4
变更
26
隐藏空白更改
内联
并排
Showing
26 changed file
with
47 addition
and
47 deletion
+47
-47
src/vs/workbench/browser/parts/editor/editorStatus.ts
src/vs/workbench/browser/parts/editor/editorStatus.ts
+1
-1
src/vs/workbench/browser/parts/views/customView.ts
src/vs/workbench/browser/parts/views/customView.ts
+1
-1
src/vs/workbench/contrib/codeinset/electron-browser/codeInsetWidget.ts
...nch/contrib/codeinset/electron-browser/codeInsetWidget.ts
+1
-1
src/vs/workbench/contrib/debug/browser/debugActions.ts
src/vs/workbench/contrib/debug/browser/debugActions.ts
+5
-5
src/vs/workbench/contrib/debug/common/debugModel.ts
src/vs/workbench/contrib/debug/common/debugModel.ts
+1
-1
src/vs/workbench/contrib/debug/electron-browser/callStackView.ts
...workbench/contrib/debug/electron-browser/callStackView.ts
+1
-1
src/vs/workbench/contrib/debug/node/debugger.ts
src/vs/workbench/contrib/debug/node/debugger.ts
+2
-2
src/vs/workbench/contrib/extensions/electron-browser/extensionEditor.ts
...ch/contrib/extensions/electron-browser/extensionEditor.ts
+1
-1
src/vs/workbench/contrib/files/electron-browser/views/explorerView.ts
...ench/contrib/files/electron-browser/views/explorerView.ts
+2
-2
src/vs/workbench/contrib/files/electron-browser/views/explorerViewer.ts
...ch/contrib/files/electron-browser/views/explorerViewer.ts
+1
-1
src/vs/workbench/contrib/markers/electron-browser/markersPanel.ts
...orkbench/contrib/markers/electron-browser/markersPanel.ts
+1
-1
src/vs/workbench/contrib/markers/electron-browser/markersTreeViewer.ts
...nch/contrib/markers/electron-browser/markersTreeViewer.ts
+1
-1
src/vs/workbench/contrib/output/browser/outputActions.ts
src/vs/workbench/contrib/output/browser/outputActions.ts
+1
-1
src/vs/workbench/contrib/output/electron-browser/outputServices.ts
...rkbench/contrib/output/electron-browser/outputServices.ts
+3
-3
src/vs/workbench/contrib/preferences/browser/keybindingsEditor.ts
...orkbench/contrib/preferences/browser/keybindingsEditor.ts
+1
-1
src/vs/workbench/contrib/preferences/browser/preferencesEditor.ts
...orkbench/contrib/preferences/browser/preferencesEditor.ts
+1
-1
src/vs/workbench/contrib/preferences/electron-browser/settingsEditor2.ts
...h/contrib/preferences/electron-browser/settingsEditor2.ts
+1
-1
src/vs/workbench/contrib/search/browser/searchActions.ts
src/vs/workbench/contrib/search/browser/searchActions.ts
+5
-5
src/vs/workbench/contrib/search/browser/searchWidget.ts
src/vs/workbench/contrib/search/browser/searchWidget.ts
+1
-1
src/vs/workbench/contrib/terminal/electron-browser/terminalPanel.ts
...kbench/contrib/terminal/electron-browser/terminalPanel.ts
+1
-1
src/vs/workbench/electron-browser/workbench.ts
src/vs/workbench/electron-browser/workbench.ts
+5
-5
src/vs/workbench/services/configuration/node/configurationEditingService.ts
...ervices/configuration/node/configurationEditingService.ts
+1
-1
src/vs/workbench/services/files/electron-browser/fileService.ts
.../workbench/services/files/electron-browser/fileService.ts
+3
-3
src/vs/workbench/services/files/electron-browser/remoteFileService.ts
...ench/services/files/electron-browser/remoteFileService.ts
+3
-3
src/vs/workbench/services/textfile/common/textFileEditorModel.ts
...workbench/services/textfile/common/textFileEditorModel.ts
+1
-1
src/vs/workbench/services/textfile/common/textFileService.ts
src/vs/workbench/services/textfile/common/textFileService.ts
+2
-2
未找到文件。
src/vs/workbench/browser/parts/editor/editorStatus.ts
浏览文件 @
57b3fc8a
...
...
@@ -796,7 +796,7 @@ export class EditorStatus implements IStatusbarItem {
private
isActiveEditor
(
control
:
IBaseEditor
):
boolean
{
const
activeControl
=
this
.
editorService
.
activeControl
;
return
activeControl
&&
activeControl
===
control
;
return
!!
activeControl
&&
activeControl
===
control
;
}
}
...
...
src/vs/workbench/browser/parts/views/customView.ts
浏览文件 @
57b3fc8a
...
...
@@ -582,7 +582,7 @@ class TreeDataSource implements IDataSource {
}
hasChildren
(
tree
:
ITree
,
node
:
ITreeItem
):
boolean
{
return
this
.
treeView
.
dataProvider
&&
node
.
collapsibleState
!==
TreeItemCollapsibleState
.
None
;
return
!!
this
.
treeView
.
dataProvider
&&
node
.
collapsibleState
!==
TreeItemCollapsibleState
.
None
;
}
getChildren
(
tree
:
ITree
,
node
:
ITreeItem
):
Promise
<
any
[]
>
{
...
...
src/vs/workbench/contrib/codeinset/electron-browser/codeInsetWidget.ts
浏览文件 @
57b3fc8a
...
...
@@ -97,7 +97,7 @@ export class CodeInsetWidget {
return
this
.
_decorationIds
.
some
((
id
,
i
)
=>
{
const
range
=
this
.
_editor
.
getModel
().
getDecorationRange
(
id
);
const
symbol
=
this
.
_data
[
i
].
symbol
;
return
range
&&
Range
.
isEmpty
(
symbol
.
range
)
===
range
.
isEmpty
();
return
!!
range
&&
Range
.
isEmpty
(
symbol
.
range
)
===
range
.
isEmpty
();
});
}
...
...
src/vs/workbench/contrib/debug/browser/debugActions.ts
浏览文件 @
57b3fc8a
...
...
@@ -594,7 +594,7 @@ export class SetValueAction extends AbstractDebugAction {
protected
isEnabled
(
state
:
State
):
boolean
{
const
session
=
this
.
debugService
.
getViewModel
().
focusedSession
;
return
super
.
isEnabled
(
state
)
&&
state
===
State
.
Stopped
&&
session
&&
session
.
capabilities
.
supportsSetVariable
;
return
!!
(
super
.
isEnabled
(
state
)
&&
state
===
State
.
Stopped
&&
session
&&
session
.
capabilities
.
supportsSetVariable
)
;
}
}
...
...
@@ -774,8 +774,8 @@ export class StepBackAction extends AbstractDebugAction {
protected
isEnabled
(
state
:
State
):
boolean
{
const
session
=
this
.
debugService
.
getViewModel
().
focusedSession
;
return
super
.
isEnabled
(
state
)
&&
state
===
State
.
Stopped
&&
session
&&
session
.
capabilities
.
supportsStepBack
;
return
!!
(
super
.
isEnabled
(
state
)
&&
state
===
State
.
Stopped
&&
session
&&
session
.
capabilities
.
supportsStepBack
)
;
}
}
...
...
@@ -797,8 +797,8 @@ export class ReverseContinueAction extends AbstractDebugAction {
protected
isEnabled
(
state
:
State
):
boolean
{
const
session
=
this
.
debugService
.
getViewModel
().
focusedSession
;
return
super
.
isEnabled
(
state
)
&&
state
===
State
.
Stopped
&&
session
&&
session
.
capabilities
.
supportsStepBack
;
return
!!
(
super
.
isEnabled
(
state
)
&&
state
===
State
.
Stopped
&&
session
&&
session
.
capabilities
.
supportsStepBack
)
;
}
}
...
...
src/vs/workbench/contrib/debug/common/debugModel.ts
浏览文件 @
57b3fc8a
...
...
@@ -879,7 +879,7 @@ export class DebugModel implements IDebugModel {
this
.
exceptionBreakpoints
=
data
.
map
(
d
=>
{
const
ebp
=
this
.
exceptionBreakpoints
.
filter
(
ebp
=>
ebp
.
filter
===
d
.
filter
).
pop
();
return
new
ExceptionBreakpoint
(
d
.
filter
,
d
.
label
,
ebp
?
ebp
.
enabled
:
d
.
default
);
return
new
ExceptionBreakpoint
(
d
.
filter
,
d
.
label
,
ebp
?
ebp
.
enabled
:
!!
d
.
default
);
});
this
.
_onDidChangeBreakpoints
.
fire
(
undefined
);
}
...
...
src/vs/workbench/contrib/debug/electron-browser/callStackView.ts
浏览文件 @
57b3fc8a
...
...
@@ -540,7 +540,7 @@ class ShowMoreRenderer implements ITreeRenderer<IStackFrame[], FuzzyScore, ILabe
renderElement
(
element
:
ITreeNode
<
IStackFrame
[],
FuzzyScore
>
,
index
:
number
,
data
:
ILabelTemplateData
):
void
{
const
stackFrames
=
element
.
element
;
if
(
stackFrames
.
every
(
sf
=>
sf
.
source
&&
sf
.
source
.
origin
&&
sf
.
source
.
origin
===
stackFrames
[
0
].
source
.
origin
))
{
if
(
stackFrames
.
every
(
sf
=>
!!
(
sf
.
source
&&
sf
.
source
.
origin
&&
sf
.
source
.
origin
===
stackFrames
[
0
].
source
.
origin
)
))
{
data
.
label
.
textContent
=
nls
.
localize
(
'
showMoreAndOrigin
'
,
"
Show {0} More: {1}
"
,
stackFrames
.
length
,
stackFrames
[
0
].
source
.
origin
);
}
else
{
data
.
label
.
textContent
=
nls
.
localize
(
'
showMoreStackFrames
'
,
"
Show {0} More Stack Frames
"
,
stackFrames
.
length
);
...
...
src/vs/workbench/contrib/debug/node/debugger.ts
浏览文件 @
57b3fc8a
...
...
@@ -146,9 +146,9 @@ export class Debugger implements IDebugger {
private
inExtHost
():
boolean
{
const
debugConfigs
=
this
.
configurationService
.
getValue
<
IDebugConfiguration
>
(
'
debug
'
);
return
debugConfigs
.
extensionHostDebugAdapter
return
!!
debugConfigs
.
extensionHostDebugAdapter
||
this
.
configurationManager
.
needsToRunInExtHost
(
this
.
type
)
||
(
this
.
mainExtensionDescription
&&
this
.
mainExtensionDescription
.
extensionLocation
.
scheme
!==
'
file
'
);
||
(
!!
this
.
mainExtensionDescription
&&
this
.
mainExtensionDescription
.
extensionLocation
.
scheme
!==
'
file
'
);
}
get
label
():
string
{
...
...
src/vs/workbench/contrib/extensions/electron-browser/extensionEditor.ts
浏览文件 @
57b3fc8a
...
...
@@ -126,7 +126,7 @@ class NavBar {
_update
(
id
:
string
|
null
=
this
.
currentId
,
focus
?:
boolean
):
Promise
<
void
>
{
this
.
currentId
=
id
;
this
.
_onChange
.
fire
({
id
,
focus
});
this
.
_onChange
.
fire
({
id
,
focus
:
!!
focus
});
this
.
actions
.
forEach
(
a
=>
a
.
enabled
=
a
.
id
!==
id
);
return
Promise
.
resolve
(
undefined
);
}
...
...
src/vs/workbench/contrib/files/electron-browser/views/explorerView.ts
浏览文件 @
57b3fc8a
...
...
@@ -308,8 +308,8 @@ export class ExplorerView extends ViewletPanel {
const
isSingleFolder
=
this
.
contextService
.
getWorkbenchState
()
===
WorkbenchState
.
FOLDER
;
const
resource
=
stat
?
stat
.
resource
:
isSingleFolder
?
this
.
contextService
.
getWorkspace
().
folders
[
0
].
uri
:
undefined
;
this
.
resourceContext
.
set
(
resource
);
this
.
folderContext
.
set
((
isSingleFolder
&&
!
stat
)
||
stat
&&
stat
.
isDirectory
);
this
.
readonlyContext
.
set
(
stat
&&
stat
.
isReadonly
);
this
.
folderContext
.
set
((
isSingleFolder
&&
!
stat
)
||
!!
stat
&&
stat
.
isDirectory
);
this
.
readonlyContext
.
set
(
!!
stat
&&
stat
.
isReadonly
);
this
.
rootContext
.
set
(
!
stat
||
(
stat
&&
stat
.
isRoot
));
}));
...
...
src/vs/workbench/contrib/files/electron-browser/views/explorerViewer.ts
浏览文件 @
57b3fc8a
...
...
@@ -472,7 +472,7 @@ export class FileDragAndDrop implements ITreeDragAndDrop<ExplorerItem> {
if
(
!
target
)
{
// Droping onto the empty area. Do not accept if items dragged are already
// children of the root unless we are copying the file
if
(
!
isCopy
&&
items
.
every
(
i
=>
i
.
parent
&&
i
.
parent
.
isRoot
))
{
if
(
!
isCopy
&&
items
.
every
(
i
=>
!!
i
.
parent
&&
i
.
parent
.
isRoot
))
{
return
false
;
}
...
...
src/vs/workbench/contrib/markers/electron-browser/markersPanel.ts
浏览文件 @
57b3fc8a
...
...
@@ -358,7 +358,7 @@ export class MarkersPanel extends Panel implements IMarkerFilterController {
const
markersNavigator
=
this
.
_register
(
new
TreeResourceNavigator2
(
this
.
tree
,
{
openOnFocus
:
true
}));
this
.
_register
(
Event
.
debounce
(
markersNavigator
.
onDidOpenResource
,
(
last
,
event
)
=>
event
,
75
,
true
)(
options
=>
{
this
.
openFileAtElement
(
options
.
element
,
options
.
editorOptions
.
preserveFocus
,
options
.
sideBySide
,
options
.
editorOptions
.
pinned
);
this
.
openFileAtElement
(
options
.
element
,
!!
options
.
editorOptions
.
preserveFocus
,
options
.
sideBySide
,
!!
options
.
editorOptions
.
pinned
);
}));
this
.
_register
(
this
.
tree
.
onDidChangeCollapseState
(({
node
})
=>
{
const
{
element
}
=
node
;
...
...
src/vs/workbench/contrib/markers/electron-browser/markersTreeViewer.ts
浏览文件 @
57b3fc8a
...
...
@@ -303,7 +303,7 @@ class MarkerWidget extends Disposable {
const
viewModel
=
this
.
markersViewModel
.
getViewModel
(
marker
);
const
multiline
=
viewModel
&&
viewModel
.
multiline
;
const
action
=
new
Action
(
'
problems.action.toggleMultiline
'
);
action
.
enabled
=
viewModel
&&
marker
.
lines
.
length
>
1
;
action
.
enabled
=
!!
viewModel
&&
marker
.
lines
.
length
>
1
;
action
.
tooltip
=
multiline
?
localize
(
'
single line
'
,
"
Show message in single line
"
)
:
localize
(
'
multi line
'
,
"
Show message in multiple lines
"
);
action
.
class
=
multiline
?
'
octicon octicon-chevron-up
'
:
'
octicon octicon-chevron-down
'
;
action
.
run
=
()
=>
{
if
(
viewModel
)
{
viewModel
.
multiline
=
!
viewModel
.
multiline
;
}
return
Promise
.
resolve
();
};
...
...
src/vs/workbench/contrib/output/browser/outputActions.ts
浏览文件 @
57b3fc8a
...
...
@@ -193,7 +193,7 @@ export class OpenLogOutputFile extends Action {
private
update
():
void
{
const
outputChannelDescriptor
=
this
.
getOutputChannelDescriptor
();
this
.
enabled
=
outputChannelDescriptor
&&
outputChannelDescriptor
.
file
&&
outputChannelDescriptor
.
log
;
this
.
enabled
=
!!
(
outputChannelDescriptor
&&
outputChannelDescriptor
.
file
&&
outputChannelDescriptor
.
log
)
;
}
public
run
():
Promise
<
any
>
{
...
...
src/vs/workbench/contrib/output/electron-browser/outputServices.ts
浏览文件 @
57b3fc8a
...
...
@@ -493,10 +493,10 @@ export class OutputService extends Disposable implements IOutputService, ITextMo
this
.
activeChannel
=
channel
;
let
promise
:
Promise
<
void
>
;
if
(
this
.
isPanelShown
())
{
promise
=
this
.
doShowChannel
(
channel
,
preserveFocus
);
promise
=
this
.
doShowChannel
(
channel
,
!!
preserveFocus
);
}
else
{
this
.
panelService
.
openPanel
(
OUTPUT_PANEL_ID
);
promise
=
this
.
doShowChannel
(
this
.
activeChannel
,
preserveFocus
);
promise
=
this
.
doShowChannel
(
this
.
activeChannel
,
!!
preserveFocus
);
}
return
promise
.
then
(()
=>
this
.
_onActiveOutputChannel
.
fire
(
id
));
}
...
...
@@ -613,7 +613,7 @@ export class OutputService extends Disposable implements IOutputService, ITextMo
private
isPanelShown
():
boolean
{
const
panel
=
this
.
panelService
.
getActivePanel
();
return
panel
&&
panel
.
getId
()
===
OUTPUT_PANEL_ID
;
return
!!
panel
&&
panel
.
getId
()
===
OUTPUT_PANEL_ID
;
}
private
createInput
(
channel
:
IOutputChannel
):
ResourceEditorInput
{
...
...
src/vs/workbench/contrib/preferences/browser/keybindingsEditor.ts
浏览文件 @
57b3fc8a
...
...
@@ -129,7 +129,7 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
setInput
(
input
:
KeybindingsEditorInput
,
options
:
EditorOptions
,
token
:
CancellationToken
):
Promise
<
void
>
{
this
.
keybindingsEditorContextKey
.
set
(
true
);
return
super
.
setInput
(
input
,
options
,
token
)
.
then
(()
=>
this
.
render
(
options
&&
options
.
preserveFocus
,
token
));
.
then
(()
=>
this
.
render
(
!!
(
options
&&
options
.
preserveFocus
)
,
token
));
}
clearInput
():
void
{
...
...
src/vs/workbench/contrib/preferences/browser/preferencesEditor.ts
浏览文件 @
57b3fc8a
...
...
@@ -499,7 +499,7 @@ class PreferencesRenderersController extends Disposable {
this
.
consolidateAndUpdate
(
defaultFilterResult
,
editableFilterResult
);
this
.
_lastFilterResult
=
defaultFilterResult
;
return
defaultFilterResult
&&
defaultFilterResult
.
exactMatch
;
return
!!
(
defaultFilterResult
&&
defaultFilterResult
.
exactMatch
)
;
});
}
...
...
src/vs/workbench/contrib/preferences/electron-browser/settingsEditor2.ts
浏览文件 @
57b3fc8a
...
...
@@ -755,7 +755,7 @@ export class SettingsEditor2 extends BaseEditor {
query
:
this
.
searchWidget
.
getValue
(),
searchResults
:
this
.
searchResultModel
&&
this
.
searchResultModel
.
getUniqueResults
(),
rawResults
:
this
.
searchResultModel
&&
this
.
searchResultModel
.
getRawResults
(),
showConfiguredOnly
:
this
.
viewState
.
tagFilters
&&
this
.
viewState
.
tagFilters
.
has
(
MODIFIED_SETTING_TAG
),
showConfiguredOnly
:
!!
this
.
viewState
.
tagFilters
&&
this
.
viewState
.
tagFilters
.
has
(
MODIFIED_SETTING_TAG
),
isReset
:
typeof
value
===
'
undefined
'
,
settingsTarget
:
this
.
settingsTargetsWidget
.
settingsTarget
as
SettingsTarget
};
...
...
src/vs/workbench/contrib/search/browser/searchActions.ts
浏览文件 @
57b3fc8a
...
...
@@ -34,7 +34,7 @@ import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
export
function
isSearchViewFocused
(
viewletService
:
IViewletService
,
panelService
:
IPanelService
):
boolean
{
const
searchView
=
getSearchView
(
viewletService
,
panelService
);
const
activeElement
=
document
.
activeElement
;
return
searchView
&&
activeElement
&&
DOM
.
isAncestor
(
activeElement
,
searchView
.
getContainer
(
));
return
!!
(
searchView
&&
activeElement
&&
DOM
.
isAncestor
(
activeElement
,
searchView
.
getContainer
()
));
}
export
function
appendKeyBindingLabel
(
label
:
string
,
keyBinding
:
number
|
ResolvedKeybinding
,
keyBindingService2
:
IKeybindingService
):
string
{
...
...
@@ -262,7 +262,7 @@ export class CollapseDeepestExpandedLevelAction extends Action {
update
():
void
{
const
searchView
=
getSearchView
(
this
.
viewletService
,
this
.
panelService
);
this
.
enabled
=
searchView
&&
searchView
.
hasSearchResults
();
this
.
enabled
=
!!
searchView
&&
searchView
.
hasSearchResults
();
}
run
():
Promise
<
void
>
{
...
...
@@ -319,7 +319,7 @@ export class ClearSearchResultsAction extends Action {
update
():
void
{
const
searchView
=
getSearchView
(
this
.
viewletService
,
this
.
panelService
);
this
.
enabled
=
searchView
&&
(
!
searchView
.
allSearchFieldsClear
()
||
searchView
.
hasSearchResults
());
this
.
enabled
=
!!
searchView
&&
(
!
searchView
.
allSearchFieldsClear
()
||
searchView
.
hasSearchResults
());
}
run
():
Promise
<
void
>
{
...
...
@@ -327,7 +327,7 @@ export class ClearSearchResultsAction extends Action {
if
(
searchView
)
{
searchView
.
clearSearchResults
();
}
return
Promise
.
resolve
(
null
);
return
Promise
.
resolve
();
}
}
...
...
@@ -346,7 +346,7 @@ export class CancelSearchAction extends Action {
update
():
void
{
const
searchView
=
getSearchView
(
this
.
viewletService
,
this
.
panelService
);
this
.
enabled
=
searchView
&&
searchView
.
isSearching
();
this
.
enabled
=
!!
searchView
&&
searchView
.
isSearching
();
}
run
():
Promise
<
void
>
{
...
...
src/vs/workbench/contrib/search/browser/searchWidget.ts
浏览文件 @
57b3fc8a
...
...
@@ -185,7 +185,7 @@ export class SearchWidget extends Widget {
}
isReplaceActive
():
boolean
{
return
this
.
replaceActive
.
get
();
return
!!
this
.
replaceActive
.
get
();
}
getReplaceValue
():
string
{
...
...
src/vs/workbench/contrib/terminal/electron-browser/terminalPanel.ts
浏览文件 @
57b3fc8a
...
...
@@ -161,7 +161,7 @@ export class TerminalPanel extends Panel {
});
}
const
activeInstance
=
this
.
_terminalService
.
getActiveInstance
();
this
.
_copyContextMenuAction
.
enabled
=
activeInstance
&&
activeInstance
.
hasSelection
();
this
.
_copyContextMenuAction
.
enabled
=
!!
activeInstance
&&
activeInstance
.
hasSelection
();
return
this
.
_contextMenuActions
;
}
...
...
src/vs/workbench/electron-browser/workbench.ts
浏览文件 @
57b3fc8a
...
...
@@ -352,10 +352,10 @@ export class Workbench extends Disposable implements IPartService {
this
.
workbenchParams
=
{
configuration
,
serviceCollection
};
this
.
hasInitialFilesToOpen
=
this
.
hasInitialFilesToOpen
=
!!
(
(
configuration
.
filesToCreate
&&
configuration
.
filesToCreate
.
length
>
0
)
||
(
configuration
.
filesToOpen
&&
configuration
.
filesToOpen
.
length
>
0
)
||
(
configuration
.
filesToDiff
&&
configuration
.
filesToDiff
.
length
>
0
);
(
configuration
.
filesToDiff
&&
configuration
.
filesToDiff
.
length
>
0
)
)
;
this
.
registerErrorHandler
();
}
...
...
@@ -944,7 +944,7 @@ export class Workbench extends Disposable implements IPartService {
}
const
newMenubarVisibility
=
this
.
configurationService
.
getValue
<
MenuBarVisibility
>
(
Workbench
.
menubarVisibilityConfigurationKey
);
this
.
setMenubarVisibility
(
newMenubarVisibility
,
skipLayout
);
this
.
setMenubarVisibility
(
newMenubarVisibility
,
!!
skipLayout
);
}
//#endregion
...
...
@@ -976,7 +976,7 @@ export class Workbench extends Disposable implements IPartService {
const
activeControl
=
this
.
editorService
.
activeControl
;
const
visibleEditors
=
this
.
editorService
.
visibleControls
;
textCompareEditorActive
.
set
(
activeControl
&&
activeControl
.
getId
()
===
TEXT_DIFF_EDITOR_ID
);
textCompareEditorActive
.
set
(
!!
activeControl
&&
activeControl
.
getId
()
===
TEXT_DIFF_EDITOR_ID
);
textCompareEditorVisible
.
set
(
visibleEditors
.
some
(
control
=>
control
.
getId
()
===
TEXT_DIFF_EDITOR_ID
));
if
(
visibleEditors
.
length
>
0
)
{
...
...
@@ -1013,7 +1013,7 @@ export class Workbench extends Disposable implements IPartService {
const
inputFocused
=
InputFocusedContext
.
bindTo
(
this
.
contextKeyService
);
function
activeElementIsInput
():
boolean
{
return
document
.
activeElement
&&
(
document
.
activeElement
.
tagName
===
'
INPUT
'
||
document
.
activeElement
.
tagName
===
'
TEXTAREA
'
);
return
!!
document
.
activeElement
&&
(
document
.
activeElement
.
tagName
===
'
INPUT
'
||
document
.
activeElement
.
tagName
===
'
TEXTAREA
'
);
}
function
trackInputFocus
():
void
{
...
...
src/vs/workbench/services/configuration/node/configurationEditingService.ts
浏览文件 @
57b3fc8a
...
...
@@ -474,7 +474,7 @@ export class ConfigurationEditingService {
private
isWorkspaceConfigurationResource
(
resource
:
URI
):
boolean
{
const
workspace
=
this
.
contextService
.
getWorkspace
();
return
workspace
.
configuration
&&
resource
&&
workspace
.
configuration
.
fsPath
===
resource
.
fsPath
;
return
!!
(
workspace
.
configuration
&&
resource
&&
workspace
.
configuration
.
fsPath
===
resource
.
fsPath
)
;
}
private
getConfigurationFileResource
(
target
:
ConfigurationTarget
,
relativePath
:
string
,
resource
:
URI
):
URI
{
...
...
src/vs/workbench/services/files/electron-browser/fileService.ts
浏览文件 @
57b3fc8a
...
...
@@ -839,11 +839,11 @@ export class FileService extends Disposable implements IFileService {
}
moveFile
(
source
:
uri
,
target
:
uri
,
overwrite
?:
boolean
):
Promise
<
IFileStat
>
{
return
this
.
moveOrCopyFile
(
source
,
target
,
false
,
overwrite
);
return
this
.
moveOrCopyFile
(
source
,
target
,
false
,
!!
overwrite
);
}
copyFile
(
source
:
uri
,
target
:
uri
,
overwrite
?:
boolean
):
Promise
<
IFileStat
>
{
return
this
.
moveOrCopyFile
(
source
,
target
,
true
,
overwrite
);
return
this
.
moveOrCopyFile
(
source
,
target
,
true
,
!!
overwrite
);
}
private
moveOrCopyFile
(
source
:
uri
,
target
:
uri
,
keepCopy
:
boolean
,
overwrite
:
boolean
):
Promise
<
IFileStat
>
{
...
...
@@ -915,7 +915,7 @@ export class FileService extends Disposable implements IFileService {
return
this
.
doMoveItemToTrash
(
resource
);
}
return
this
.
doDelete
(
resource
,
options
&&
options
.
recursive
);
return
this
.
doDelete
(
resource
,
!!
(
options
&&
options
.
recursive
)
);
}
private
doMoveItemToTrash
(
resource
:
uri
):
Promise
<
void
>
{
...
...
src/vs/workbench/services/files/electron-browser/remoteFileService.ts
浏览文件 @
57b3fc8a
...
...
@@ -505,7 +505,7 @@ export class RemoteFileService extends FileService {
return
super
.
del
(
resource
,
options
);
}
else
{
return
this
.
_withProvider
(
resource
).
then
(
RemoteFileService
.
_throwIfFileSystemIsReadonly
).
then
(
provider
=>
{
return
provider
.
delete
(
resource
,
{
recursive
:
options
&&
options
.
recursive
}).
then
(()
=>
{
return
provider
.
delete
(
resource
,
{
recursive
:
!!
(
options
&&
options
.
recursive
)
}).
then
(()
=>
{
this
.
_onAfterOperation
.
fire
(
new
FileOperationEvent
(
resource
,
FileOperation
.
DELETE
));
});
});
...
...
@@ -593,7 +593,7 @@ export class RemoteFileService extends FileService {
if
(
source
.
scheme
===
target
.
scheme
&&
(
provider
.
capabilities
&
FileSystemProviderCapabilities
.
FileFolderCopy
))
{
// good: provider supports copy withing scheme
return
provider
.
copy
(
source
,
target
,
{
overwrite
}).
then
(()
=>
{
return
provider
.
copy
(
source
,
target
,
{
overwrite
:
!!
overwrite
}).
then
(()
=>
{
return
this
.
resolveFile
(
target
);
}).
then
(
fileStat
=>
{
this
.
_onAfterOperation
.
fire
(
new
FileOperationEvent
(
source
,
FileOperation
.
COPY
,
fileStat
));
...
...
@@ -620,7 +620,7 @@ export class RemoteFileService extends FileService {
provider
,
target
,
new
StringSnapshot
(
content
.
value
),
content
.
encoding
,
{
create
:
true
,
overwrite
}
{
create
:
true
,
overwrite
:
!!
overwrite
}
).
then
(
fileStat
=>
{
this
.
_onAfterOperation
.
fire
(
new
FileOperationEvent
(
source
,
FileOperation
.
COPY
,
fileStat
));
return
fileStat
;
...
...
src/vs/workbench/services/textfile/common/textFileEditorModel.ts
浏览文件 @
57b3fc8a
...
...
@@ -1004,7 +1004,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
}
isReadonly
():
boolean
{
return
this
.
lastResolvedDiskStat
&&
this
.
lastResolvedDiskStat
.
isReadonly
;
return
!!
(
this
.
lastResolvedDiskStat
&&
this
.
lastResolvedDiskStat
.
isReadonly
)
;
}
isDisposed
():
boolean
{
...
...
src/vs/workbench/services/textfile/common/textFileService.ts
浏览文件 @
57b3fc8a
...
...
@@ -515,7 +515,7 @@ export class TextFileService extends Disposable implements ITextFileService {
}
}
return
this
.
saveAll
([
resource
],
options
).
then
(
result
=>
result
.
results
.
length
===
1
&&
result
.
results
[
0
].
success
);
return
this
.
saveAll
([
resource
],
options
).
then
(
result
=>
result
.
results
.
length
===
1
&&
!!
result
.
results
[
0
].
success
);
}
saveAll
(
includeUntitled
?:
boolean
,
options
?:
ISaveOptions
):
Promise
<
ITextFileOperationResult
>
;
...
...
@@ -794,7 +794,7 @@ export class TextFileService extends Disposable implements ITextFileService {
}
revert
(
resource
:
URI
,
options
?:
IRevertOptions
):
Promise
<
boolean
>
{
return
this
.
revertAll
([
resource
],
options
).
then
(
result
=>
result
.
results
.
length
===
1
&&
result
.
results
[
0
].
success
);
return
this
.
revertAll
([
resource
],
options
).
then
(
result
=>
result
.
results
.
length
===
1
&&
!!
result
.
results
[
0
].
success
);
}
revertAll
(
resources
?:
URI
[],
options
?:
IRevertOptions
):
Promise
<
ITextFileOperationResult
>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录