Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
22316bec
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,发现更多精彩内容 >>
未验证
提交
22316bec
编写于
10月 23, 2019
作者:
B
Benjamin Pasero
提交者:
GitHub
10月 23, 2019
浏览文件
操作
浏览文件
下载
差异文件
introduce sessionId (#83144)
上级
ff66f659
de65d5e4
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
12 addition
and
15 deletion
+12
-15
src/vs/code/electron-main/window.ts
src/vs/code/electron-main/window.ts
+1
-0
src/vs/platform/menubar/electron-main/menubar.ts
src/vs/platform/menubar/electron-main/menubar.ts
+2
-2
src/vs/platform/windows/common/windows.ts
src/vs/platform/windows/common/windows.ts
+2
-1
src/vs/workbench/browser/parts/titlebar/menubarControl.ts
src/vs/workbench/browser/parts/titlebar/menubarControl.ts
+2
-2
src/vs/workbench/contrib/update/browser/update.ts
src/vs/workbench/contrib/update/browser/update.ts
+4
-10
src/vs/workbench/services/environment/browser/environmentService.ts
...kbench/services/environment/browser/environmentService.ts
+1
-0
未找到文件。
src/vs/code/electron-main/window.ts
浏览文件 @
22316bec
...
@@ -635,6 +635,7 @@ export class CodeWindow extends Disposable implements ICodeWindow {
...
@@ -635,6 +635,7 @@ export class CodeWindow extends Disposable implements ICodeWindow {
// Set window ID
// Set window ID
windowConfiguration
.
windowId
=
this
.
_win
.
id
;
windowConfiguration
.
windowId
=
this
.
_win
.
id
;
windowConfiguration
.
sessionId
=
`window:
${
this
.
_win
.
id
}
`
;
windowConfiguration
.
logLevel
=
this
.
logService
.
getLevel
();
windowConfiguration
.
logLevel
=
this
.
logService
.
getLevel
();
// Set zoomlevel
// Set zoomlevel
...
...
src/vs/platform/menubar/electron-main/menubar.ts
浏览文件 @
22316bec
...
@@ -551,8 +551,8 @@ export class Menubar {
...
@@ -551,8 +551,8 @@ export class Menubar {
label
:
this
.
mnemonicLabel
(
nls
.
localize
(
'
miCheckForUpdates
'
,
"
Check for &&Updates...
"
)),
click
:
()
=>
setTimeout
(()
=>
{
label
:
this
.
mnemonicLabel
(
nls
.
localize
(
'
miCheckForUpdates
'
,
"
Check for &&Updates...
"
)),
click
:
()
=>
setTimeout
(()
=>
{
this
.
reportMenuActionTelemetry
(
'
CheckForUpdate
'
);
this
.
reportMenuActionTelemetry
(
'
CheckForUpdate
'
);
const
focusedWindow
=
BrowserWindow
.
getFocused
Window
();
const
window
=
this
.
windowsMainService
.
getLastActive
Window
();
const
context
=
focusedWindow
?
{
windowId
:
focusedWindow
.
id
}
:
null
;
const
context
=
window
?.
config
?.
sessionId
;
this
.
updateService
.
checkForUpdates
(
context
);
this
.
updateService
.
checkForUpdates
(
context
);
},
0
)
},
0
)
})];
})];
...
...
src/vs/platform/windows/common/windows.ts
浏览文件 @
22316bec
...
@@ -220,7 +220,8 @@ export interface IAddFoldersRequest {
...
@@ -220,7 +220,8 @@ export interface IAddFoldersRequest {
export
interface
IWindowConfiguration
extends
ParsedArgs
{
export
interface
IWindowConfiguration
extends
ParsedArgs
{
machineId
:
string
;
machineId
:
string
;
windowId
:
number
;
windowId
:
number
;
// TODO: should we deprecate this in favor of sessionId?
sessionId
:
string
;
logLevel
:
LogLevel
;
logLevel
:
LogLevel
;
mainPid
:
number
;
mainPid
:
number
;
...
...
src/vs/workbench/browser/parts/titlebar/menubarControl.ts
浏览文件 @
22316bec
...
@@ -293,6 +293,7 @@ export class CustomMenubarControl extends MenubarControl {
...
@@ -293,6 +293,7 @@ export class CustomMenubarControl extends MenubarControl {
@
IThemeService
private
readonly
themeService
:
IThemeService
,
@
IThemeService
private
readonly
themeService
:
IThemeService
,
@
IWorkbenchLayoutService
private
readonly
layoutService
:
IWorkbenchLayoutService
,
@
IWorkbenchLayoutService
private
readonly
layoutService
:
IWorkbenchLayoutService
,
@
IHostService
protected
readonly
hostService
:
IHostService
,
@
IHostService
protected
readonly
hostService
:
IHostService
,
@
IWorkbenchEnvironmentService
private
readonly
workbenchEnvironmentService
:
IWorkbenchEnvironmentService
,
@
optional
(
IElectronService
)
private
readonly
electronService
:
IElectronService
,
@
optional
(
IElectronService
)
private
readonly
electronService
:
IElectronService
,
@
optional
(
IElectronEnvironmentService
)
private
readonly
electronEnvironmentService
:
IElectronEnvironmentService
@
optional
(
IElectronEnvironmentService
)
private
readonly
electronEnvironmentService
:
IElectronEnvironmentService
)
{
)
{
...
@@ -444,9 +445,8 @@ export class CustomMenubarControl extends MenubarControl {
...
@@ -444,9 +445,8 @@ export class CustomMenubarControl extends MenubarControl {
return
null
;
return
null
;
case
StateType
.
Idle
:
case
StateType
.
Idle
:
const
context
=
`window:
${
this
.
electronEnvironmentService
?
this
.
electronEnvironmentService
.
windowId
:
'
any
'
}
`
;
return
new
Action
(
'
update.check
'
,
nls
.
localize
({
key
:
'
checkForUpdates
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
Check for &&Updates...
"
),
undefined
,
true
,
()
=>
return
new
Action
(
'
update.check
'
,
nls
.
localize
({
key
:
'
checkForUpdates
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
Check for &&Updates...
"
),
undefined
,
true
,
()
=>
this
.
updateService
.
checkForUpdates
(
context
));
this
.
updateService
.
checkForUpdates
(
this
.
workbenchEnvironmentService
.
configuration
.
sessionId
));
case
StateType
.
CheckingForUpdates
:
case
StateType
.
CheckingForUpdates
:
return
new
Action
(
'
update.checking
'
,
nls
.
localize
(
'
checkingForUpdates
'
,
"
Checking for Updates...
"
),
undefined
,
false
);
return
new
Action
(
'
update.checking
'
,
nls
.
localize
(
'
checkingForUpdates
'
,
"
Checking for Updates...
"
),
undefined
,
false
);
...
...
src/vs/workbench/contrib/update/browser/update.ts
浏览文件 @
22316bec
...
@@ -9,7 +9,7 @@ import { Action } from 'vs/base/common/actions';
...
@@ -9,7 +9,7 @@ import { Action } from 'vs/base/common/actions';
import
{
Disposable
,
MutableDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
Disposable
,
MutableDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
IActivityService
,
NumberBadge
,
IBadge
,
ProgressBadge
}
from
'
vs/workbench/services/activity/common/activity
'
;
import
{
IActivityService
,
NumberBadge
,
IBadge
,
ProgressBadge
}
from
'
vs/workbench/services/activity/common/activity
'
;
import
{
IInstantiationService
,
optional
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
GLOBAL_ACTIVITY_ID
}
from
'
vs/workbench/common/activity
'
;
import
{
GLOBAL_ACTIVITY_ID
}
from
'
vs/workbench/common/activity
'
;
import
{
IOpenerService
}
from
'
vs/platform/opener/common/opener
'
;
import
{
IOpenerService
}
from
'
vs/platform/opener/common/opener
'
;
import
{
IWorkbenchContribution
}
from
'
vs/workbench/common/contributions
'
;
import
{
IWorkbenchContribution
}
from
'
vs/workbench/common/contributions
'
;
...
@@ -30,10 +30,6 @@ import { ShowCurrentReleaseNotesActionId } from 'vs/workbench/contrib/update/com
...
@@ -30,10 +30,6 @@ import { ShowCurrentReleaseNotesActionId } from 'vs/workbench/contrib/update/com
import
{
IHostService
}
from
'
vs/workbench/services/host/browser/host
'
;
import
{
IHostService
}
from
'
vs/workbench/services/host/browser/host
'
;
import
{
IProductService
}
from
'
vs/platform/product/common/productService
'
;
import
{
IProductService
}
from
'
vs/platform/product/common/productService
'
;
// TODO@Joao layer breaker
// tslint:disable-next-line: layering
import
{
IElectronEnvironmentService
}
from
'
vs/workbench/services/electron/electron-browser/electronEnvironmentService
'
;
const
CONTEXT_UPDATE_STATE
=
new
RawContextKey
<
string
>
(
'
updateState
'
,
StateType
.
Uninitialized
);
const
CONTEXT_UPDATE_STATE
=
new
RawContextKey
<
string
>
(
'
updateState
'
,
StateType
.
Uninitialized
);
let
releaseNotesManager
:
ReleaseNotesManager
|
undefined
=
undefined
;
let
releaseNotesManager
:
ReleaseNotesManager
|
undefined
=
undefined
;
...
@@ -171,8 +167,6 @@ export class UpdateContribution extends Disposable implements IWorkbenchContribu
...
@@ -171,8 +167,6 @@ export class UpdateContribution extends Disposable implements IWorkbenchContribu
private
readonly
badgeDisposable
=
this
.
_register
(
new
MutableDisposable
());
private
readonly
badgeDisposable
=
this
.
_register
(
new
MutableDisposable
());
private
updateStateContextKey
:
IContextKey
<
string
>
;
private
updateStateContextKey
:
IContextKey
<
string
>
;
private
context
=
`window:
${
this
.
electronEnvironmentService
?
this
.
electronEnvironmentService
.
windowId
:
'
any
'
}
`
;
constructor
(
constructor
(
@
IStorageService
private
readonly
storageService
:
IStorageService
,
@
IStorageService
private
readonly
storageService
:
IStorageService
,
@
IInstantiationService
private
readonly
instantiationService
:
IInstantiationService
,
@
IInstantiationService
private
readonly
instantiationService
:
IInstantiationService
,
...
@@ -182,7 +176,7 @@ export class UpdateContribution extends Disposable implements IWorkbenchContribu
...
@@ -182,7 +176,7 @@ export class UpdateContribution extends Disposable implements IWorkbenchContribu
@
IActivityService
private
readonly
activityService
:
IActivityService
,
@
IActivityService
private
readonly
activityService
:
IActivityService
,
@
IContextKeyService
private
readonly
contextKeyService
:
IContextKeyService
,
@
IContextKeyService
private
readonly
contextKeyService
:
IContextKeyService
,
@
IProductService
private
readonly
productService
:
IProductService
,
@
IProductService
private
readonly
productService
:
IProductService
,
@
optional
(
IElectronEnvironmentService
)
private
readonly
electronEnvironmentService
:
IElectron
EnvironmentService
@
IWorkbenchEnvironmentService
private
readonly
workbenchEnvironmentService
:
IWorkbench
EnvironmentService
)
{
)
{
super
();
super
();
this
.
state
=
updateService
.
state
;
this
.
state
=
updateService
.
state
;
...
@@ -218,7 +212,7 @@ export class UpdateContribution extends Disposable implements IWorkbenchContribu
...
@@ -218,7 +212,7 @@ export class UpdateContribution extends Disposable implements IWorkbenchContribu
case
StateType
.
Idle
:
case
StateType
.
Idle
:
if
(
state
.
error
)
{
if
(
state
.
error
)
{
this
.
onError
(
state
.
error
);
this
.
onError
(
state
.
error
);
}
else
if
(
this
.
state
.
type
===
StateType
.
CheckingForUpdates
&&
this
.
state
.
context
===
this
.
context
)
{
}
else
if
(
this
.
state
.
type
===
StateType
.
CheckingForUpdates
&&
this
.
state
.
context
===
this
.
workbenchEnvironmentService
.
configuration
.
sessionId
)
{
this
.
onUpdateNotAvailable
();
this
.
onUpdateNotAvailable
();
}
}
break
;
break
;
...
@@ -401,7 +395,7 @@ export class UpdateContribution extends Disposable implements IWorkbenchContribu
...
@@ -401,7 +395,7 @@ export class UpdateContribution extends Disposable implements IWorkbenchContribu
}
}
private
registerGlobalActivityActions
():
void
{
private
registerGlobalActivityActions
():
void
{
CommandsRegistry
.
registerCommand
(
'
update.check
'
,
()
=>
this
.
updateService
.
checkForUpdates
(
this
.
context
));
CommandsRegistry
.
registerCommand
(
'
update.check
'
,
()
=>
this
.
updateService
.
checkForUpdates
(
this
.
workbenchEnvironmentService
.
configuration
.
sessionId
));
MenuRegistry
.
appendMenuItem
(
MenuId
.
GlobalActivity
,
{
MenuRegistry
.
appendMenuItem
(
MenuId
.
GlobalActivity
,
{
group
:
'
6_update
'
,
group
:
'
6_update
'
,
command
:
{
command
:
{
...
...
src/vs/workbench/services/environment/browser/environmentService.ts
浏览文件 @
22316bec
...
@@ -43,6 +43,7 @@ export class BrowserWindowConfiguration implements IWindowConfiguration {
...
@@ -43,6 +43,7 @@ export class BrowserWindowConfiguration implements IWindowConfiguration {
readonly
machineId
=
generateUuid
();
readonly
machineId
=
generateUuid
();
windowId
!
:
number
;
windowId
!
:
number
;
sessionId
!
:
string
;
logLevel
!
:
LogLevel
;
logLevel
!
:
LogLevel
;
mainPid
!
:
number
;
mainPid
!
:
number
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录