Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
e23c3d03
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,体验更适合开发者的 AI 搜索 >>
提交
e23c3d03
编写于
7月 14, 2017
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove some unused code (part of #29460)
上级
84628ed1
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
21 addition
and
63 deletion
+21
-63
src/vs/editor/standalone/browser/simpleServices.ts
src/vs/editor/standalone/browser/simpleServices.ts
+0
-4
src/vs/platform/workspace/common/workspace.ts
src/vs/platform/workspace/common/workspace.ts
+5
-24
src/vs/workbench/electron-browser/main.ts
src/vs/workbench/electron-browser/main.ts
+16
-19
src/vs/workbench/services/configuration/node/configuration.ts
...vs/workbench/services/configuration/node/configuration.ts
+0
-4
src/vs/workbench/test/workbenchTestServices.ts
src/vs/workbench/test/workbenchTestServices.ts
+0
-12
未找到文件。
src/vs/editor/standalone/browser/simpleServices.ts
浏览文件 @
e23c3d03
...
...
@@ -560,10 +560,6 @@ export class SimpleWorkspaceContextService implements IWorkspaceContextService {
return
resource
&&
resource
.
scheme
===
SimpleWorkspaceContextService
.
SCHEME
;
}
public
toWorkspaceRelativePath
(
resource
:
URI
,
toOSPath
?:
boolean
):
string
{
return
resource
.
fsPath
;
}
public
toResource
(
workspaceRelativePath
:
string
):
URI
{
return
URI
.
file
(
workspaceRelativePath
);
}
...
...
src/vs/platform/workspace/common/workspace.ts
浏览文件 @
e23c3d03
...
...
@@ -8,7 +8,6 @@ import URI from 'vs/base/common/uri';
import
{
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
*
as
paths
from
'
vs/base/common/paths
'
;
import
{
TrieMap
}
from
'
vs/base/common/map
'
;
import
{
isLinux
}
from
'
vs/base/common/platform
'
;
import
Event
from
'
vs/base/common/event
'
;
export
const
IWorkspaceContextService
=
createDecorator
<
IWorkspaceContextService
>
(
'
contextService
'
);
...
...
@@ -59,13 +58,6 @@ export interface IWorkspaceContextService {
*/
isInsideWorkspace
(
resource
:
URI
):
boolean
;
/**
* Given a resource inside the workspace, returns its relative path from the workspace root
* without leading or trailing slashes. Returns null if the file is not inside an opened
* workspace.
*/
toWorkspaceRelativePath
:
(
resource
:
URI
,
toOSPath
?:
boolean
)
=>
string
;
/**
* Given a workspace relative path, returns the resource with the absolute path.
*/
...
...
@@ -79,6 +71,11 @@ export interface ILegacyWorkspace {
* of the workspace on disk.
*/
resource
:
URI
;
/**
* creation time of the workspace folder if known
*/
ctime
?:
number
;
}
export
interface
IWorkspace
{
...
...
@@ -123,22 +120,6 @@ export class LegacyWorkspace implements ILegacyWorkspace {
return
this
.
_ctime
;
}
public
toWorkspaceRelativePath
(
resource
:
URI
,
toOSPath
?:
boolean
):
string
{
if
(
this
.
contains
(
resource
))
{
return
paths
.
normalize
(
paths
.
relative
(
this
.
_resource
.
fsPath
,
resource
.
fsPath
),
toOSPath
);
}
return
null
;
}
private
contains
(
resource
:
URI
):
boolean
{
if
(
resource
)
{
return
paths
.
isEqualOrParent
(
resource
.
fsPath
,
this
.
_resource
.
fsPath
,
!
isLinux
/* ignorecase */
);
}
return
false
;
}
public
toResource
(
workspaceRelativePath
:
string
,
root
?:
URI
):
URI
{
if
(
typeof
workspaceRelativePath
===
'
string
'
)
{
return
URI
.
file
(
paths
.
join
(
root
?
root
.
fsPath
:
this
.
_resource
.
fsPath
,
workspaceRelativePath
));
...
...
src/vs/workbench/electron-browser/main.ts
浏览文件 @
e23c3d03
...
...
@@ -18,8 +18,8 @@ import paths = require('vs/base/common/paths');
import
uri
from
'
vs/base/common/uri
'
;
import
strings
=
require
(
'
vs/base/common/strings
'
);
import
{
IResourceInput
}
from
'
vs/platform/editor/common/editor
'
;
import
{
LegacyWorkspace
,
Workspa
ce
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
WorkspaceService
,
EmptyWorkspaceServiceImpl
,
WorkspaceServiceImpl
}
from
'
vs/workbench/services/configuration/node/configuration
'
;
import
{
IWorkspaceContextServi
ce
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
EmptyWorkspaceServiceImpl
,
WorkspaceServiceImpl
,
WorkspaceService
}
from
'
vs/workbench/services/configuration/node/configuration
'
;
import
{
realpath
}
from
'
vs/base/node/pfs
'
;
import
{
EnvironmentService
}
from
'
vs/platform/environment/node/environmentService
'
;
import
path
=
require
(
'
path
'
);
...
...
@@ -100,10 +100,8 @@ function openWorkbench(configuration: IWindowConfiguration, options: IOptions):
// Since the configuration service is one of the core services that is used in so many places, we initialize it
// right before startup of the workbench shell to have its data ready for consumers
return
createAndInitializeWorkspaceService
(
configuration
,
environmentService
).
then
(
workspaceService
=>
{
const
workspace
=
<
Workspace
>
workspaceService
.
getWorkspace
();
const
legacyWorkspace
=
<
LegacyWorkspace
>
workspaceService
.
getLegacyWorkspace
();
const
timerService
=
new
TimerService
((
<
any
>
window
).
MonacoEnvironment
.
timers
as
IInitData
,
!!
workspace
);
const
storageService
=
createStorageService
(
legacyWorkspace
,
workspace
,
configuration
,
environmentService
);
const
timerService
=
new
TimerService
((
<
any
>
window
).
MonacoEnvironment
.
timers
as
IInitData
,
!
workspaceService
.
hasWorkspace
());
const
storageService
=
createStorageService
(
configuration
,
workspaceService
,
environmentService
);
timerService
.
beforeDOMContentLoaded
=
Date
.
now
();
...
...
@@ -166,24 +164,23 @@ function validateWorkspacePath(configuration: IWindowConfiguration): TPromise<vo
});
}
function
createStorageService
(
legacyWorkspace
:
LegacyWorkspace
,
workspace
:
Workspace
,
configuration
:
IWindowConfiguration
,
environmentService
:
IEnvironmentService
):
IStorageService
{
function
createStorageService
(
configuration
:
IWindowConfiguration
,
workspaceService
:
IWorkspaceContextService
,
environmentService
:
IEnvironmentService
):
IStorageService
{
const
workspace
=
workspaceService
.
getWorkspace
();
let
workspaceId
:
string
;
let
secondaryWorkspaceId
:
number
;
if
(
workspace
)
{
// in multi root workspace mode we use the provided ID as key for workspace storage
if
(
workspace
.
configuration
)
{
workspaceId
=
uri
.
from
({
path
:
workspace
.
id
,
scheme
:
'
root
'
}).
toString
();
}
// in multi root workspace mode we use the provided ID as key for workspace storage
if
(
workspaceService
.
hasMultiFolderWorkspace
())
{
workspaceId
=
uri
.
from
({
path
:
workspace
.
id
,
scheme
:
'
root
'
}).
toString
();
}
// in single folder mode we use the path of the opened folder as key for workspace storage
// the ctime is used as secondary workspace id to clean up stale UI state if necessary
else
{
workspaceId
=
legacyWorkspace
.
resource
.
toString
();
secondaryWorkspaceId
=
legacyWorkspace
.
ctime
;
}
// in single folder mode we use the path of the opened folder as key for workspace storage
// the ctime is used as secondary workspace id to clean up stale UI state if necessary
else
if
(
workspaceService
.
hasFolderWorkspace
())
{
const
legacyWorkspace
=
workspaceService
.
getLegacyWorkspace
();
workspaceId
=
legacyWorkspace
.
resource
.
toString
()
;
secondaryWorkspaceId
=
legacyWorkspace
.
ctime
;
}
// finaly, if we do not have a workspace open, we need to find another identifier for the window to store
...
...
src/vs/workbench/services/configuration/node/configuration.ts
浏览文件 @
e23c3d03
...
...
@@ -212,10 +212,6 @@ export class WorkspaceService extends Disposable implements IWorkspaceConfigurat
return
!!
this
.
getRoot
(
resource
);
}
public
toWorkspaceRelativePath
(
resource
:
URI
,
toOSPath
?:
boolean
):
string
{
return
this
.
workspace
?
this
.
legacyWorkspace
.
toWorkspaceRelativePath
(
resource
,
toOSPath
)
:
null
;
}
public
toResource
(
workspaceRelativePath
:
string
):
URI
{
return
this
.
workspace
?
this
.
legacyWorkspace
.
toResource
(
workspaceRelativePath
)
:
null
;
}
...
...
src/vs/workbench/test/workbenchTestServices.ts
浏览文件 @
e23c3d03
...
...
@@ -131,23 +131,11 @@ export class TestContextService implements IWorkspaceContextService {
return
false
;
}
public
toWorkspaceRelativePath
(
resource
:
URI
,
toOSPath
?:
boolean
):
string
{
return
makePosixAbsolute
(
paths
.
normalize
(
resource
.
fsPath
.
substr
(
'
c:
'
.
length
),
toOSPath
));
}
public
toResource
(
workspaceRelativePath
:
string
):
URI
{
return
URI
.
file
(
paths
.
join
(
'
C:
\\
'
,
workspaceRelativePath
));
}
}
function
isPosixAbsolute
(
path
:
string
):
boolean
{
return
path
&&
path
[
0
]
===
'
/
'
;
}
function
makePosixAbsolute
(
path
:
string
):
string
{
return
isPosixAbsolute
(
paths
.
normalize
(
path
))
?
path
:
paths
.
sep
+
path
;
}
export
class
TestTextFileService
extends
TextFileService
{
public
cleanupBackupsBeforeShutdownCalled
:
boolean
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录