Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
8df9f241
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,发现更多精彩内容 >>
提交
8df9f241
编写于
10月 25, 2018
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Strict null checks
上级
21816902
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
49 addition
and
27 deletion
+49
-27
src/tsconfig.strictNullChecks.json
src/tsconfig.strictNullChecks.json
+8
-1
src/vs/base/common/labels.ts
src/vs/base/common/labels.ts
+1
-1
src/vs/code/electron-main/sharedProcess.ts
src/vs/code/electron-main/sharedProcess.ts
+17
-9
src/vs/code/node/windowsFinder.ts
src/vs/code/node/windowsFinder.ts
+5
-5
src/vs/editor/contrib/codelens/codelens.ts
src/vs/editor/contrib/codelens/codelens.ts
+2
-2
src/vs/editor/contrib/gotoError/gotoErrorWidget.ts
src/vs/editor/contrib/gotoError/gotoErrorWidget.ts
+5
-4
src/vs/editor/contrib/zoneWidget/zoneWidget.ts
src/vs/editor/contrib/zoneWidget/zoneWidget.ts
+2
-2
src/vs/editor/test/browser/testCommand.ts
src/vs/editor/test/browser/testCommand.ts
+1
-1
src/vs/workbench/parts/tasks/common/taskDefinitionRegistry.ts
...vs/workbench/parts/tasks/common/taskDefinitionRegistry.ts
+2
-2
src/vs/workbench/services/notification/common/notificationService.ts
...bench/services/notification/common/notificationService.ts
+6
-0
未找到文件。
src/tsconfig.strictNullChecks.json
浏览文件 @
8df9f241
...
...
@@ -92,6 +92,7 @@
"./vs/code/electron-browser/issue/issueReporterUtil.ts"
,
"./vs/code/electron-main/auth.ts"
,
"./vs/code/electron-main/keyboard.ts"
,
"./vs/code/electron-main/sharedProcess.ts"
,
"./vs/code/electron-main/theme.ts"
,
"./vs/code/node/shellEnv.ts"
,
"./vs/editor/browser/config/charWidthReader.ts"
,
...
...
@@ -259,6 +260,7 @@
"./vs/editor/contrib/codeAction/codeActionModel.ts"
,
"./vs/editor/contrib/codeAction/codeActionTrigger.ts"
,
"./vs/editor/contrib/codeAction/lightBulbWidget.ts"
,
"./vs/editor/contrib/codelens/codelens.ts"
,
"./vs/editor/contrib/colorPicker/color.ts"
,
"./vs/editor/contrib/colorPicker/colorDetector.ts"
,
"./vs/editor/contrib/colorPicker/colorPickerModel.ts"
,
...
...
@@ -290,6 +292,7 @@
"./vs/editor/contrib/fontZoom/fontZoom.ts"
,
"./vs/editor/contrib/goToDefinition/clickLinkGesture.ts"
,
"./vs/editor/contrib/goToDefinition/goToDefinition.ts"
,
"./vs/editor/contrib/gotoError/gotoErrorWidget.ts"
,
"./vs/editor/contrib/hover/getHover.ts"
,
"./vs/editor/contrib/hover/hoverOperation.ts"
,
"./vs/editor/contrib/hover/hoverWidgets.ts"
,
...
...
@@ -335,6 +338,7 @@
"./vs/editor/test/browser/controller/imeTester.ts"
,
"./vs/editor/test/browser/editorTestServices.ts"
,
"./vs/editor/test/browser/testCodeEditor.ts"
,
"./vs/editor/test/browser/testCommand.ts"
,
"./vs/editor/test/browser/view/minimapFontCreator.ts"
,
"./vs/editor/test/common/commentMode.ts"
,
"./vs/editor/test/common/core/viewLineToken.ts"
,
...
...
@@ -503,7 +507,7 @@
"./vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts"
,
"./vs/workbench/parts/comments/common/commentModel.ts"
,
"./vs/workbench/parts/comments/electron-browser/commentGlyphWidget.ts"
,
"vs/workbench/parts/comments/electron-browser/commentService.ts"
,
"
./
vs/workbench/parts/comments/electron-browser/commentService.ts"
,
"./vs/workbench/parts/emmet/browser/actions/showEmmetCommands.ts"
,
"./vs/workbench/parts/emmet/browser/emmet.browser.contribution.ts"
,
"./vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.ts"
,
...
...
@@ -537,11 +541,13 @@
"./vs/workbench/parts/surveys/electron-browser/nps.contribution.ts"
,
"./vs/workbench/parts/tasks/common/problemCollectors.ts"
,
"./vs/workbench/parts/tasks/common/problemMatcher.ts"
,
"./vs/workbench/parts/tasks/common/taskDefinitionRegistry.ts"
,
"./vs/workbench/parts/tasks/common/taskService.ts"
,
"./vs/workbench/parts/tasks/common/taskSystem.ts"
,
"./vs/workbench/parts/tasks/common/taskTemplates.ts"
,
"./vs/workbench/parts/tasks/common/tasks.ts"
,
"./vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.ts"
,
"./vs/workbench/parts/tasks/node/tasks.ts"
,
"./vs/workbench/parts/terminal/browser/terminalTab.ts"
,
"./vs/workbench/parts/terminal/browser/terminalWidgetManager.ts"
,
"./vs/workbench/parts/terminal/common/terminal.ts"
,
...
...
@@ -591,6 +597,7 @@
"./vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts"
,
"./vs/workbench/services/keybinding/common/windowsKeyboardMapper.ts"
,
"./vs/workbench/services/mode/common/workbenchModeService.ts"
,
"./vs/workbench/services/notification/common/notificationService.ts"
,
"./vs/workbench/services/panel/common/panelService.ts"
,
"./vs/workbench/services/part/common/partService.ts"
,
"./vs/workbench/services/scm/common/scm.ts"
,
...
...
src/vs/base/common/labels.ts
浏览文件 @
8df9f241
...
...
@@ -24,7 +24,7 @@ export interface IUserHomeProvider {
/**
* @deprecated use LabelService instead
*/
export
function
getPathLabel
(
resource
:
URI
|
string
,
userHomeProvider
:
IUserHomeProvider
,
rootProvider
?:
IWorkspaceFolderProvider
):
string
{
export
function
getPathLabel
(
resource
:
URI
|
string
,
userHomeProvider
?
:
IUserHomeProvider
,
rootProvider
?:
IWorkspaceFolderProvider
):
string
{
if
(
typeof
resource
===
'
string
'
)
{
resource
=
URI
.
file
(
resource
);
}
...
...
src/vs/code/electron-main/sharedProcess.ts
浏览文件 @
8df9f241
...
...
@@ -21,7 +21,7 @@ export class SharedProcess implements ISharedProcess {
private
barrier
=
new
Barrier
();
private
window
:
Electron
.
BrowserWindow
;
private
window
:
Electron
.
BrowserWindow
|
null
;
constructor
(
private
readonly
machineId
:
string
,
...
...
@@ -63,7 +63,7 @@ export class SharedProcess implements ISharedProcess {
e
.
preventDefault
();
// Still hide the window though if visible
if
(
this
.
window
.
isVisible
())
{
if
(
this
.
window
&&
this
.
window
.
isVisible
())
{
this
.
window
.
hide
();
}
};
...
...
@@ -81,12 +81,16 @@ export class SharedProcess implements ISharedProcess {
// Otherwise the application would never quit because the shared process
// window is refusing to close!
//
this
.
window
.
removeListener
(
'
close
'
,
onClose
);
if
(
this
.
window
)
{
this
.
window
.
removeListener
(
'
close
'
,
onClose
);
}
// Electron seems to crash on Windows without this setTimeout :|
setTimeout
(()
=>
{
try
{
this
.
window
.
close
();
if
(
this
.
window
)
{
this
.
window
.
close
();
}
}
catch
(
err
)
{
// ignore, as electron is already shutting down
}
...
...
@@ -118,7 +122,7 @@ export class SharedProcess implements ISharedProcess {
}
toggle
():
void
{
if
(
this
.
window
.
isVisible
())
{
if
(
!
this
.
window
||
this
.
window
.
isVisible
())
{
this
.
hide
();
}
else
{
this
.
show
();
...
...
@@ -126,12 +130,16 @@ export class SharedProcess implements ISharedProcess {
}
show
():
void
{
this
.
window
.
show
();
this
.
window
.
webContents
.
openDevTools
();
if
(
this
.
window
)
{
this
.
window
.
show
();
this
.
window
.
webContents
.
openDevTools
();
}
}
hide
():
void
{
this
.
window
.
webContents
.
closeDevTools
();
this
.
window
.
hide
();
if
(
this
.
window
)
{
this
.
window
.
webContents
.
closeDevTools
();
this
.
window
.
hide
();
}
}
}
src/vs/code/node/windowsFinder.ts
浏览文件 @
8df9f241
...
...
@@ -29,7 +29,7 @@ export interface IBestWindowOrFolderOptions<W extends ISimpleWindow> {
workspaceResolver
:
(
workspace
:
IWorkspaceIdentifier
)
=>
IResolvedWorkspace
;
}
export
function
findBestWindowOrFolderForFile
<
W
extends
ISimpleWindow
>
({
windows
,
newWindow
,
reuseWindow
,
context
,
fileUri
,
workspaceResolver
}:
IBestWindowOrFolderOptions
<
W
>
):
W
{
export
function
findBestWindowOrFolderForFile
<
W
extends
ISimpleWindow
>
({
windows
,
newWindow
,
reuseWindow
,
context
,
fileUri
,
workspaceResolver
}:
IBestWindowOrFolderOptions
<
W
>
):
W
|
null
{
if
(
!
newWindow
&&
fileUri
&&
(
context
===
OpenContext
.
DESKTOP
||
context
===
OpenContext
.
CLI
||
context
===
OpenContext
.
DOCK
))
{
const
windowOnFilePath
=
findWindowOnFilePath
(
windows
,
fileUri
,
workspaceResolver
);
if
(
windowOnFilePath
)
{
...
...
@@ -39,7 +39,7 @@ export function findBestWindowOrFolderForFile<W extends ISimpleWindow>({ windows
return
!
newWindow
?
getLastActiveWindow
(
windows
)
:
null
;
}
function
findWindowOnFilePath
<
W
extends
ISimpleWindow
>
(
windows
:
W
[],
fileUri
:
URI
,
workspaceResolver
:
(
workspace
:
IWorkspaceIdentifier
)
=>
IResolvedWorkspace
):
W
{
function
findWindowOnFilePath
<
W
extends
ISimpleWindow
>
(
windows
:
W
[],
fileUri
:
URI
,
workspaceResolver
:
(
workspace
:
IWorkspaceIdentifier
)
=>
IResolvedWorkspace
):
W
|
null
{
// First check for windows with workspaces that have a parent folder of the provided path opened
const
workspaceWindows
=
windows
.
filter
(
window
=>
!!
window
.
openedWorkspace
);
...
...
@@ -66,7 +66,7 @@ export function getLastActiveWindow<W extends ISimpleWindow>(windows: W[]): W {
return
windows
.
filter
(
window
=>
window
.
lastFocusTime
===
lastFocusedDate
)[
0
];
}
export
function
findWindowOnWorkspace
<
W
extends
ISimpleWindow
>
(
windows
:
W
[],
workspace
:
(
IWorkspaceIdentifier
|
ISingleFolderWorkspaceIdentifier
)):
W
{
export
function
findWindowOnWorkspace
<
W
extends
ISimpleWindow
>
(
windows
:
W
[],
workspace
:
(
IWorkspaceIdentifier
|
ISingleFolderWorkspaceIdentifier
)):
W
|
null
{
if
(
isSingleFolderWorkspaceIdentifier
(
workspace
))
{
for
(
const
window
of
windows
)
{
// match on folder
...
...
@@ -87,7 +87,7 @@ export function findWindowOnWorkspace<W extends ISimpleWindow>(windows: W[], wor
return
null
;
}
export
function
findWindowOnExtensionDevelopmentPath
<
W
extends
ISimpleWindow
>
(
windows
:
W
[],
extensionDevelopmentPath
:
string
):
W
{
export
function
findWindowOnExtensionDevelopmentPath
<
W
extends
ISimpleWindow
>
(
windows
:
W
[],
extensionDevelopmentPath
:
string
):
W
|
null
{
for
(
const
window
of
windows
)
{
// match on extension development path. The path can be a path or uri string, using paths.isEqual is not 100% correct but good enough
if
(
paths
.
isEqual
(
window
.
extensionDevelopmentPath
,
extensionDevelopmentPath
,
!
platform
.
isLinux
/* ignorecase */
))
{
...
...
@@ -97,7 +97,7 @@ export function findWindowOnExtensionDevelopmentPath<W extends ISimpleWindow>(wi
return
null
;
}
export
function
findWindowOnWorkspaceOrFolderUri
<
W
extends
ISimpleWindow
>
(
windows
:
W
[],
uri
:
URI
):
W
{
export
function
findWindowOnWorkspaceOrFolderUri
<
W
extends
ISimpleWindow
>
(
windows
:
W
[],
uri
:
URI
):
W
|
null
{
if
(
!
uri
)
{
return
null
;
}
...
...
src/vs/editor/contrib/codelens/codelens.ts
浏览文件 @
8df9f241
...
...
@@ -73,8 +73,8 @@ registerLanguageCommand('_executeCodeLensProvider', function (accessor, args) {
for
(
const
item
of
value
)
{
if
(
typeof
itemResolveCount
===
'
undefined
'
||
Boolean
(
item
.
symbol
.
command
))
{
result
.
push
(
item
.
symbol
);
}
else
if
(
itemResolveCount
--
>
0
)
{
resolve
.
push
(
Promise
.
resolve
(
item
.
provider
.
resolveCodeLens
(
model
,
item
.
symbol
,
CancellationToken
.
None
)).
then
(
symbol
=>
result
.
push
(
symbol
)));
}
else
if
(
itemResolveCount
--
>
0
&&
item
.
provider
.
resolveCodeLens
)
{
resolve
.
push
(
Promise
.
resolve
(
item
.
provider
.
resolveCodeLens
(
model
,
item
.
symbol
,
CancellationToken
.
None
)).
then
(
symbol
=>
result
.
push
(
symbol
||
item
.
symbol
)));
}
}
...
...
src/vs/editor/contrib/gotoError/gotoErrorWidget.ts
浏览文件 @
8df9f241
...
...
@@ -111,7 +111,7 @@ class MessageWidget {
this
.
_relatedBlock
.
style
.
paddingTop
=
`
${
Math
.
floor
(
this
.
_editor
.
getConfiguration
().
lineHeight
*
.
66
)}
px`
;
this
.
_lines
+=
1
;
for
(
const
related
of
relatedInformation
)
{
for
(
const
related
of
relatedInformation
||
[]
)
{
let
container
=
document
.
createElement
(
'
div
'
);
...
...
@@ -159,7 +159,7 @@ export class MarkerNavigationWidget extends ZoneWidget {
private
_message
:
MessageWidget
;
private
_callOnDispose
:
IDisposable
[]
=
[];
private
_severity
:
MarkerSeverity
;
private
_backgroundColor
:
Color
;
private
_backgroundColor
:
Color
|
null
;
private
_onDidSelectRelatedInformation
=
new
Emitter
<
IRelatedInformation
>
();
readonly
onDidSelectRelatedInformation
:
Event
<
IRelatedInformation
>
=
this
.
_onDidSelectRelatedInformation
.
event
;
...
...
@@ -195,7 +195,7 @@ export class MarkerNavigationWidget extends ZoneWidget {
protected
_applyStyles
():
void
{
if
(
this
.
_parentContainer
)
{
this
.
_parentContainer
.
style
.
backgroundColor
=
this
.
_backgroundColor
.
toString
()
;
this
.
_parentContainer
.
style
.
backgroundColor
=
this
.
_backgroundColor
?
this
.
_backgroundColor
.
toString
()
:
''
;
}
super
.
_applyStyles
();
}
...
...
@@ -244,7 +244,8 @@ export class MarkerNavigationWidget extends ZoneWidget {
// show
let
range
=
Range
.
lift
(
marker
);
let
position
=
range
.
containsPosition
(
this
.
editor
.
getPosition
())
?
this
.
editor
.
getPosition
()
:
range
.
getStartPosition
();
const
editorPosition
=
this
.
editor
.
getPosition
();
let
position
=
editorPosition
&&
range
.
containsPosition
(
editorPosition
)
?
editorPosition
:
range
.
getStartPosition
();
super
.
show
(
position
,
this
.
computeRequiredHeight
());
this
.
editor
.
revealPositionInCenter
(
position
,
ScrollType
.
Smooth
);
...
...
src/vs/editor/contrib/zoneWidget/zoneWidget.ts
浏览文件 @
8df9f241
...
...
@@ -31,8 +31,8 @@ export interface IOptions {
}
export
interface
IStyles
{
frameColor
?:
Color
;
arrowColor
?:
Color
;
frameColor
?:
Color
|
null
;
arrowColor
?:
Color
|
null
;
}
const
defaultColor
=
new
Color
(
new
RGBA
(
0
,
122
,
204
));
...
...
src/vs/editor/test/browser/testCommand.ts
浏览文件 @
8df9f241
...
...
@@ -61,7 +61,7 @@ export function getEditOperation(model: ITextModel, command: editorCommon.IComma
trackSelection
:
(
selection
:
Selection
)
=>
{
return
null
;
return
''
;
}
};
command
.
getEditOperations
(
model
,
editOperationBuilder
);
...
...
src/vs/workbench/parts/tasks/common/taskDefinitionRegistry.ts
浏览文件 @
8df9f241
...
...
@@ -46,7 +46,7 @@ namespace Configuration {
properties
?:
IJSONSchemaMap
;
}
export
function
from
(
value
:
TaskDefinition
,
extensionId
:
string
,
messageCollector
:
ExtensionMessageCollector
):
Tasks
.
TaskDefinition
{
export
function
from
(
value
:
TaskDefinition
,
extensionId
:
string
,
messageCollector
:
ExtensionMessageCollector
):
Tasks
.
TaskDefinition
|
undefined
{
if
(
!
value
)
{
return
undefined
;
}
...
...
@@ -137,7 +137,7 @@ class TaskDefinitionRegistryImpl implements ITaskDefinitionRegistry {
}
else
{
schema
.
properties
=
Object
.
create
(
null
);
}
schema
.
properties
.
type
=
{
schema
.
properties
!
.
type
=
{
type
:
'
string
'
,
enum
:
[
definition
.
taskType
]
};
...
...
src/vs/workbench/services/notification/common/notificationService.ts
浏览文件 @
8df9f241
...
...
@@ -63,8 +63,14 @@ export class NotificationService extends Disposable implements INotificationServ
choices
.
forEach
((
choice
,
index
)
=>
{
const
action
=
new
ChoiceAction
(
`workbench.dialog.choice.
${
index
}
`
,
choice
);
if
(
!
choice
.
isSecondary
)
{
if
(
!
actions
.
primary
)
{
actions
.
primary
=
[];
}
actions
.
primary
.
push
(
action
);
}
else
{
if
(
!
actions
.
secondary
)
{
actions
.
secondary
=
[];
}
actions
.
secondary
.
push
(
action
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录