Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
e09c8ef0
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,发现更多精彩内容 >>
提交
e09c8ef0
编写于
5月 08, 2020
作者:
R
Rob Lourens
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix #90981
上级
5e5fdffc
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
19 addition
and
33 deletion
+19
-33
src/vs/platform/configuration/common/configuration.ts
src/vs/platform/configuration/common/configuration.ts
+0
-2
src/vs/workbench/contrib/preferences/browser/preferencesWidgets.ts
...rkbench/contrib/preferences/browser/preferencesWidgets.ts
+15
-11
src/vs/workbench/services/configuration/browser/configurationService.ts
...ch/services/configuration/browser/configurationService.ts
+1
-18
src/vs/workbench/services/configuration/common/configurationEditingService.ts
...vices/configuration/common/configurationEditingService.ts
+1
-1
src/vs/workbench/services/preferences/browser/preferencesService.ts
...kbench/services/preferences/browser/preferencesService.ts
+1
-1
src/vs/workbench/services/preferences/common/preferences.ts
src/vs/workbench/services/preferences/common/preferences.ts
+1
-0
未找到文件。
src/vs/platform/configuration/common/configuration.ts
浏览文件 @
e09c8ef0
...
...
@@ -123,8 +123,6 @@ export interface IConfigurationService {
workspaceFolder
:
string
[];
memory
?:
string
[];
};
getConfigurationFileResource
(
target
:
ConfigurationTarget
,
resource
:
URI
|
null
|
undefined
):
URI
|
null
;
}
export
interface
IConfigurationModel
{
...
...
src/vs/workbench/contrib/preferences/browser/preferencesWidgets.ts
浏览文件 @
e09c8ef0
...
...
@@ -20,7 +20,7 @@ import { ICursorPositionChangedEvent } from 'vs/editor/common/controller/cursorE
import
{
Position
}
from
'
vs/editor/common/core/position
'
;
import
{
IModelDeltaDecoration
,
TrackedRangeStickiness
}
from
'
vs/editor/common/model
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
ConfigurationTarget
,
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
ConfigurationTarget
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IContextKey
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IContextMenuService
,
IContextViewService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
...
...
@@ -32,7 +32,7 @@ import { ICssStyleCollector, IColorTheme, IThemeService, registerThemingParticip
import
{
IWorkspaceContextService
,
IWorkspaceFolder
,
WorkbenchState
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
PANEL_ACTIVE_TITLE_BORDER
,
PANEL_ACTIVE_TITLE_FOREGROUND
,
PANEL_INACTIVE_TITLE_FOREGROUND
}
from
'
vs/workbench/common/theme
'
;
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
ISettingsGroup
}
from
'
vs/workbench/services/preferences/common/preferences
'
;
import
{
ISettingsGroup
,
IPreferencesService
}
from
'
vs/workbench/services/preferences/common/preferences
'
;
import
{
EditorOption
}
from
'
vs/editor/common/config/editorOptions
'
;
import
{
isEqual
}
from
'
vs/base/common/resources
'
;
import
{
registerIcon
,
Codicon
}
from
'
vs/base/common/codicons
'
;
...
...
@@ -311,7 +311,7 @@ export class FolderSettingsActionViewItem extends BaseActionViewItem {
action
:
IAction
,
@
IWorkspaceContextService
private
readonly
contextService
:
IWorkspaceContextService
,
@
IContextMenuService
private
readonly
contextMenuService
:
IContextMenuService
,
@
I
ConfigurationService
private
readonly
configurationService
:
IConfiguration
Service
,
@
I
PreferencesService
private
readonly
preferencesService
:
IPreferences
Service
,
)
{
super
(
null
,
action
);
const
workspace
=
this
.
contextService
.
getWorkspace
();
...
...
@@ -401,14 +401,14 @@ export class FolderSettingsActionViewItem extends BaseActionViewItem {
}
}
private
update
():
void
{
private
async
update
():
Promise
<
void
>
{
let
total
=
0
;
this
.
_folderSettingCounts
.
forEach
(
n
=>
total
+=
n
);
const
workspace
=
this
.
contextService
.
getWorkspace
();
if
(
this
.
_folder
)
{
this
.
labelElement
.
textContent
=
this
.
_folder
.
name
;
this
.
anchorElement
.
title
=
this
.
configurationService
.
getConfigurationFileResource
(
ConfigurationTarget
.
WORKSPACE_FOLDER
,
this
.
_folder
.
uri
)?.
fsPath
||
''
;
this
.
anchorElement
.
title
=
(
await
this
.
preferencesService
.
getEditableSettingsURI
(
ConfigurationTarget
.
WORKSPACE_FOLDER
,
this
.
_folder
.
uri
)
)?.
fsPath
||
''
;
const
detailsText
=
this
.
labelWithCount
(
this
.
_action
.
label
,
total
);
this
.
detailsElement
.
textContent
=
detailsText
;
DOM
.
toggleClass
(
this
.
dropDownElement
,
'
hide
'
,
workspace
.
folders
.
length
===
1
||
!
this
.
_action
.
checked
);
...
...
@@ -490,7 +490,7 @@ export class SettingsTargetsWidget extends Widget {
@
IInstantiationService
private
readonly
instantiationService
:
IInstantiationService
,
@
IWorkbenchEnvironmentService
private
readonly
environmentService
:
IWorkbenchEnvironmentService
,
@
ILabelService
private
readonly
labelService
:
ILabelService
,
@
I
ConfigurationService
private
readonly
configurationService
:
IConfiguration
Service
,
@
I
PreferencesService
private
readonly
preferencesSerivce
:
IPreferences
Service
,
)
{
super
();
this
.
options
=
options
||
{};
...
...
@@ -509,14 +509,19 @@ export class SettingsTargetsWidget extends Widget {
}));
this
.
userLocalSettings
=
new
Action
(
'
userSettings
'
,
localize
(
'
userSettings
'
,
"
User
"
),
'
.settings-tab
'
,
true
,
()
=>
this
.
updateTarget
(
ConfigurationTarget
.
USER_LOCAL
));
this
.
userLocalSettings
.
tooltip
=
this
.
configurationService
.
getConfigurationFileResource
(
ConfigurationTarget
.
USER_LOCAL
,
undefined
)?.
fsPath
||
''
;
this
.
preferencesSerivce
.
getEditableSettingsURI
(
ConfigurationTarget
.
USER_LOCAL
).
then
(
uri
=>
{
// Don't wait to create UI on resolving remote
this
.
userLocalSettings
.
tooltip
=
uri
?.
fsPath
||
''
;
});
const
remoteAuthority
=
this
.
environmentService
.
configuration
.
remoteAuthority
;
const
hostLabel
=
remoteAuthority
&&
this
.
labelService
.
getHostLabel
(
REMOTE_HOST_SCHEME
,
remoteAuthority
);
const
remoteSettingsLabel
=
localize
(
'
userSettingsRemote
'
,
"
Remote
"
)
+
(
hostLabel
?
` [
${
hostLabel
}
]`
:
''
);
this
.
userRemoteSettings
=
new
Action
(
'
userSettingsRemote
'
,
remoteSettingsLabel
,
'
.settings-tab
'
,
true
,
()
=>
this
.
updateTarget
(
ConfigurationTarget
.
USER_REMOTE
));
this
.
userRemoteSettings
.
tooltip
=
this
.
configurationService
.
getConfigurationFileResource
(
ConfigurationTarget
.
USER_REMOTE
,
undefined
)?.
fsPath
||
''
;
this
.
preferencesSerivce
.
getEditableSettingsURI
(
ConfigurationTarget
.
USER_REMOTE
).
then
(
uri
=>
{
this
.
userRemoteSettings
.
tooltip
=
uri
?.
fsPath
||
''
;
});
this
.
workspaceSettings
=
new
Action
(
'
workspaceSettings
'
,
localize
(
'
workspaceSettings
'
,
"
Workspace
"
),
'
.settings-tab
'
,
false
,
()
=>
this
.
updateTarget
(
ConfigurationTarget
.
WORKSPACE
));
...
...
@@ -588,15 +593,14 @@ export class SettingsTargetsWidget extends Widget {
return
Promise
.
resolve
(
undefined
);
}
private
update
():
void
{
private
async
update
():
Promise
<
void
>
{
DOM
.
toggleClass
(
this
.
settingsSwitcherBar
.
domNode
,
'
empty-workbench
'
,
this
.
contextService
.
getWorkbenchState
()
===
WorkbenchState
.
EMPTY
);
this
.
userRemoteSettings
.
enabled
=
!!
(
this
.
options
.
enableRemoteSettings
&&
this
.
environmentService
.
configuration
.
remoteAuthority
);
this
.
workspaceSettings
.
enabled
=
this
.
contextService
.
getWorkbenchState
()
!==
WorkbenchState
.
EMPTY
;
this
.
folderSettings
.
getAction
().
enabled
=
this
.
contextService
.
getWorkbenchState
()
===
WorkbenchState
.
WORKSPACE
&&
this
.
contextService
.
getWorkspace
().
folders
.
length
>
0
;
this
.
workspaceSettings
.
tooltip
=
this
.
configurationService
.
getConfigurationFileResource
(
ConfigurationTarget
.
WORKSPACE
,
undefined
)?.
fsPath
||
''
;
this
.
workspaceSettings
.
tooltip
=
(
await
this
.
preferencesSerivce
.
getEditableSettingsURI
(
ConfigurationTarget
.
WORKSPACE
)
)?.
fsPath
||
''
;
}
}
export
interface
SearchOptions
extends
IInputOptions
{
...
...
src/vs/workbench/services/configuration/browser/configurationService.ts
浏览文件 @
e09c8ef0
...
...
@@ -14,7 +14,7 @@ import { IWorkspaceContextService, Workspace, WorkbenchState, IWorkspaceFolder,
import
{
ConfigurationModel
,
DefaultConfigurationModel
,
ConfigurationChangeEvent
,
AllKeysConfigurationChangeEvent
,
mergeChanges
}
from
'
vs/platform/configuration/common/configurationModels
'
;
import
{
IConfigurationChangeEvent
,
ConfigurationTarget
,
IConfigurationOverrides
,
keyFromOverrideIdentifier
,
isConfigurationOverrides
,
IConfigurationData
,
IConfigurationService
,
IConfigurationValue
,
IConfigurationChange
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
Configuration
}
from
'
vs/workbench/services/configuration/common/configurationModels
'
;
import
{
FOLDER_CONFIG_FOLDER_NAME
,
defaultSettingsSchemaId
,
userSettingsSchemaId
,
workspaceSettingsSchemaId
,
folderSettingsSchemaId
,
IConfigurationCache
,
machineSettingsSchemaId
,
LOCAL_MACHINE_SCOPES
,
FOLDER_SETTINGS_PATH
}
from
'
vs/workbench/services/configuration/common/configuration
'
;
import
{
FOLDER_CONFIG_FOLDER_NAME
,
defaultSettingsSchemaId
,
userSettingsSchemaId
,
workspaceSettingsSchemaId
,
folderSettingsSchemaId
,
IConfigurationCache
,
machineSettingsSchemaId
,
LOCAL_MACHINE_SCOPES
}
from
'
vs/workbench/services/configuration/common/configuration
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
IConfigurationRegistry
,
Extensions
,
allSettings
,
windowSettings
,
resourceSettings
,
applicationSettings
,
machineSettings
,
machineOverridableSettings
}
from
'
vs/platform/configuration/common/configurationRegistry
'
;
import
{
IWorkspaceIdentifier
,
isWorkspaceIdentifier
,
IStoredWorkspaceFolder
,
isStoredWorkspaceFolder
,
IWorkspaceFolderCreationData
,
ISingleFolderWorkspaceIdentifier
,
isSingleFolderWorkspaceIdentifier
,
IWorkspaceInitializationPayload
,
isSingleFolderWorkspaceInitializationPayload
,
ISingleFolderWorkspaceInitializationPayload
,
IEmptyWorkspaceInitializationPayload
,
useSlashForPath
,
getStoredWorkspaceFolder
}
from
'
vs/platform/workspaces/common/workspaces
'
;
...
...
@@ -310,23 +310,6 @@ export class WorkspaceService extends Disposable implements IConfigurationServic
}
}
public
getConfigurationFileResource
(
target
:
ConfigurationTarget
,
resource
:
URI
|
null
|
undefined
):
URI
|
null
{
let
editableTarget
:
EditableConfigurationTarget
;
if
(
target
===
ConfigurationTarget
.
USER
||
target
===
ConfigurationTarget
.
USER_LOCAL
)
{
editableTarget
=
EditableConfigurationTarget
.
USER_LOCAL
;
}
else
if
(
target
===
ConfigurationTarget
.
USER_REMOTE
)
{
editableTarget
=
EditableConfigurationTarget
.
USER_REMOTE
;
}
else
if
(
target
===
ConfigurationTarget
.
WORKSPACE
)
{
editableTarget
=
EditableConfigurationTarget
.
WORKSPACE
;
}
else
if
(
target
===
ConfigurationTarget
.
WORKSPACE_FOLDER
)
{
editableTarget
=
EditableConfigurationTarget
.
WORKSPACE_FOLDER
;
}
else
{
return
null
;
}
return
this
.
configurationEditingService
?.
getConfigurationFileResource
(
editableTarget
,
FOLDER_SETTINGS_PATH
,
resource
);
}
private
createWorkspace
(
arg
:
IWorkspaceInitializationPayload
):
Promise
<
Workspace
>
{
if
(
isWorkspaceIdentifier
(
arg
))
{
return
this
.
createMultiFolderWorkspace
(
arg
);
...
...
src/vs/workbench/services/configuration/common/configurationEditingService.ts
浏览文件 @
e09c8ef0
...
...
@@ -578,7 +578,7 @@ export class ConfigurationEditingService {
return
!!
(
workspace
.
configuration
&&
resource
&&
workspace
.
configuration
.
fsPath
===
resource
.
fsPath
);
}
p
ublic
getConfigurationFileResource
(
target
:
EditableConfigurationTarget
,
relativePath
:
string
,
resource
:
URI
|
null
|
undefined
):
URI
|
null
{
p
rivate
getConfigurationFileResource
(
target
:
EditableConfigurationTarget
,
relativePath
:
string
,
resource
:
URI
|
null
|
undefined
):
URI
|
null
{
if
(
target
===
EditableConfigurationTarget
.
USER_LOCAL
)
{
if
(
relativePath
)
{
return
resources
.
joinPath
(
resources
.
dirname
(
this
.
environmentService
.
settingsResource
),
relativePath
);
...
...
src/vs/workbench/services/preferences/browser/preferencesService.ts
浏览文件 @
e09c8ef0
...
...
@@ -518,7 +518,7 @@ export class PreferencesService extends Disposable implements IPreferencesServic
return
this
.
_defaultUserSettingsContentModel
;
}
p
rivate
async
getEditableSettingsURI
(
configurationTarget
:
ConfigurationTarget
,
resource
?:
URI
):
Promise
<
URI
|
null
>
{
p
ublic
async
getEditableSettingsURI
(
configurationTarget
:
ConfigurationTarget
,
resource
?:
URI
):
Promise
<
URI
|
null
>
{
switch
(
configurationTarget
)
{
case
ConfigurationTarget
.
USER
:
case
ConfigurationTarget
.
USER_LOCAL
:
...
...
src/vs/workbench/services/preferences/common/preferences.ts
浏览文件 @
e09c8ef0
...
...
@@ -207,6 +207,7 @@ export interface IPreferencesService {
switchSettings
(
target
:
ConfigurationTarget
,
resource
:
URI
,
jsonEditor
?:
boolean
):
Promise
<
void
>
;
openGlobalKeybindingSettings
(
textual
:
boolean
):
Promise
<
void
>
;
openDefaultKeybindingsFile
():
Promise
<
IEditorPane
|
undefined
>
;
getEditableSettingsURI
(
configurationTarget
:
ConfigurationTarget
,
resource
?:
URI
):
Promise
<
URI
|
null
>
;
}
export
function
getSettingsTargetName
(
target
:
ConfigurationTarget
,
resource
:
URI
,
workspaceContextService
:
IWorkspaceContextService
):
string
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录