Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
9df292b5
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,发现更多精彩内容 >>
提交
9df292b5
编写于
7月 19, 2018
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove usages of fspath
上级
9163f689
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
19 addition
and
12 deletion
+19
-12
src/vs/workbench/parts/preferences/common/preferencesContribution.ts
...bench/parts/preferences/common/preferencesContribution.ts
+7
-7
src/vs/workbench/parts/stats/node/workspaceStats.ts
src/vs/workbench/parts/stats/node/workspaceStats.ts
+3
-1
src/vs/workbench/services/files/node/watcher/win32/watcherService.ts
...bench/services/files/node/watcher/win32/watcherService.ts
+4
-0
src/vs/workbench/services/textfile/common/textFileEditorModel.ts
...workbench/services/textfile/common/textFileEditorModel.ts
+3
-2
src/vs/workbench/services/workspace/node/workspaceEditingService.ts
...kbench/services/workspace/node/workspaceEditingService.ts
+2
-2
未找到文件。
src/vs/workbench/parts/preferences/common/preferencesContribution.ts
浏览文件 @
9df292b5
...
...
@@ -23,8 +23,8 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment'
import
{
IEditorInput
}
from
'
vs/workbench/common/editor
'
;
import
{
IWorkspaceContextService
,
WorkbenchState
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
isEqual
}
from
'
vs/base/common/paths
'
;
import
{
isLinux
}
from
'
vs/base/common/platform
'
;
import
{
isEqual
,
hasToIgnoreCase
}
from
'
vs/base/common/resources
'
;
const
schemaRegistry
=
Registry
.
as
<
JSONContributionRegistry
.
IJSONContributionRegistry
>
(
JSONContributionRegistry
.
Extensions
.
JSONContribution
);
...
...
@@ -66,14 +66,14 @@ export class PreferencesContribution implements IWorkbenchContribution {
private
onEditorOpening
(
editor
:
IEditorInput
,
options
:
IEditorOptions
|
ITextEditorOptions
,
group
:
IEditorGroup
):
IOpenEditorOverride
{
const
resource
=
editor
.
getResource
();
if
(
!
resource
||
resource
.
scheme
!==
'
file
'
||
// require a file path opening
!
endsWith
(
resource
.
fsPath
,
'
settings.json
'
)
||
// fil
e must end in settings.json
!
resource
||
!
endsWith
(
resource
.
path
,
'
settings.json
'
)
||
// resourc
e must end in settings.json
!
this
.
configurationService
.
getValue
(
DEFAULT_SETTINGS_EDITOR_SETTING
)
// user has not disabled default settings editor
)
{
return
void
0
;
}
// If the
file
resource was already opened before in the group, do not prevent
// If the resource was already opened before in the group, do not prevent
// the opening of that resource. Otherwise we would have the same settings
// opened twice (https://github.com/Microsoft/vscode/issues/36447)
if
(
group
.
isOpened
(
editor
))
{
...
...
@@ -81,7 +81,7 @@ export class PreferencesContribution implements IWorkbenchContribution {
}
// Global User Settings File
if
(
isEqual
(
resource
.
fsPath
,
this
.
environmentService
.
appSettingsPath
,
!
isLinux
))
{
if
(
isEqual
(
resource
,
URI
.
file
(
this
.
environmentService
.
appSettingsPath
)
,
!
isLinux
))
{
return
{
override
:
this
.
preferencesService
.
openGlobalSettings
(
options
,
group
)
};
}
...
...
@@ -89,7 +89,7 @@ export class PreferencesContribution implements IWorkbenchContribution {
const
state
=
this
.
workspaceService
.
getWorkbenchState
();
if
(
state
===
WorkbenchState
.
FOLDER
)
{
const
folders
=
this
.
workspaceService
.
getWorkspace
().
folders
;
if
(
resource
.
fsPath
===
folders
[
0
].
toResource
(
FOLDER_SETTINGS_PATH
).
fsPath
)
{
if
(
isEqual
(
resource
,
folders
[
0
].
toResource
(
FOLDER_SETTINGS_PATH
),
hasToIgnoreCase
(
resource
))
)
{
return
{
override
:
this
.
preferencesService
.
openWorkspaceSettings
(
options
,
group
)
};
}
}
...
...
@@ -98,7 +98,7 @@ export class PreferencesContribution implements IWorkbenchContribution {
else
if
(
state
===
WorkbenchState
.
WORKSPACE
)
{
const
folders
=
this
.
workspaceService
.
getWorkspace
().
folders
;
for
(
let
i
=
0
;
i
<
folders
.
length
;
i
++
)
{
if
(
resource
.
fsPath
===
folders
[
i
].
toResource
(
FOLDER_SETTINGS_PATH
).
fsPath
)
{
if
(
isEqual
(
resource
,
folders
[
i
].
toResource
(
FOLDER_SETTINGS_PATH
),
hasToIgnoreCase
(
resource
))
)
{
return
{
override
:
this
.
preferencesService
.
openFolderSettings
(
folders
[
i
].
uri
,
options
,
group
)
};
}
}
...
...
src/vs/workbench/parts/stats/node/workspaceStats.ts
浏览文件 @
9df292b5
...
...
@@ -16,6 +16,7 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment'
import
{
IWindowConfiguration
,
IWindowService
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IWorkbenchContribution
}
from
'
vs/workbench/common/contributions
'
;
import
{
endsWith
}
from
'
vs/base/common/strings
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
const
SshProtocolMatcher
=
/^
([^
@:
]
+@
)?([^
:
]
+
)
:/
;
const
SshUrlMatcher
=
/^
([^
@:
]
+@
)?([^
:
]
+
)
:
(
.+
)
$/
;
...
...
@@ -240,7 +241,8 @@ export class WorkspaceStats implements IWorkbenchContribution {
workspaceId
=
void
0
;
break
;
case
WorkbenchState
.
FOLDER
:
workspaceId
=
crypto
.
createHash
(
'
sha1
'
).
update
(
workspace
.
folders
[
0
].
uri
.
fsPath
).
digest
(
'
hex
'
);
// TODO: #54483 @Ben
workspaceId
=
crypto
.
createHash
(
'
sha1
'
).
update
(
workspace
.
folders
[
0
].
uri
.
scheme
===
Schemas
.
file
?
workspace
.
folders
[
0
].
uri
.
fsPath
:
workspace
.
folders
[
0
].
uri
.
toString
()).
digest
(
'
hex
'
);
break
;
case
WorkbenchState
.
WORKSPACE
:
workspaceId
=
crypto
.
createHash
(
'
sha1
'
).
update
(
workspace
.
configuration
.
fsPath
).
digest
(
'
hex
'
);
...
...
src/vs/workbench/services/files/node/watcher/win32/watcherService.ts
浏览文件 @
9df292b5
...
...
@@ -12,6 +12,7 @@ import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace
import
{
normalize
}
from
'
path
'
;
import
{
rtrim
,
endsWith
}
from
'
vs/base/common/strings
'
;
import
{
sep
}
from
'
vs/base/common/paths
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
export
class
FileWatcher
{
private
isDisposed
:
boolean
;
...
...
@@ -26,6 +27,9 @@ export class FileWatcher {
}
public
startWatching
():
()
=>
void
{
if
(
this
.
contextService
.
getWorkspace
().
folders
[
0
].
uri
.
scheme
!==
Schemas
.
file
)
{
return
()
=>
{
};
}
let
basePath
:
string
=
normalize
(
this
.
contextService
.
getWorkspace
().
folders
[
0
].
uri
.
fsPath
);
if
(
basePath
&&
basePath
.
indexOf
(
'
\\\\
'
)
===
0
&&
endsWith
(
basePath
,
sep
))
{
...
...
src/vs/workbench/services/textfile/common/textFileEditorModel.ts
浏览文件 @
9df292b5
...
...
@@ -33,6 +33,7 @@ import { INotificationService } from 'vs/platform/notification/common/notificati
import
{
isLinux
}
from
'
vs/base/common/platform
'
;
import
{
IDisposable
,
toDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
isEqual
,
isEqualOrParent
,
hasToIgnoreCase
}
from
'
vs/base/common/resources
'
;
/**
* The text file editor model listens to changes to its underlying code editor model and saves these changes through the file service back to the disk.
...
...
@@ -778,13 +779,13 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
}
// Check for global settings file
if
(
path
.
isEqual
(
this
.
resource
.
fsPath
,
this
.
environmentService
.
appSettingsPath
,
!
isLinux
))
{
if
(
isEqual
(
this
.
resource
,
URI
.
file
(
this
.
environmentService
.
appSettingsPath
)
,
!
isLinux
))
{
return
true
;
}
// Check for workspace settings file
return
this
.
contextService
.
getWorkspace
().
folders
.
some
(
folder
=>
{
return
path
.
isEqualOrParent
(
this
.
resource
.
fsPath
,
path
.
join
(
folder
.
uri
.
fsPath
,
'
.vscode
'
));
return
isEqualOrParent
(
this
.
resource
,
folder
.
toResource
(
'
.vscode
'
),
hasToIgnoreCase
(
this
.
resource
));
});
}
...
...
src/vs/workbench/services/workspace/node/workspaceEditingService.ts
浏览文件 @
9df292b5
...
...
@@ -26,7 +26,7 @@ import { BackupFileService } from 'vs/workbench/services/backup/node/backupFileS
import
{
ICommandService
}
from
'
vs/platform/commands/common/commands
'
;
import
{
distinct
}
from
'
vs/base/common/arrays
'
;
import
{
isLinux
}
from
'
vs/base/common/platform
'
;
import
{
isEqual
}
from
'
vs/base/common/resources
'
;
import
{
isEqual
,
hasToIgnoreCase
}
from
'
vs/base/common/resources
'
;
import
{
INotificationService
,
Severity
}
from
'
vs/platform/notification/common/notification
'
;
export
class
WorkspaceEditingService
implements
IWorkspaceEditingService
{
...
...
@@ -138,7 +138,7 @@ export class WorkspaceEditingService implements IWorkspaceEditingService {
private
includesSingleFolderWorkspace
(
folders
:
URI
[]):
boolean
{
if
(
this
.
contextService
.
getWorkbenchState
()
===
WorkbenchState
.
FOLDER
)
{
const
workspaceFolder
=
this
.
contextService
.
getWorkspace
().
folders
[
0
];
return
(
folders
.
some
(
folder
=>
isEqual
(
folder
,
workspaceFolder
.
uri
,
!
isLinux
)));
return
(
folders
.
some
(
folder
=>
isEqual
(
folder
,
workspaceFolder
.
uri
,
hasToIgnoreCase
(
folder
)
)));
}
return
false
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录