Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
d77341bf
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,发现更多精彩内容 >>
提交
d77341bf
编写于
6月 11, 2019
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
use URI for appSettingsHome
上级
18f4630b
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
24 addition
and
27 deletion
+24
-27
src/vs/code/node/cliProcessMain.ts
src/vs/code/node/cliProcessMain.ts
+1
-1
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
+6
-5
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/localizations/browser/localizations.contribution.ts
...ntrib/localizations/browser/localizations.contribution.ts
+2
-3
src/vs/workbench/contrib/localizations/browser/localizationsActions.ts
...nch/contrib/localizations/browser/localizationsActions.ts
+2
-3
src/vs/workbench/contrib/snippets/browser/configureSnippets.ts
...s/workbench/contrib/snippets/browser/configureSnippets.ts
+4
-4
src/vs/workbench/contrib/snippets/browser/snippetsService.ts
src/vs/workbench/contrib/snippets/browser/snippetsService.ts
+1
-2
src/vs/workbench/services/extensions/electron-browser/extensionHost.ts
...nch/services/extensions/electron-browser/extensionHost.ts
+1
-1
src/vs/workbench/services/textfile/common/textFileEditorModel.ts
...workbench/services/textfile/common/textFileEditorModel.ts
+3
-4
src/vs/workbench/services/textfile/node/textFileService.ts
src/vs/workbench/services/textfile/node/textFileService.ts
+1
-1
未找到文件。
src/vs/code/node/cliProcessMain.ts
浏览文件 @
d77341bf
...
...
@@ -283,7 +283,7 @@ export async function main(argv: ParsedArgs): Promise<void> {
process
.
once
(
'
exit
'
,
()
=>
logService
.
dispose
());
logService
.
info
(
'
main
'
,
argv
);
await
Promise
.
all
([
environmentService
.
appSettingsHome
,
environmentService
.
extensionsPath
].
map
(
p
=>
mkdirp
(
p
)));
await
Promise
.
all
([
environmentService
.
appSettingsHome
.
fsPath
,
environmentService
.
extensionsPath
].
map
(
p
=>
mkdirp
(
p
)));
const
configurationService
=
new
ConfigurationService
(
environmentService
.
settingsResource
);
await
configurationService
.
initialize
();
...
...
src/vs/platform/environment/common/environment.ts
浏览文件 @
d77341bf
...
...
@@ -96,7 +96,7 @@ export interface IEnvironmentService {
appNameLong
:
string
;
appQuality
?:
string
;
appSettingsHome
:
string
;
appSettingsHome
:
URI
;
settingsResource
:
URI
;
appKeybindingsPath
:
string
;
...
...
src/vs/platform/environment/node/environmentService.ts
浏览文件 @
d77341bf
...
...
@@ -8,6 +8,7 @@ import * as crypto from 'crypto';
import
*
as
paths
from
'
vs/base/node/paths
'
;
import
*
as
os
from
'
os
'
;
import
*
as
path
from
'
vs/base/common/path
'
;
import
*
as
resources
from
'
vs/base/common/resources
'
;
import
{
memoize
}
from
'
vs/base/common/decorators
'
;
import
pkg
from
'
vs/platform/product/node/package
'
;
import
product
from
'
vs/platform/product/node/product
'
;
...
...
@@ -108,10 +109,10 @@ export class EnvironmentService implements IEnvironmentService {
get
appQuality
():
string
|
undefined
{
return
product
.
quality
;
}
@
memoize
get
appSettingsHome
():
string
{
return
path
.
join
(
this
.
userDataPath
,
'
User
'
);
}
get
appSettingsHome
():
URI
{
return
URI
.
file
(
path
.
join
(
this
.
userDataPath
,
'
User
'
)
);
}
@
memoize
get
settingsResource
():
URI
{
return
URI
.
file
(
path
.
join
(
this
.
appSettingsHome
,
'
settings.json
'
)
);
}
get
settingsResource
():
URI
{
return
resources
.
joinPath
(
this
.
appSettingsHome
,
'
settings.json
'
);
}
@
memoize
get
machineSettingsHome
():
string
{
return
path
.
join
(
this
.
userDataPath
,
'
Machine
'
);
}
...
...
@@ -120,10 +121,10 @@ export class EnvironmentService implements IEnvironmentService {
get
machineSettingsPath
():
string
{
return
path
.
join
(
this
.
machineSettingsHome
,
'
settings.json
'
);
}
@
memoize
get
globalStorageHome
():
string
{
return
path
.
join
(
this
.
appSettingsHome
,
'
globalStorage
'
);
}
get
globalStorageHome
():
string
{
return
path
.
join
(
this
.
appSettingsHome
.
fsPath
,
'
globalStorage
'
);
}
@
memoize
get
workspaceStorageHome
():
string
{
return
path
.
join
(
this
.
appSettingsHome
,
'
workspaceStorage
'
);
}
get
workspaceStorageHome
():
string
{
return
path
.
join
(
this
.
appSettingsHome
.
fsPath
,
'
workspaceStorage
'
);
}
@
memoize
get
settingsSearchBuildId
():
number
|
undefined
{
return
product
.
settingsSearchBuildId
;
}
...
...
@@ -132,7 +133,7 @@ export class EnvironmentService implements IEnvironmentService {
get
settingsSearchUrl
():
string
|
undefined
{
return
product
.
settingsSearchUrl
;
}
@
memoize
get
appKeybindingsPath
():
string
{
return
path
.
join
(
this
.
appSettingsHome
,
'
keybindings.json
'
);
}
get
appKeybindingsPath
():
string
{
return
path
.
join
(
this
.
appSettingsHome
.
fsPath
,
'
keybindings.json
'
);
}
@
memoize
get
isExtensionDevelopment
():
boolean
{
return
!!
this
.
_args
.
extensionDevelopmentPath
;
}
...
...
src/vs/workbench/browser/web.main.ts
浏览文件 @
d77341bf
...
...
@@ -139,7 +139,7 @@ class CodeRendererMain extends Disposable {
const
environmentService
=
new
SimpleWorkbenchEnvironmentService
();
environmentService
.
appRoot
=
'
/web/
'
;
environmentService
.
args
=
{
_
:
[]
};
environmentService
.
appSettingsHome
=
'
/web/settings
'
;
environmentService
.
appSettingsHome
=
toResource
(
'
/web/settings
'
)
;
environmentService
.
settingsResource
=
this
.
configuration
.
settingsUri
;
environmentService
.
appKeybindingsPath
=
'
/web/settings/keybindings.json
'
;
environmentService
.
logsPath
=
'
/web/logs
'
;
...
...
src/vs/workbench/browser/web.simpleservices.ts
浏览文件 @
d77341bf
...
...
@@ -196,7 +196,7 @@ export class SimpleWorkbenchEnvironmentService implements IWorkbenchEnvironmentS
userDataPath
:
string
;
appNameLong
:
string
;
appQuality
?:
string
;
appSettingsHome
:
string
;
appSettingsHome
:
URI
;
settingsResource
:
URI
;
appKeybindingsPath
:
string
;
machineSettingsHome
:
string
;
...
...
src/vs/workbench/contrib/localizations/browser/localizations.contribution.ts
浏览文件 @
d77341bf
...
...
@@ -20,8 +20,6 @@ import { INotificationService } from 'vs/platform/notification/common/notificati
import
Severity
from
'
vs/base/common/severity
'
;
import
{
IJSONEditingService
}
from
'
vs/workbench/services/configuration/common/jsonEditing
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
join
}
from
'
vs/base/common/path
'
;
import
{
IWindowsService
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
{
IViewletService
}
from
'
vs/workbench/services/viewlet/browser/viewlet
'
;
...
...
@@ -30,6 +28,7 @@ import { minimumTranslatedStrings } from 'vs/workbench/contrib/localizations/bro
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
CancellationToken
}
from
'
vs/base/common/cancellation
'
;
import
{
ExtensionType
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
joinPath
}
from
'
vs/base/common/resources
'
;
// Register action to configure locale and related settings
const
registry
=
Registry
.
as
<
IWorkbenchActionRegistry
>
(
Extensions
.
WorkbenchActions
);
...
...
@@ -82,7 +81,7 @@ export class LocalizationWorkbenchContribution extends Disposable implements IWo
[{
label
:
updateAndRestart
?
localize
(
'
yes
'
,
"
Yes
"
)
:
localize
(
'
restart now
'
,
"
Restart Now
"
),
run
:
()
=>
{
const
file
=
URI
.
file
(
join
(
this
.
environmentService
.
appSettingsHome
,
'
locale.json
'
)
);
const
file
=
joinPath
(
this
.
environmentService
.
appSettingsHome
,
'
locale.json
'
);
const
updatePromise
=
updateAndRestart
?
this
.
jsonEditingService
.
write
(
file
,
{
key
:
'
locale
'
,
value
:
locale
},
true
)
:
Promise
.
resolve
(
undefined
);
updatePromise
.
then
(()
=>
this
.
windowsService
.
relaunch
({}),
e
=>
this
.
notificationService
.
error
(
e
));
}
...
...
src/vs/workbench/contrib/localizations/browser/localizationsActions.ts
浏览文件 @
d77341bf
...
...
@@ -6,8 +6,6 @@
import
{
localize
}
from
'
vs/nls
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
join
}
from
'
vs/base/common/path
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
ILocalizationsService
,
LanguageType
}
from
'
vs/platform/localizations/common/localizations
'
;
import
{
IQuickInputService
,
IQuickPickItem
}
from
'
vs/platform/quickinput/common/quickInput
'
;
import
{
IJSONEditingService
}
from
'
vs/workbench/services/configuration/common/jsonEditing
'
;
...
...
@@ -18,6 +16,7 @@ import { firstIndex } from 'vs/base/common/arrays';
import
{
IExtensionsViewlet
,
VIEWLET_ID
as
EXTENSIONS_VIEWLET_ID
}
from
'
vs/workbench/contrib/extensions/common/extensions
'
;
import
{
IViewletService
}
from
'
vs/workbench/services/viewlet/browser/viewlet
'
;
import
{
IDialogService
}
from
'
vs/platform/dialogs/common/dialogs
'
;
import
{
joinPath
}
from
'
vs/base/common/resources
'
;
export
class
ConfigureLocaleAction
extends
Action
{
public
static
readonly
ID
=
'
workbench.action.configureLocale
'
;
...
...
@@ -67,7 +66,7 @@ export class ConfigureLocaleAction extends Action {
}
if
(
selectedLanguage
)
{
const
file
=
URI
.
file
(
join
(
this
.
environmentService
.
appSettingsHome
,
'
locale.json
'
)
);
const
file
=
joinPath
(
this
.
environmentService
.
appSettingsHome
,
'
locale.json
'
);
await
this
.
jsonEditingService
.
write
(
file
,
{
key
:
'
locale
'
,
value
:
selectedLanguage
.
label
},
true
);
const
restart
=
await
this
.
dialogService
.
confirm
({
type
:
'
info
'
,
...
...
src/vs/workbench/contrib/snippets/browser/configureSnippets.ts
浏览文件 @
d77341bf
...
...
@@ -7,7 +7,7 @@ import * as nls from 'vs/nls';
import
{
CommandsRegistry
}
from
'
vs/platform/commands/common/commands
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
import
{
join
,
basename
,
extname
}
from
'
vs/base/common/path
'
;
import
{
basename
,
extname
}
from
'
vs/base/common/path
'
;
import
{
MenuRegistry
,
MenuId
}
from
'
vs/platform/actions/common/actions
'
;
import
{
IOpenerService
}
from
'
vs/platform/opener/common/opener
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
...
...
@@ -88,14 +88,14 @@ async function computePicks(snippetService: ISnippetsService, envService: IEnvir
}
}
const
dir
=
join
(
envService
.
appSettingsHome
,
'
snippets
'
);
const
dir
=
join
Path
(
envService
.
appSettingsHome
,
'
snippets
'
);
for
(
const
mode
of
modeService
.
getRegisteredModes
())
{
const
label
=
modeService
.
getLanguageName
(
mode
);
if
(
label
&&
!
seen
.
has
(
mode
))
{
future
.
push
({
label
:
mode
,
description
:
`(
${
label
}
)`
,
filepath
:
URI
.
file
(
join
(
dir
,
`
${
mode
}
.json`
)
),
filepath
:
joinPath
(
dir
,
`
${
mode
}
.json`
),
hint
:
true
});
}
...
...
@@ -220,7 +220,7 @@ CommandsRegistry.registerCommand(id, async (accessor): Promise<any> => {
const
globalSnippetPicks
:
SnippetPick
[]
=
[{
scope
:
nls
.
localize
(
'
new.global_scope
'
,
'
global
'
),
label
:
nls
.
localize
(
'
new.global
'
,
"
New Global Snippets file...
"
),
uri
:
URI
.
file
(
join
(
envService
.
appSettingsHome
,
'
snippets
'
)
)
uri
:
joinPath
(
envService
.
appSettingsHome
,
'
snippets
'
)
}];
const
workspaceSnippetPicks
:
SnippetPick
[]
=
[];
...
...
src/vs/workbench/contrib/snippets/browser/snippetsService.ts
浏览文件 @
d77341bf
...
...
@@ -3,7 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
join
}
from
'
vs/base/common/path
'
;
import
{
IJSONSchema
}
from
'
vs/base/common/jsonSchema
'
;
import
{
combinedDisposable
,
dispose
,
IDisposable
,
DisposableStore
}
from
'
vs/base/common/lifecycle
'
;
import
{
values
}
from
'
vs/base/common/map
'
;
...
...
@@ -290,7 +289,7 @@ class SnippetsService implements ISnippetsService {
}
private
_initUserSnippets
():
Promise
<
any
>
{
const
userSnippetsFolder
=
URI
.
file
(
join
(
this
.
_environmentService
.
appSettingsHome
,
'
snippets
'
)
);
const
userSnippetsFolder
=
resources
.
joinPath
(
this
.
_environmentService
.
appSettingsHome
,
'
snippets
'
);
return
this
.
_fileService
.
createFolder
(
userSnippetsFolder
).
then
(()
=>
this
.
_initFolderSnippets
(
SnippetSource
.
User
,
userSnippetsFolder
,
this
.
_disposables
));
}
...
...
src/vs/workbench/services/extensions/electron-browser/extensionHost.ts
浏览文件 @
d77341bf
...
...
@@ -387,7 +387,7 @@ export class ExtensionHostProcessWorker implements IExtensionHostStarter {
environment
:
{
isExtensionDevelopmentDebug
:
this
.
_isExtensionDevDebug
,
appRoot
:
this
.
_environmentService
.
appRoot
?
URI
.
file
(
this
.
_environmentService
.
appRoot
)
:
undefined
,
appSettingsHome
:
this
.
_environmentService
.
appSettingsHome
?
URI
.
file
(
this
.
_environmentService
.
appSettingsHome
)
:
undefined
,
appSettingsHome
:
this
.
_environmentService
.
appSettingsHome
?
this
.
_environmentService
.
appSettingsHome
:
undefined
,
appName
:
product
.
nameLong
,
appUriScheme
:
product
.
urlProtocol
,
appLanguage
:
platform
.
language
,
...
...
src/vs/workbench/services/textfile/common/textFileEditorModel.ts
浏览文件 @
d77341bf
...
...
@@ -3,7 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
join
}
from
'
vs/base/common/path
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
import
{
guessMimeTypes
}
from
'
vs/base/common/mime
'
;
...
...
@@ -28,7 +27,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
,
extname
,
basename
}
from
'
vs/base/common/resources
'
;
import
{
isEqual
,
isEqualOrParent
,
extname
,
basename
,
joinPath
}
from
'
vs/base/common/resources
'
;
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
...
...
@@ -793,12 +792,12 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
}
// Check for locale file
if
(
isEqual
(
this
.
resource
,
URI
.
file
(
join
(
this
.
environmentService
.
appSettingsHome
,
'
locale.json
'
)
),
!
isLinux
))
{
if
(
isEqual
(
this
.
resource
,
joinPath
(
this
.
environmentService
.
appSettingsHome
,
'
locale.json
'
),
!
isLinux
))
{
return
'
locale
'
;
}
// Check for snippets
if
(
isEqualOrParent
(
this
.
resource
,
URI
.
file
(
join
(
this
.
environmentService
.
appSettingsHome
,
'
snippets
'
)
)))
{
if
(
isEqualOrParent
(
this
.
resource
,
joinPath
(
this
.
environmentService
.
appSettingsHome
,
'
snippets
'
)))
{
return
'
snippets
'
;
}
...
...
src/vs/workbench/services/textfile/node/textFileService.ts
浏览文件 @
d77341bf
...
...
@@ -390,7 +390,7 @@ export class EncodingOracle extends Disposable implements IResourceEncodings {
const
defaultEncodingOverrides
:
IEncodingOverride
[]
=
[];
// Global settings
defaultEncodingOverrides
.
push
({
parent
:
URI
.
file
(
this
.
environmentService
.
appSettingsHome
)
,
encoding
:
UTF8
});
defaultEncodingOverrides
.
push
({
parent
:
this
.
environmentService
.
appSettingsHome
,
encoding
:
UTF8
});
// Workspace files
defaultEncodingOverrides
.
push
({
extension
:
WORKSPACE_EXTENSION
,
encoding
:
UTF8
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录