Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
cf7b5675
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cf7b5675
编写于
6月 11, 2019
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#75079 Use URI for keybindings path
上级
d77341bf
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
11 addition
and
11 deletion
+11
-11
src/vs/platform/environment/common/environment.ts
src/vs/platform/environment/common/environment.ts
+1
-1
src/vs/platform/environment/node/environmentService.ts
src/vs/platform/environment/node/environmentService.ts
+1
-1
src/vs/workbench/browser/web.main.ts
src/vs/workbench/browser/web.main.ts
+1
-1
src/vs/workbench/browser/web.simpleservices.ts
src/vs/workbench/browser/web.simpleservices.ts
+1
-1
src/vs/workbench/contrib/preferences/browser/preferences.contribution.ts
...h/contrib/preferences/browser/preferences.contribution.ts
+1
-1
src/vs/workbench/services/keybinding/common/keybindingEditing.ts
...workbench/services/keybinding/common/keybindingEditing.ts
+1
-1
src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts
...services/keybinding/electron-browser/keybindingService.ts
+1
-1
src/vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts
...eybinding/test/electron-browser/keybindingEditing.test.ts
+2
-2
src/vs/workbench/services/preferences/browser/preferencesService.ts
...kbench/services/preferences/browser/preferencesService.ts
+1
-1
src/vs/workbench/services/textfile/common/textFileEditorModel.ts
...workbench/services/textfile/common/textFileEditorModel.ts
+1
-1
未找到文件。
src/vs/platform/environment/common/environment.ts
浏览文件 @
cf7b5675
...
@@ -98,7 +98,7 @@ export interface IEnvironmentService {
...
@@ -98,7 +98,7 @@ export interface IEnvironmentService {
appQuality
?:
string
;
appQuality
?:
string
;
appSettingsHome
:
URI
;
appSettingsHome
:
URI
;
settingsResource
:
URI
;
settingsResource
:
URI
;
appKeybindingsPath
:
string
;
keybindingsResource
:
URI
;
machineSettingsHome
:
string
;
machineSettingsHome
:
string
;
machineSettingsPath
:
string
;
machineSettingsPath
:
string
;
...
...
src/vs/platform/environment/node/environmentService.ts
浏览文件 @
cf7b5675
...
@@ -133,7 +133,7 @@ export class EnvironmentService implements IEnvironmentService {
...
@@ -133,7 +133,7 @@ export class EnvironmentService implements IEnvironmentService {
get
settingsSearchUrl
():
string
|
undefined
{
return
product
.
settingsSearchUrl
;
}
get
settingsSearchUrl
():
string
|
undefined
{
return
product
.
settingsSearchUrl
;
}
@
memoize
@
memoize
get
appKeybindingsPath
():
string
{
return
path
.
join
(
this
.
appSettingsHome
.
fsPath
,
'
keybindings.json
'
);
}
get
keybindingsResource
():
URI
{
return
resources
.
joinPath
(
this
.
appSettingsHome
,
'
keybindings.json
'
);
}
@
memoize
@
memoize
get
isExtensionDevelopment
():
boolean
{
return
!!
this
.
_args
.
extensionDevelopmentPath
;
}
get
isExtensionDevelopment
():
boolean
{
return
!!
this
.
_args
.
extensionDevelopmentPath
;
}
...
...
src/vs/workbench/browser/web.main.ts
浏览文件 @
cf7b5675
...
@@ -141,7 +141,7 @@ class CodeRendererMain extends Disposable {
...
@@ -141,7 +141,7 @@ class CodeRendererMain extends Disposable {
environmentService
.
args
=
{
_
:
[]
};
environmentService
.
args
=
{
_
:
[]
};
environmentService
.
appSettingsHome
=
toResource
(
'
/web/settings
'
);
environmentService
.
appSettingsHome
=
toResource
(
'
/web/settings
'
);
environmentService
.
settingsResource
=
this
.
configuration
.
settingsUri
;
environmentService
.
settingsResource
=
this
.
configuration
.
settingsUri
;
environmentService
.
appKeybindingsPath
=
'
/web/settings/keybindings.json
'
;
environmentService
.
keybindingsResource
=
toResource
(
'
/web/settings/keybindings.json
'
)
;
environmentService
.
logsPath
=
'
/web/logs
'
;
environmentService
.
logsPath
=
'
/web/logs
'
;
environmentService
.
debugExtensionHost
=
{
environmentService
.
debugExtensionHost
=
{
port
:
null
,
port
:
null
,
...
...
src/vs/workbench/browser/web.simpleservices.ts
浏览文件 @
cf7b5675
...
@@ -198,7 +198,7 @@ export class SimpleWorkbenchEnvironmentService implements IWorkbenchEnvironmentS
...
@@ -198,7 +198,7 @@ export class SimpleWorkbenchEnvironmentService implements IWorkbenchEnvironmentS
appQuality
?:
string
;
appQuality
?:
string
;
appSettingsHome
:
URI
;
appSettingsHome
:
URI
;
settingsResource
:
URI
;
settingsResource
:
URI
;
appKeybindingsPath
:
string
;
keybindingsResource
:
URI
;
machineSettingsHome
:
string
;
machineSettingsHome
:
string
;
machineSettingsPath
:
string
;
machineSettingsPath
:
string
;
settingsSearchBuildId
?:
number
;
settingsSearchBuildId
?:
number
;
...
...
src/vs/workbench/contrib/preferences/browser/preferences.contribution.ts
浏览文件 @
cf7b5675
...
@@ -385,7 +385,7 @@ class PreferencesActionsContribution extends Disposable implements IWorkbenchCon
...
@@ -385,7 +385,7 @@ class PreferencesActionsContribution extends Disposable implements IWorkbenchCon
dark
:
URI
.
parse
(
require
.
toUrl
(
`vs/workbench/contrib/preferences/browser/media/preferences-editor-inverse.svg`
))
dark
:
URI
.
parse
(
require
.
toUrl
(
`vs/workbench/contrib/preferences/browser/media/preferences-editor-inverse.svg`
))
}
}
},
},
when
:
ResourceContextKey
.
Resource
.
isEqualTo
(
URI
.
file
(
environmentService
.
appKeybindingsPath
)
.
toString
()),
when
:
ResourceContextKey
.
Resource
.
isEqualTo
(
environmentService
.
keybindingsResource
.
toString
()),
group
:
'
navigation
'
,
group
:
'
navigation
'
,
order
:
1
order
:
1
});
});
...
...
src/vs/workbench/services/keybinding/common/keybindingEditing.ts
浏览文件 @
cf7b5675
...
@@ -44,7 +44,7 @@ export class KeybindingsEditingService extends Disposable implements IKeybinding
...
@@ -44,7 +44,7 @@ export class KeybindingsEditingService extends Disposable implements IKeybinding
public
_serviceBrand
:
any
;
public
_serviceBrand
:
any
;
private
queue
:
Queue
<
void
>
;
private
queue
:
Queue
<
void
>
;
private
resource
:
URI
=
URI
.
file
(
this
.
environmentService
.
appKeybindingsPath
)
;
private
resource
:
URI
=
this
.
environmentService
.
keybindingsResource
;
constructor
(
constructor
(
@
ITextModelService
private
readonly
textModelResolverService
:
ITextModelService
,
@
ITextModelService
private
readonly
textModelResolverService
:
ITextModelService
,
...
...
src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts
浏览文件 @
cf7b5675
...
@@ -305,7 +305,7 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService {
...
@@ -305,7 +305,7 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService {
this
.
_cachedResolver
=
null
;
this
.
_cachedResolver
=
null
;
this
.
_firstTimeComputingResolver
=
true
;
this
.
_firstTimeComputingResolver
=
true
;
this
.
userKeybindings
=
this
.
_register
(
new
ConfigWatcher
(
environmentService
.
appKeybinding
sPath
,
{
defaultConfig
:
[],
onError
:
error
=>
onUnexpectedError
(
error
)
}));
this
.
userKeybindings
=
this
.
_register
(
new
ConfigWatcher
(
environmentService
.
keybindingsResource
.
f
sPath
,
{
defaultConfig
:
[],
onError
:
error
=>
onUnexpectedError
(
error
)
}));
keybindingsExtPoint
.
setHandler
((
extensions
)
=>
{
keybindingsExtPoint
.
setHandler
((
extensions
)
=>
{
...
...
src/vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts
浏览文件 @
cf7b5675
...
@@ -66,7 +66,7 @@ suite('KeybindingsEditing', () => {
...
@@ -66,7 +66,7 @@ suite('KeybindingsEditing', () => {
instantiationService
=
new
TestInstantiationService
();
instantiationService
=
new
TestInstantiationService
();
instantiationService
.
stub
(
IEnvironmentService
,
<
IEnvironmentService
>
{
appKeybindingsPath
:
keybindingsFile
,
settingsResource
:
URI
.
file
(
path
.
join
(
testDir
,
'
settings.json
'
))
});
instantiationService
.
stub
(
IEnvironmentService
,
<
IEnvironmentService
>
{
keybindingsResource
:
URI
.
file
(
keybindingsFile
)
,
settingsResource
:
URI
.
file
(
path
.
join
(
testDir
,
'
settings.json
'
))
});
instantiationService
.
stub
(
IConfigurationService
,
ConfigurationService
);
instantiationService
.
stub
(
IConfigurationService
,
ConfigurationService
);
instantiationService
.
stub
(
IConfigurationService
,
'
getValue
'
,
{
'
eol
'
:
'
\n
'
});
instantiationService
.
stub
(
IConfigurationService
,
'
getValue
'
,
{
'
eol
'
:
'
\n
'
});
instantiationService
.
stub
(
IConfigurationService
,
'
onDidUpdateConfiguration
'
,
()
=>
{
});
instantiationService
.
stub
(
IConfigurationService
,
'
onDidUpdateConfiguration
'
,
()
=>
{
});
...
@@ -146,7 +146,7 @@ suite('KeybindingsEditing', () => {
...
@@ -146,7 +146,7 @@ suite('KeybindingsEditing', () => {
test
(
'
edit a default keybinding to a non existing keybindings file
'
,
()
=>
{
test
(
'
edit a default keybinding to a non existing keybindings file
'
,
()
=>
{
keybindingsFile
=
path
.
join
(
testDir
,
'
nonExistingFile.json
'
);
keybindingsFile
=
path
.
join
(
testDir
,
'
nonExistingFile.json
'
);
instantiationService
.
get
(
IEnvironmentService
).
appKeybindingsPath
=
keybindingsFile
;
instantiationService
.
get
(
IEnvironmentService
).
keybindingsResource
=
URI
.
file
(
keybindingsFile
)
;
testObject
=
instantiationService
.
createInstance
(
KeybindingsEditingService
);
testObject
=
instantiationService
.
createInstance
(
KeybindingsEditingService
);
const
expected
:
IUserFriendlyKeybinding
[]
=
[{
key
:
'
alt+c
'
,
command
:
'
a
'
},
{
key
:
'
escape
'
,
command
:
'
-a
'
}];
const
expected
:
IUserFriendlyKeybinding
[]
=
[{
key
:
'
alt+c
'
,
command
:
'
a
'
},
{
key
:
'
escape
'
,
command
:
'
-a
'
}];
...
...
src/vs/workbench/services/preferences/browser/preferencesService.ts
浏览文件 @
cf7b5675
...
@@ -273,7 +273,7 @@ export class PreferencesService extends Disposable implements IPreferencesServic
...
@@ -273,7 +273,7 @@ export class PreferencesService extends Disposable implements IPreferencesServic
this
.
telemetryService
.
publicLog
(
'
openKeybindings
'
,
{
textual
});
this
.
telemetryService
.
publicLog
(
'
openKeybindings
'
,
{
textual
});
if
(
textual
)
{
if
(
textual
)
{
const
emptyContents
=
'
//
'
+
nls
.
localize
(
'
emptyKeybindingsHeader
'
,
"
Place your key bindings in this file to override the defaults
"
)
+
'
\n
[
\n
]
'
;
const
emptyContents
=
'
//
'
+
nls
.
localize
(
'
emptyKeybindingsHeader
'
,
"
Place your key bindings in this file to override the defaults
"
)
+
'
\n
[
\n
]
'
;
const
editableKeybindings
=
URI
.
file
(
this
.
environmentService
.
appKeybindingsPath
)
;
const
editableKeybindings
=
this
.
environmentService
.
keybindingsResource
;
const
openDefaultKeybindings
=
!!
this
.
configurationService
.
getValue
(
'
workbench.settings.openDefaultKeybindings
'
);
const
openDefaultKeybindings
=
!!
this
.
configurationService
.
getValue
(
'
workbench.settings.openDefaultKeybindings
'
);
// Create as needed and open in editor
// Create as needed and open in editor
...
...
src/vs/workbench/services/textfile/common/textFileEditorModel.ts
浏览文件 @
cf7b5675
...
@@ -787,7 +787,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
...
@@ -787,7 +787,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
}
}
// Check for keybindings file
// Check for keybindings file
if
(
isEqual
(
this
.
resource
,
URI
.
file
(
this
.
environmentService
.
appKeybindingsPath
)
,
!
isLinux
))
{
if
(
isEqual
(
this
.
resource
,
this
.
environmentService
.
keybindingsResource
,
!
isLinux
))
{
return
'
keybindings
'
;
return
'
keybindings
'
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录