Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
340133ac
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,发现更多精彩内容 >>
提交
340133ac
编写于
11月 05, 2018
作者:
R
Rachel Macfarlane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "Add strict null checks in issue and launch services, #60565"
This reverts commit
cd1a6b4f
.
上级
6f139c79
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
26 addition
and
37 deletion
+26
-37
src/tsconfig.strictNullChecks.json
src/tsconfig.strictNullChecks.json
+0
-2
src/vs/platform/issue/electron-main/issueService.ts
src/vs/platform/issue/electron-main/issueService.ts
+16
-19
src/vs/platform/launch/electron-main/launchService.ts
src/vs/platform/launch/electron-main/launchService.ts
+10
-16
未找到文件。
src/tsconfig.strictNullChecks.json
浏览文件 @
340133ac
...
...
@@ -429,7 +429,6 @@
"./vs/platform/integrity/common/integrity.ts"
,
"./vs/platform/integrity/node/integrityServiceImpl.ts"
,
"./vs/platform/issue/common/issue.ts"
,
"./vs/platform/issue/electron-main/issueService.ts"
,
"./vs/platform/issue/node/issueIpc.ts"
,
"./vs/platform/jsonschemas/common/jsonContributionRegistry.ts"
,
"./vs/platform/keybinding/common/abstractKeybindingService.ts"
,
...
...
@@ -441,7 +440,6 @@
"./vs/platform/keybinding/test/common/mockKeybindingService.ts"
,
"./vs/platform/label/common/label.ts"
,
"./vs/platform/label/electron-browser/label.contribution.ts"
,
"./vs/platform/launch/electron-main/launchService.ts"
,
"./vs/platform/lifecycle/common/lifecycle.ts"
,
"./vs/platform/lifecycle/electron-browser/lifecycleService.ts"
,
"./vs/platform/lifecycle/electron-main/lifecycleMain.ts"
,
...
...
src/vs/platform/issue/electron-main/issueService.ts
浏览文件 @
340133ac
...
...
@@ -15,15 +15,14 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment'
import
{
isMacintosh
,
IProcessEnvironment
}
from
'
vs/base/common/platform
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
IWindowsService
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IWindowState
}
from
'
vs/platform/windows/electron-main/windows
'
;
const
DEFAULT_BACKGROUND_COLOR
=
'
#1E1E1E
'
;
export
class
IssueService
implements
IIssueService
{
_serviceBrand
:
any
;
_issueWindow
:
BrowserWindow
|
null
;
_issueWindow
:
BrowserWindow
;
_issueParentWindow
:
BrowserWindow
;
_processExplorerWindow
:
BrowserWindow
|
null
;
_processExplorerWindow
:
BrowserWindow
;
constructor
(
private
machineId
:
string
,
...
...
@@ -109,7 +108,7 @@ export class IssueService implements IIssueService {
this
.
_issueWindow
.
focus
();
return
TPromise
.
as
(
undefined
);
return
TPromise
.
as
(
null
);
}
openProcessExplorer
(
data
:
ProcessExplorerData
):
TPromise
<
void
>
{
...
...
@@ -151,7 +150,7 @@ export class IssueService implements IIssueService {
this
.
_processExplorerWindow
.
loadURL
(
`
${
require
.
toUrl
(
'
vs/code/electron-browser/processExplorer/processExplorer.html
'
)}
?config=
${
encodeURIComponent
(
JSON
.
stringify
(
config
))}
`
);
this
.
_processExplorerWindow
.
on
(
'
close
'
,
()
=>
this
.
_processExplorerWindow
=
null
);
this
.
_processExplorerWindow
.
on
(
'
close
'
,
()
=>
this
.
_processExplorerWindow
=
void
0
);
parentWindow
.
on
(
'
close
'
,
()
=>
{
if
(
this
.
_processExplorerWindow
)
{
...
...
@@ -164,12 +163,12 @@ export class IssueService implements IIssueService {
// Focus
this
.
_processExplorerWindow
.
focus
();
return
TPromise
.
as
(
undefined
);
return
TPromise
.
as
(
null
);
}
private
getWindowPosition
(
parentWindow
:
BrowserWindow
,
defaultWidth
:
number
,
defaultHeight
:
number
)
:
IWindowState
{
private
getWindowPosition
(
parentWindow
:
BrowserWindow
,
defaultWidth
:
number
,
defaultHeight
:
number
)
{
// We want the new window to open on the same display that the parent is in
let
displayToUse
:
Electron
.
Display
|
undefined
;
let
displayToUse
:
Electron
.
Display
;
const
displays
=
screen
.
getAllDisplays
();
// Single Display
...
...
@@ -197,14 +196,16 @@ export class IssueService implements IIssueService {
}
}
const
state
:
IWindowS
tate
=
{
let
s
tate
=
{
width
:
defaultWidth
,
height
:
defaultHeight
height
:
defaultHeight
,
x
:
undefined
,
y
:
undefined
};
const
displayBounds
=
displayToUse
.
bounds
;
state
.
x
=
displayBounds
.
x
+
(
displayBounds
.
width
/
2
)
-
(
state
.
width
!
/ 2
)
;
state
.
y
=
displayBounds
.
y
+
(
displayBounds
.
height
/
2
)
-
(
state
.
height
!
/ 2
)
;
state
.
x
=
displayBounds
.
x
+
(
displayBounds
.
width
/
2
)
-
(
state
.
width
/
2
);
state
.
y
=
displayBounds
.
y
+
(
displayBounds
.
height
/
2
)
-
(
state
.
height
/
2
);
if
(
displayBounds
.
width
>
0
&&
displayBounds
.
height
>
0
/* Linux X11 sessions sometimes report wrong display bounds */
)
{
if
(
state
.
x
<
displayBounds
.
x
)
{
...
...
@@ -223,11 +224,11 @@ export class IssueService implements IIssueService {
state
.
y
=
displayBounds
.
y
;
// prevent window from falling out of the screen to the bottom
}
if
(
state
.
width
!
>
displayBounds
.
width
)
{
if
(
state
.
width
>
displayBounds
.
width
)
{
state
.
width
=
displayBounds
.
width
;
// prevent window from exceeding display bounds width
}
if
(
state
.
height
!
>
displayBounds
.
height
)
{
if
(
state
.
height
>
displayBounds
.
height
)
{
state
.
height
=
displayBounds
.
height
;
// prevent window from exceeding display bounds height
}
}
...
...
@@ -258,11 +259,7 @@ export class IssueService implements IIssueService {
});
}
private
getIssueReporterPath
(
data
:
IssueReporterData
,
features
:
IssueReporterFeatures
):
string
{
if
(
!
this
.
_issueWindow
)
{
throw
new
Error
(
'
Issue window has been disposed
'
);
}
private
getIssueReporterPath
(
data
:
IssueReporterData
,
features
:
IssueReporterFeatures
)
{
const
windowConfiguration
=
{
appRoot
:
this
.
environmentService
.
appRoot
,
nodeCachedDataDir
:
this
.
environmentService
.
nodeCachedDataDir
,
...
...
src/vs/platform/launch/electron-main/launchService.ts
浏览文件 @
340133ac
...
...
@@ -41,10 +41,6 @@ export interface IMainProcessInfo {
windows
:
IWindowInfo
[];
}
function
isUri
(
uri
:
URI
|
null
):
uri
is
URI
{
return
!!
uri
;
}
function
parseOpenUrl
(
args
:
ParsedArgs
):
URI
[]
{
if
(
args
[
'
open-url
'
]
&&
args
.
_urls
&&
args
.
_urls
.
length
>
0
)
{
// --open-url must contain -- followed by the url(s)
...
...
@@ -57,7 +53,7 @@ function parseOpenUrl(args: ParsedArgs): URI[] {
return
null
;
}
})
.
filter
(
isU
ri
);
.
filter
(
uri
=>
!!
u
ri
);
}
return
[];
...
...
@@ -103,7 +99,7 @@ export class LaunchChannel implements ILaunchChannel {
return
this
.
service
.
getLogsPath
();
}
throw
new
Error
(
`Command '
${
command
}
' not found`
)
;
return
undefined
;
}
}
...
...
@@ -165,7 +161,7 @@ export class LaunchService implements ILaunchService {
}
});
return
TPromise
.
as
(
undefined
);
return
TPromise
.
as
(
null
);
}
// Otherwise handle in windows service
...
...
@@ -174,7 +170,7 @@ export class LaunchService implements ILaunchService {
private
startOpenWindow
(
args
:
ParsedArgs
,
userEnv
:
IProcessEnvironment
):
TPromise
<
void
>
{
const
context
=
!!
userEnv
[
'
VSCODE_CLI
'
]
?
OpenContext
.
CLI
:
OpenContext
.
DESKTOP
;
let
usedWindows
:
ICodeWindow
[]
|
undefined
;
let
usedWindows
:
ICodeWindow
[];
// Special case extension development
if
(
!!
args
.
extensionDevelopmentPath
)
{
...
...
@@ -235,14 +231,14 @@ export class LaunchService implements ILaunchService {
// If the other instance is waiting to be killed, we hook up a window listener if one window
// is being used and only then resolve the startup promise which will kill this second instance.
// In addition, we poll for the wait marker file to be deleted to return.
if
(
args
.
wait
&&
args
.
waitMarkerFilePath
&&
usedWindows
&&
usedWindows
.
length
===
1
&&
usedWindows
[
0
])
{
if
(
args
.
wait
&&
args
.
waitMarkerFilePath
&&
usedWindows
.
length
===
1
&&
usedWindows
[
0
])
{
return
Promise
.
race
([
this
.
windowsMainService
.
waitForWindowCloseOrLoad
(
usedWindows
[
0
].
id
),
whenDeleted
(
args
.
waitMarkerFilePath
)
]).
then
(()
=>
void
0
,
()
=>
void
0
);
}
return
TPromise
.
as
(
undefined
);
return
TPromise
.
as
(
null
);
}
getMainProcessId
():
TPromise
<
number
>
{
...
...
@@ -283,12 +279,10 @@ export class LaunchService implements ILaunchService {
if
(
window
.
openedFolderUri
)
{
folderURIs
.
push
(
window
.
openedFolderUri
);
}
else
if
(
window
.
openedWorkspace
)
{
const
workspace
=
this
.
workspacesMainService
.
resolveWorkspaceSync
(
window
.
openedWorkspace
.
configPath
);
if
(
workspace
)
{
workspace
.
folders
.
forEach
(
root
=>
{
folderURIs
.
push
(
root
.
uri
);
});
}
const
rootFolders
=
this
.
workspacesMainService
.
resolveWorkspaceSync
(
window
.
openedWorkspace
.
configPath
).
folders
;
rootFolders
.
forEach
(
root
=>
{
folderURIs
.
push
(
root
.
uri
);
});
}
return
this
.
browserWindowToInfo
(
window
.
win
,
folderURIs
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录