Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
f041bc0c
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,发现更多精彩内容 >>
提交
f041bc0c
编写于
12月 10, 2018
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove labelService from main side
fixes #57788
上级
c33f4b2e
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
21 addition
and
44 deletion
+21
-44
src/tsconfig.strictNullChecks.json
src/tsconfig.strictNullChecks.json
+1
-2
src/vs/code/electron-main/app.ts
src/vs/code/electron-main/app.ts
+0
-6
src/vs/code/electron-main/main.ts
src/vs/code/electron-main/main.ts
+0
-2
src/vs/platform/history/electron-main/historyMainService.ts
src/vs/platform/history/electron-main/historyMainService.ts
+6
-6
src/vs/platform/label/common/label.ts
src/vs/platform/label/common/label.ts
+14
-0
src/vs/platform/label/electron-browser/label.contribution.ts
src/vs/platform/label/electron-browser/label.contribution.ts
+0
-27
src/vs/workbench/workbench.main.ts
src/vs/workbench/workbench.main.ts
+0
-1
未找到文件。
src/tsconfig.strictNullChecks.json
浏览文件 @
f041bc0c
...
...
@@ -460,7 +460,6 @@
"./vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts"
,
"./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"
,
...
...
@@ -747,4 +746,4 @@
"exclude"
:
[
"./typings/require-monaco.d.ts"
]
}
\ No newline at end of file
}
src/vs/code/electron-main/app.ts
浏览文件 @
f041bc0c
...
...
@@ -61,7 +61,6 @@ import { connectRemoteAgentManagement, RemoteAgentConnectionContext } from 'vs/p
import
{
IMenubarService
}
from
'
vs/platform/menubar/common/menubar
'
;
import
{
MenubarService
}
from
'
vs/platform/menubar/electron-main/menubarService
'
;
import
{
MenubarChannel
}
from
'
vs/platform/menubar/node/menubarIpc
'
;
import
{
ILabelService
,
RegisterFormatterEvent
}
from
'
vs/platform/label/common/label
'
;
import
{
hasArgs
}
from
'
vs/platform/environment/node/argv
'
;
import
{
RunOnceScheduler
}
from
'
vs/base/common/async
'
;
import
{
registerContextMenuListener
}
from
'
vs/base/parts/contextmenu/electron-main/contextmenu
'
;
...
...
@@ -98,7 +97,6 @@ export class CodeApplication extends Disposable {
@
IConfigurationService
private
configurationService
:
ConfigurationService
,
@
IStateService
private
stateService
:
IStateService
,
@
IHistoryMainService
private
historyMainService
:
IHistoryMainService
,
@
ILabelService
private
labelService
:
ILabelService
)
{
super
();
...
...
@@ -318,10 +316,6 @@ export class CodeApplication extends Disposable {
}
});
ipc
.
on
(
'
vscode:labelRegisterFormatter
'
,
(
event
:
any
,
data
:
RegisterFormatterEvent
)
=>
{
this
.
labelService
.
registerFormatter
(
data
.
selector
,
data
.
formatter
);
});
ipc
.
on
(
'
vscode:toggleDevTools
'
,
(
event
:
Event
)
=>
{
event
.
sender
.
toggleDevTools
();
});
...
...
src/vs/code/electron-main/main.ts
浏览文件 @
f041bc0c
...
...
@@ -47,7 +47,6 @@ import { uploadLogs } from 'vs/code/electron-main/logUploader';
import
{
setUnexpectedErrorHandler
}
from
'
vs/base/common/errors
'
;
import
{
IDialogService
}
from
'
vs/platform/dialogs/common/dialogs
'
;
import
{
CommandLineDialogService
}
from
'
vs/platform/dialogs/node/dialogService
'
;
import
{
ILabelService
,
LabelService
}
from
'
vs/platform/label/common/label
'
;
import
{
createWaitMarkerFile
}
from
'
vs/code/node/wait
'
;
function
createServices
(
args
:
ParsedArgs
,
bufferLogService
:
BufferLogService
):
IInstantiationService
{
...
...
@@ -60,7 +59,6 @@ function createServices(args: ParsedArgs, bufferLogService: BufferLogService): I
setTimeout
(()
=>
cleanupOlderLogs
(
environmentService
).
then
(
null
,
err
=>
console
.
error
(
err
)),
10000
);
services
.
set
(
IEnvironmentService
,
environmentService
);
services
.
set
(
ILabelService
,
new
LabelService
(
environmentService
,
void
0
,
void
0
));
services
.
set
(
ILogService
,
logService
);
services
.
set
(
IWorkspacesMainService
,
new
SyncDescriptor
(
WorkspacesMainService
));
services
.
set
(
IHistoryMainService
,
new
SyncDescriptor
(
HistoryMainService
));
...
...
src/vs/platform/history/electron-main/historyMainService.ts
浏览文件 @
f041bc0c
...
...
@@ -8,7 +8,7 @@ import * as arrays from 'vs/base/common/arrays';
import
{
IStateService
}
from
'
vs/platform/state/common/state
'
;
import
{
app
}
from
'
electron
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
getBaseLabel
}
from
'
vs/base/common/labels
'
;
import
{
getBaseLabel
,
getPathLabel
}
from
'
vs/base/common/labels
'
;
import
{
IPath
}
from
'
vs/platform/windows/common/windows
'
;
import
{
Event
as
CommonEvent
,
Emitter
}
from
'
vs/base/common/event
'
;
import
{
isWindows
,
isMacintosh
,
isLinux
}
from
'
vs/base/common/platform
'
;
...
...
@@ -19,7 +19,8 @@ import { RunOnceScheduler } from 'vs/base/common/async';
import
{
getComparisonKey
,
isEqual
as
areResourcesEqual
,
dirname
}
from
'
vs/base/common/resources
'
;
import
{
URI
,
UriComponents
}
from
'
vs/base/common/uri
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
ILabelService
}
from
'
vs/platform/label/common/label
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
getSimpleWorkspaceLabel
}
from
'
vs/platform/label/common/label
'
;
interface
ISerializedRecentlyOpened
{
workspaces2
:
(
IWorkspaceIdentifier
|
string
)[];
// IWorkspaceIdentifier or URI.toString()
...
...
@@ -49,7 +50,7 @@ export class HistoryMainService implements IHistoryMainService {
@
IStateService
private
stateService
:
IStateService
,
@
ILogService
private
logService
:
ILogService
,
@
IWorkspacesMainService
private
workspacesMainService
:
IWorkspacesMainService
,
@
I
LabelService
private
labelService
:
ILabel
Service
@
I
EnvironmentService
private
environmentService
:
IEnvironment
Service
)
{
this
.
macOSRecentDocumentsUpdater
=
new
RunOnceScheduler
(()
=>
this
.
updateMacOSRecentDocuments
(),
800
);
...
...
@@ -58,7 +59,6 @@ export class HistoryMainService implements IHistoryMainService {
private
registerListeners
():
void
{
this
.
workspacesMainService
.
onWorkspaceSaved
(
e
=>
this
.
onWorkspaceSaved
(
e
));
this
.
labelService
.
onDidRegisterFormatter
(()
=>
this
.
_onRecentlyOpenedChange
.
fire
());
}
private
onWorkspaceSaved
(
e
:
IWorkspaceSavedEvent
):
void
{
...
...
@@ -370,12 +370,12 @@ export class HistoryMainService implements IHistoryMainService {
type
:
'
custom
'
,
name
:
nls
.
localize
(
'
recentFolders
'
,
"
Recent Workspaces
"
),
items
:
arrays
.
coalesce
(
this
.
getRecentlyOpened
().
workspaces
.
slice
(
0
,
7
/* limit number of entries here */
).
map
(
workspace
=>
{
const
title
=
this
.
labelService
.
getWorkspaceLabel
(
workspac
e
);
const
title
=
getSimpleWorkspaceLabel
(
workspace
,
this
.
environmentService
.
workspacesHom
e
);
let
description
;
let
args
;
if
(
isSingleFolderWorkspaceIdentifier
(
workspace
))
{
const
parentFolder
=
dirname
(
workspace
);
description
=
parentFolder
?
nls
.
localize
(
'
folderDesc
'
,
"
{0} {1}
"
,
getBaseLabel
(
workspace
),
this
.
labelService
.
getUriLabel
(
parentFolder
))
:
getBaseLabel
(
workspace
);
description
=
parentFolder
?
nls
.
localize
(
'
folderDesc
'
,
"
{0} {1}
"
,
getBaseLabel
(
workspace
),
getPathLabel
(
parentFolder
,
this
.
environmentService
))
:
getBaseLabel
(
workspace
);
args
=
`--folder-uri "
${
workspace
.
toString
()}
"`
;
}
else
{
description
=
nls
.
localize
(
'
codeWorkspace
'
,
"
Code Workspace
"
);
...
...
src/vs/platform/label/common/label.ts
浏览文件 @
f041bc0c
...
...
@@ -61,6 +61,20 @@ function hasDriveLetter(path: string): boolean {
return
!!
(
isWindows
&&
path
&&
path
[
2
]
===
'
:
'
);
}
export
function
getSimpleWorkspaceLabel
(
workspace
:
IWorkspaceIdentifier
|
URI
,
workspaceHome
:
string
):
string
{
if
(
isSingleFolderWorkspaceIdentifier
(
workspace
))
{
return
basenameOrAuthority
(
workspace
);
}
// Workspace: Untitled
if
(
isParent
(
workspace
.
configPath
,
workspaceHome
,
!
isLinux
/* ignore case */
))
{
return
localize
(
'
untitledWorkspace
'
,
"
Untitled (Workspace)
"
);
}
const
filename
=
basename
(
workspace
.
configPath
);
const
workspaceName
=
filename
.
substr
(
0
,
filename
.
length
-
WORKSPACE_EXTENSION
.
length
-
1
);
return
localize
(
'
workspaceName
'
,
"
{0} (Workspace)
"
,
workspaceName
);
}
export
class
LabelService
implements
ILabelService
{
_serviceBrand
:
any
;
...
...
src/vs/platform/label/electron-browser/label.contribution.ts
已删除
100644 → 0
浏览文件 @
c33f4b2e
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// TODO@Isidor bad layering
// tslint:disable-next-line:import-patterns
import
{
IWorkbenchContribution
,
IWorkbenchContributionsRegistry
,
Extensions
as
WorkbenchExtensions
}
from
'
vs/workbench/common/contributions
'
;
import
{
ILabelService
}
from
'
vs/platform/label/common/label
'
;
import
{
ipcRenderer
as
ipc
}
from
'
electron
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
LifecyclePhase
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
/**
* Uri display registration needs to be shared from renderer to main.
* Since there will be another instance of the uri display service running on main.
*/
class
LabelRegistrationContribution
implements
IWorkbenchContribution
{
constructor
(@
ILabelService
labelService
:
ILabelService
)
{
labelService
.
onDidRegisterFormatter
(
data
=>
{
ipc
.
send
(
'
vscode:labelRegisterFormatter
'
,
data
);
});
}
}
Registry
.
as
<
IWorkbenchContributionsRegistry
>
(
WorkbenchExtensions
.
Workbench
).
registerWorkbenchContribution
(
LabelRegistrationContribution
,
LifecyclePhase
.
Starting
);
src/vs/workbench/workbench.main.ts
浏览文件 @
f041bc0c
...
...
@@ -15,7 +15,6 @@ import 'vs/editor/editor.all';
// Platform
import
'
vs/platform/widget/browser/contextScopedHistoryWidget
'
;
import
'
vs/platform/label/electron-browser/label.contribution
'
;
// Menus/Actions
import
'
vs/workbench/services/actions/electron-browser/menusExtensionPoint
'
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录