Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
25a0274d
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,发现更多精彩内容 >>
提交
25a0274d
编写于
10月 20, 2017
作者:
R
Ramya Achutha Rao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Reverting hashservice
上级
dc44eab7
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
44 addition
and
47 deletion
+44
-47
src/vs/platform/telemetry/common/telemetryUtils.ts
src/vs/platform/telemetry/common/telemetryUtils.ts
+29
-2
src/vs/workbench/common/editor/resourceEditorInput.ts
src/vs/workbench/common/editor/resourceEditorInput.ts
+2
-4
src/vs/workbench/common/editor/untitledEditorInput.ts
src/vs/workbench/common/editor/untitledEditorInput.ts
+2
-4
src/vs/workbench/electron-browser/shell.ts
src/vs/workbench/electron-browser/shell.ts
+0
-5
src/vs/workbench/parts/files/common/editors/fileEditorInput.ts
...s/workbench/parts/files/common/editors/fileEditorInput.ts
+2
-4
src/vs/workbench/parts/html/common/htmlInput.ts
src/vs/workbench/parts/html/common/htmlInput.ts
+2
-4
src/vs/workbench/parts/preferences/browser/preferencesEditor.ts
.../workbench/parts/preferences/browser/preferencesEditor.ts
+2
-4
src/vs/workbench/parts/welcome/walkThrough/node/walkThroughInput.ts
...kbench/parts/welcome/walkThrough/node/walkThroughInput.ts
+2
-4
src/vs/workbench/services/keybinding/test/node/keybindingEditing.test.ts
...h/services/keybinding/test/node/keybindingEditing.test.ts
+1
-3
src/vs/workbench/services/textfile/common/textFileEditorModel.ts
...workbench/services/textfile/common/textFileEditorModel.ts
+2
-3
src/vs/workbench/test/workbenchTestServices.ts
src/vs/workbench/test/workbenchTestServices.ts
+0
-10
未找到文件。
src/vs/platform/telemetry/common/telemetryUtils.ts
浏览文件 @
25a0274d
...
@@ -39,6 +39,33 @@ export function combinedAppender(...appenders: ITelemetryAppender[]): ITelemetry
...
@@ -39,6 +39,33 @@ export function combinedAppender(...appenders: ITelemetryAppender[]): ITelemetry
export
const
NullAppender
:
ITelemetryAppender
=
{
log
:
()
=>
null
};
export
const
NullAppender
:
ITelemetryAppender
=
{
log
:
()
=>
null
};
// --- util
export
function
anonymize
(
input
:
string
):
string
{
if
(
!
input
)
{
return
input
;
}
let
r
=
''
;
for
(
let
i
=
0
;
i
<
input
.
length
;
i
++
)
{
let
ch
=
input
[
i
];
if
(
ch
>=
'
0
'
&&
ch
<=
'
9
'
)
{
r
+=
'
0
'
;
continue
;
}
if
(
ch
>=
'
a
'
&&
ch
<=
'
z
'
)
{
r
+=
'
a
'
;
continue
;
}
if
(
ch
>=
'
A
'
&&
ch
<=
'
Z
'
)
{
r
+=
'
A
'
;
continue
;
}
r
+=
ch
;
}
return
r
;
}
/* __GDPR__FRAGMENT__
/* __GDPR__FRAGMENT__
"URIDescriptor" : {
"URIDescriptor" : {
"mimeType" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
"mimeType" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
...
@@ -52,9 +79,9 @@ export interface URIDescriptor {
...
@@ -52,9 +79,9 @@ export interface URIDescriptor {
path
?:
string
;
path
?:
string
;
}
}
export
function
telemetryURIDescriptor
(
uri
:
URI
,
hashPath
:
(
path
:
string
)
=>
string
):
URIDescriptor
{
export
function
telemetryURIDescriptor
(
uri
:
URI
):
URIDescriptor
{
const
fsPath
=
uri
&&
uri
.
fsPath
;
const
fsPath
=
uri
&&
uri
.
fsPath
;
return
fsPath
?
{
mimeType
:
guessMimeTypes
(
fsPath
).
join
(
'
,
'
),
ext
:
paths
.
extname
(
fsPath
),
path
:
hashPath
(
fsPath
)
}
:
{};
return
fsPath
?
{
mimeType
:
guessMimeTypes
(
fsPath
).
join
(
'
,
'
),
ext
:
paths
.
extname
(
fsPath
),
path
:
anonymize
(
fsPath
)
}
:
{};
}
}
/**
/**
...
...
src/vs/workbench/common/editor/resourceEditorInput.ts
浏览文件 @
25a0274d
...
@@ -11,7 +11,6 @@ import { IReference } from 'vs/base/common/lifecycle';
...
@@ -11,7 +11,6 @@ import { IReference } from 'vs/base/common/lifecycle';
import
{
telemetryURIDescriptor
}
from
'
vs/platform/telemetry/common/telemetryUtils
'
;
import
{
telemetryURIDescriptor
}
from
'
vs/platform/telemetry/common/telemetryUtils
'
;
import
{
ITextModelService
}
from
'
vs/editor/common/services/resolverService
'
;
import
{
ITextModelService
}
from
'
vs/editor/common/services/resolverService
'
;
import
{
ResourceEditorModel
}
from
'
vs/workbench/common/editor/resourceEditorModel
'
;
import
{
ResourceEditorModel
}
from
'
vs/workbench/common/editor/resourceEditorModel
'
;
import
{
IHashService
}
from
'
vs/workbench/services/hash/common/hashService
'
;
/**
/**
* A read-only text editor input whos contents are made of the provided resource that points to an existing
* A read-only text editor input whos contents are made of the provided resource that points to an existing
...
@@ -30,8 +29,7 @@ export class ResourceEditorInput extends EditorInput {
...
@@ -30,8 +29,7 @@ export class ResourceEditorInput extends EditorInput {
name
:
string
,
name
:
string
,
description
:
string
,
description
:
string
,
resource
:
URI
,
resource
:
URI
,
@
ITextModelService
private
textModelResolverService
:
ITextModelService
,
@
ITextModelService
private
textModelResolverService
:
ITextModelService
@
IHashService
private
hashService
:
IHashService
)
{
)
{
super
();
super
();
...
@@ -72,7 +70,7 @@ export class ResourceEditorInput extends EditorInput {
...
@@ -72,7 +70,7 @@ export class ResourceEditorInput extends EditorInput {
public
getTelemetryDescriptor
():
object
{
public
getTelemetryDescriptor
():
object
{
const
descriptor
=
super
.
getTelemetryDescriptor
();
const
descriptor
=
super
.
getTelemetryDescriptor
();
descriptor
[
'
resource
'
]
=
telemetryURIDescriptor
(
this
.
resource
,
path
=>
this
.
hashService
.
createSHA1
(
path
)
);
descriptor
[
'
resource
'
]
=
telemetryURIDescriptor
(
this
.
resource
);
/* __GDPR__FRAGMENT__
/* __GDPR__FRAGMENT__
"EditorTelemetryDescriptor" : {
"EditorTelemetryDescriptor" : {
...
...
src/vs/workbench/common/editor/untitledEditorInput.ts
浏览文件 @
25a0274d
...
@@ -22,7 +22,6 @@ import { ITextFileService } from 'vs/workbench/services/textfile/common/textfile
...
@@ -22,7 +22,6 @@ import { ITextFileService } from 'vs/workbench/services/textfile/common/textfile
import
{
telemetryURIDescriptor
}
from
'
vs/platform/telemetry/common/telemetryUtils
'
;
import
{
telemetryURIDescriptor
}
from
'
vs/platform/telemetry/common/telemetryUtils
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
Verbosity
}
from
'
vs/platform/editor/common/editor
'
;
import
{
Verbosity
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IHashService
}
from
'
vs/workbench/services/hash/common/hashService
'
;
/**
/**
* An editor input to be used for untitled text buffers.
* An editor input to be used for untitled text buffers.
...
@@ -49,8 +48,7 @@ export class UntitledEditorInput extends EditorInput implements IEncodingSupport
...
@@ -49,8 +48,7 @@ export class UntitledEditorInput extends EditorInput implements IEncodingSupport
@
IInstantiationService
private
instantiationService
:
IInstantiationService
,
@
IInstantiationService
private
instantiationService
:
IInstantiationService
,
@
IWorkspaceContextService
private
contextService
:
IWorkspaceContextService
,
@
IWorkspaceContextService
private
contextService
:
IWorkspaceContextService
,
@
ITextFileService
private
textFileService
:
ITextFileService
,
@
ITextFileService
private
textFileService
:
ITextFileService
,
@
IEnvironmentService
private
environmentService
:
IEnvironmentService
,
@
IEnvironmentService
private
environmentService
:
IEnvironmentService
@
IHashService
private
hashService
:
IHashService
)
{
)
{
super
();
super
();
...
@@ -254,7 +252,7 @@ export class UntitledEditorInput extends EditorInput implements IEncodingSupport
...
@@ -254,7 +252,7 @@ export class UntitledEditorInput extends EditorInput implements IEncodingSupport
public
getTelemetryDescriptor
():
object
{
public
getTelemetryDescriptor
():
object
{
const
descriptor
=
super
.
getTelemetryDescriptor
();
const
descriptor
=
super
.
getTelemetryDescriptor
();
descriptor
[
'
resource
'
]
=
telemetryURIDescriptor
(
this
.
getResource
()
,
path
=>
this
.
hashService
.
createSHA1
(
path
)
);
descriptor
[
'
resource
'
]
=
telemetryURIDescriptor
(
this
.
getResource
());
/* __GDPR__FRAGMENT__
/* __GDPR__FRAGMENT__
"EditorTelemetryDescriptor" : {
"EditorTelemetryDescriptor" : {
...
...
src/vs/workbench/electron-browser/shell.ts
浏览文件 @
25a0274d
...
@@ -91,8 +91,6 @@ import { foreground, selectionBackground, focusBorder, scrollbarShadow, scrollba
...
@@ -91,8 +91,6 @@ import { foreground, selectionBackground, focusBorder, scrollbarShadow, scrollba
import
{
TextMateService
}
from
'
vs/workbench/services/textMate/electron-browser/TMSyntax
'
;
import
{
TextMateService
}
from
'
vs/workbench/services/textMate/electron-browser/TMSyntax
'
;
import
{
ITextMateService
}
from
'
vs/workbench/services/textMate/electron-browser/textMateService
'
;
import
{
ITextMateService
}
from
'
vs/workbench/services/textMate/electron-browser/textMateService
'
;
import
{
IBroadcastService
,
BroadcastService
}
from
'
vs/platform/broadcast/electron-browser/broadcastService
'
;
import
{
IBroadcastService
,
BroadcastService
}
from
'
vs/platform/broadcast/electron-browser/broadcastService
'
;
import
{
HashService
}
from
'
vs/workbench/services/hash/node/hashService
'
;
import
{
IHashService
}
from
'
vs/workbench/services/hash/common/hashService
'
;
/**
/**
* Services that we require for the Shell
* Services that we require for the Shell
...
@@ -295,9 +293,6 @@ export class WorkbenchShell {
...
@@ -295,9 +293,6 @@ export class WorkbenchShell {
restoreFontInfo
(
this
.
storageService
);
restoreFontInfo
(
this
.
storageService
);
readFontInfo
(
BareFontInfo
.
createFromRawSettings
(
this
.
configurationService
.
getConfiguration
(
'
editor
'
),
browser
.
getZoomLevel
()));
readFontInfo
(
BareFontInfo
.
createFromRawSettings
(
this
.
configurationService
.
getConfiguration
(
'
editor
'
),
browser
.
getZoomLevel
()));
// Hash
serviceCollection
.
set
(
IHashService
,
new
SyncDescriptor
(
HashService
));
// Experiments
// Experiments
this
.
experimentService
=
instantiationService
.
createInstance
(
ExperimentService
);
this
.
experimentService
=
instantiationService
.
createInstance
(
ExperimentService
);
serviceCollection
.
set
(
IExperimentService
,
this
.
experimentService
);
serviceCollection
.
set
(
IExperimentService
,
this
.
experimentService
);
...
...
src/vs/workbench/parts/files/common/editors/fileEditorInput.ts
浏览文件 @
25a0274d
...
@@ -24,7 +24,6 @@ import { telemetryURIDescriptor } from 'vs/platform/telemetry/common/telemetryUt
...
@@ -24,7 +24,6 @@ import { telemetryURIDescriptor } from 'vs/platform/telemetry/common/telemetryUt
import
{
Verbosity
}
from
'
vs/platform/editor/common/editor
'
;
import
{
Verbosity
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
ITextModelService
}
from
'
vs/editor/common/services/resolverService
'
;
import
{
ITextModelService
}
from
'
vs/editor/common/services/resolverService
'
;
import
{
IHashService
}
from
'
vs/workbench/services/hash/common/hashService
'
;
/**
/**
* A file editor input is the input type for the file editor of file system resources.
* A file editor input is the input type for the file editor of file system resources.
...
@@ -48,8 +47,7 @@ export class FileEditorInput extends EditorInput implements IFileEditorInput {
...
@@ -48,8 +47,7 @@ export class FileEditorInput extends EditorInput implements IFileEditorInput {
@
IWorkspaceContextService
private
contextService
:
IWorkspaceContextService
,
@
IWorkspaceContextService
private
contextService
:
IWorkspaceContextService
,
@
ITextFileService
private
textFileService
:
ITextFileService
,
@
ITextFileService
private
textFileService
:
ITextFileService
,
@
IEnvironmentService
private
environmentService
:
IEnvironmentService
,
@
IEnvironmentService
private
environmentService
:
IEnvironmentService
,
@
ITextModelService
private
textModelResolverService
:
ITextModelService
,
@
ITextModelService
private
textModelResolverService
:
ITextModelService
@
IHashService
private
hashService
:
IHashService
)
{
)
{
super
();
super
();
...
@@ -276,7 +274,7 @@ export class FileEditorInput extends EditorInput implements IFileEditorInput {
...
@@ -276,7 +274,7 @@ export class FileEditorInput extends EditorInput implements IFileEditorInput {
public
getTelemetryDescriptor
():
object
{
public
getTelemetryDescriptor
():
object
{
const
descriptor
=
super
.
getTelemetryDescriptor
();
const
descriptor
=
super
.
getTelemetryDescriptor
();
descriptor
[
'
resource
'
]
=
telemetryURIDescriptor
(
this
.
getResource
()
,
path
=>
this
.
hashService
.
createSHA1
(
path
)
);
descriptor
[
'
resource
'
]
=
telemetryURIDescriptor
(
this
.
getResource
());
/* __GDPR__FRAGMENT__
/* __GDPR__FRAGMENT__
"EditorTelemetryDescriptor" : {
"EditorTelemetryDescriptor" : {
...
...
src/vs/workbench/parts/html/common/htmlInput.ts
浏览文件 @
25a0274d
...
@@ -7,7 +7,6 @@
...
@@ -7,7 +7,6 @@
import
URI
from
'
vs/base/common/uri
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
{
ResourceEditorInput
}
from
'
vs/workbench/common/editor/resourceEditorInput
'
;
import
{
ResourceEditorInput
}
from
'
vs/workbench/common/editor/resourceEditorInput
'
;
import
{
ITextModelService
}
from
'
vs/editor/common/services/resolverService
'
;
import
{
ITextModelService
}
from
'
vs/editor/common/services/resolverService
'
;
import
{
IHashService
}
from
'
vs/workbench/services/hash/common/hashService
'
;
export
interface
HtmlInputOptions
{
export
interface
HtmlInputOptions
{
...
@@ -26,9 +25,8 @@ export class HtmlInput extends ResourceEditorInput {
...
@@ -26,9 +25,8 @@ export class HtmlInput extends ResourceEditorInput {
description
:
string
,
description
:
string
,
resource
:
URI
,
resource
:
URI
,
public
readonly
options
:
HtmlInputOptions
,
public
readonly
options
:
HtmlInputOptions
,
@
ITextModelService
textModelResolverService
:
ITextModelService
,
@
ITextModelService
textModelResolverService
:
ITextModelService
@
IHashService
hashService
:
IHashService
)
{
)
{
super
(
name
,
description
,
resource
,
textModelResolverService
,
hashService
);
super
(
name
,
description
,
resource
,
textModelResolverService
);
}
}
}
}
src/vs/workbench/parts/preferences/browser/preferencesEditor.ts
浏览文件 @
25a0274d
...
@@ -59,7 +59,6 @@ import Event, { Emitter } from 'vs/base/common/event';
...
@@ -59,7 +59,6 @@ import Event, { Emitter } from 'vs/base/common/event';
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
MessageController
}
from
'
vs/editor/contrib/message/messageController
'
;
import
{
MessageController
}
from
'
vs/editor/contrib/message/messageController
'
;
import
{
ConfigurationTarget
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
ConfigurationTarget
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IHashService
}
from
'
vs/workbench/services/hash/common/hashService
'
;
export
class
PreferencesEditorInput
extends
SideBySideEditorInput
{
export
class
PreferencesEditorInput
extends
SideBySideEditorInput
{
public
static
ID
:
string
=
'
workbench.editorinputs.preferencesEditorInput
'
;
public
static
ID
:
string
=
'
workbench.editorinputs.preferencesEditorInput
'
;
...
@@ -76,10 +75,9 @@ export class PreferencesEditorInput extends SideBySideEditorInput {
...
@@ -76,10 +75,9 @@ export class PreferencesEditorInput extends SideBySideEditorInput {
export
class
DefaultPreferencesEditorInput
extends
ResourceEditorInput
{
export
class
DefaultPreferencesEditorInput
extends
ResourceEditorInput
{
public
static
ID
=
'
workbench.editorinputs.defaultpreferences
'
;
public
static
ID
=
'
workbench.editorinputs.defaultpreferences
'
;
constructor
(
defaultSettingsResource
:
URI
,
constructor
(
defaultSettingsResource
:
URI
,
@
ITextModelService
textModelResolverService
:
ITextModelService
,
@
ITextModelService
textModelResolverService
:
ITextModelService
@
IHashService
hashService
:
IHashService
)
{
)
{
super
(
nls
.
localize
(
'
settingsEditorName
'
,
"
Default Settings
"
),
''
,
defaultSettingsResource
,
textModelResolverService
,
hashService
);
super
(
nls
.
localize
(
'
settingsEditorName
'
,
"
Default Settings
"
),
''
,
defaultSettingsResource
,
textModelResolverService
);
}
}
getTypeId
():
string
{
getTypeId
():
string
{
...
...
src/vs/workbench/parts/welcome/walkThrough/node/walkThroughInput.ts
浏览文件 @
25a0274d
...
@@ -15,7 +15,6 @@ import { marked } from 'vs/base/common/marked/marked';
...
@@ -15,7 +15,6 @@ import { marked } from 'vs/base/common/marked/marked';
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
ILifecycleService
,
ShutdownReason
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
ILifecycleService
,
ShutdownReason
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
IHashService
}
from
'
vs/workbench/services/hash/common/hashService
'
;
export
class
WalkThroughModel
extends
EditorModel
{
export
class
WalkThroughModel
extends
EditorModel
{
...
@@ -64,8 +63,7 @@ export class WalkThroughInput extends EditorInput {
...
@@ -64,8 +63,7 @@ export class WalkThroughInput extends EditorInput {
private
options
:
WalkThroughInputOptions
,
private
options
:
WalkThroughInputOptions
,
@
ITelemetryService
private
telemetryService
:
ITelemetryService
,
@
ITelemetryService
private
telemetryService
:
ITelemetryService
,
@
ILifecycleService
lifecycleService
:
ILifecycleService
,
@
ILifecycleService
lifecycleService
:
ILifecycleService
,
@
ITextModelService
private
textModelResolverService
:
ITextModelService
,
@
ITextModelService
private
textModelResolverService
:
ITextModelService
@
IHashService
private
hashService
:
IHashService
)
{
)
{
super
();
super
();
this
.
disposables
.
push
(
lifecycleService
.
onShutdown
(
e
=>
this
.
disposeTelemetry
(
e
)));
this
.
disposables
.
push
(
lifecycleService
.
onShutdown
(
e
=>
this
.
disposeTelemetry
(
e
)));
...
@@ -94,7 +92,7 @@ export class WalkThroughInput extends EditorInput {
...
@@ -94,7 +92,7 @@ export class WalkThroughInput extends EditorInput {
getTelemetryDescriptor
():
object
{
getTelemetryDescriptor
():
object
{
const
descriptor
=
super
.
getTelemetryDescriptor
();
const
descriptor
=
super
.
getTelemetryDescriptor
();
descriptor
[
'
target
'
]
=
this
.
getTelemetryFrom
();
descriptor
[
'
target
'
]
=
this
.
getTelemetryFrom
();
descriptor
[
'
resource
'
]
=
telemetryURIDescriptor
(
this
.
options
.
resource
,
path
=>
this
.
hashService
.
createSHA1
(
path
)
);
descriptor
[
'
resource
'
]
=
telemetryURIDescriptor
(
this
.
options
.
resource
);
/* __GDPR__FRAGMENT__
/* __GDPR__FRAGMENT__
"EditorTelemetryDescriptor" : {
"EditorTelemetryDescriptor" : {
"target" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
"target" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
...
...
src/vs/workbench/services/keybinding/test/node/keybindingEditing.test.ts
浏览文件 @
25a0274d
...
@@ -16,7 +16,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
...
@@ -16,7 +16,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
import
{
KeyCode
,
SimpleKeybinding
,
ChordKeybinding
}
from
'
vs/base/common/keyCodes
'
;
import
{
KeyCode
,
SimpleKeybinding
,
ChordKeybinding
}
from
'
vs/base/common/keyCodes
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
extfs
=
require
(
'
vs/base/node/extfs
'
);
import
extfs
=
require
(
'
vs/base/node/extfs
'
);
import
{
TestTextFileService
,
TestEditorGroupService
,
TestLifecycleService
,
TestBackupFileService
,
TestContextService
,
TestTextResourceConfigurationService
,
TestHashService
}
from
'
vs/workbench/test/workbenchTestServices
'
;
import
{
TestTextFileService
,
TestEditorGroupService
,
TestLifecycleService
,
TestBackupFileService
,
TestContextService
,
TestTextResourceConfigurationService
}
from
'
vs/workbench/test/workbenchTestServices
'
;
import
{
IWorkspaceContextService
,
Workspace
,
toWorkspaceFolders
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IWorkspaceContextService
,
Workspace
,
toWorkspaceFolders
}
from
'
vs/platform/workspace/common/workspace
'
;
import
uuid
=
require
(
'
vs/base/common/uuid
'
);
import
uuid
=
require
(
'
vs/base/common/uuid
'
);
import
{
ConfigurationService
}
from
'
vs/platform/configuration/node/configurationService
'
;
import
{
ConfigurationService
}
from
'
vs/platform/configuration/node/configurationService
'
;
...
@@ -42,7 +42,6 @@ import { KeybindingsEditingService } from 'vs/workbench/services/keybinding/comm
...
@@ -42,7 +42,6 @@ import { KeybindingsEditingService } from 'vs/workbench/services/keybinding/comm
import
{
IUserFriendlyKeybinding
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
IUserFriendlyKeybinding
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
ResolvedKeybindingItem
}
from
'
vs/platform/keybinding/common/resolvedKeybindingItem
'
;
import
{
ResolvedKeybindingItem
}
from
'
vs/platform/keybinding/common/resolvedKeybindingItem
'
;
import
{
TestConfigurationService
}
from
'
vs/platform/configuration/test/common/testConfigurationService
'
;
import
{
TestConfigurationService
}
from
'
vs/platform/configuration/test/common/testConfigurationService
'
;
import
{
IHashService
}
from
'
vs/workbench/services/hash/common/hashService
'
;
interface
Modifiers
{
interface
Modifiers
{
metaKey
?:
boolean
;
metaKey
?:
boolean
;
...
@@ -71,7 +70,6 @@ suite('Keybindings Editing', () => {
...
@@ -71,7 +70,6 @@ suite('Keybindings Editing', () => {
instantiationService
.
stub
(
IConfigurationService
,
'
onDidChangeConfiguration
'
,
()
=>
{
});
instantiationService
.
stub
(
IConfigurationService
,
'
onDidChangeConfiguration
'
,
()
=>
{
});
instantiationService
.
stub
(
IWorkspaceContextService
,
new
TestContextService
());
instantiationService
.
stub
(
IWorkspaceContextService
,
new
TestContextService
());
instantiationService
.
stub
(
ILifecycleService
,
new
TestLifecycleService
());
instantiationService
.
stub
(
ILifecycleService
,
new
TestLifecycleService
());
instantiationService
.
stub
(
IHashService
,
new
TestHashService
());
instantiationService
.
stub
(
IEditorGroupService
,
new
TestEditorGroupService
());
instantiationService
.
stub
(
IEditorGroupService
,
new
TestEditorGroupService
());
instantiationService
.
stub
(
ITelemetryService
,
NullTelemetryService
);
instantiationService
.
stub
(
ITelemetryService
,
NullTelemetryService
);
instantiationService
.
stub
(
IModeService
,
ModeServiceImpl
);
instantiationService
.
stub
(
IModeService
,
ModeServiceImpl
);
...
...
src/vs/workbench/services/textfile/common/textFileEditorModel.ts
浏览文件 @
25a0274d
...
@@ -31,9 +31,9 @@ import { IMessageService, Severity } from 'vs/platform/message/common/message';
...
@@ -31,9 +31,9 @@ import { IMessageService, Severity } from 'vs/platform/message/common/message';
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
anonymize
}
from
'
vs/platform/telemetry/common/telemetryUtils
'
;
import
{
RunOnceScheduler
}
from
'
vs/base/common/async
'
;
import
{
RunOnceScheduler
}
from
'
vs/base/common/async
'
;
import
{
IRawTextSource
}
from
'
vs/editor/common/model/textSource
'
;
import
{
IRawTextSource
}
from
'
vs/editor/common/model/textSource
'
;
import
{
IHashService
}
from
'
vs/workbench/services/hash/common/hashService
'
;
/**
/**
* 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.
* 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.
...
@@ -87,7 +87,6 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
...
@@ -87,7 +87,6 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
@
IBackupFileService
private
backupFileService
:
IBackupFileService
,
@
IBackupFileService
private
backupFileService
:
IBackupFileService
,
@
IEnvironmentService
private
environmentService
:
IEnvironmentService
,
@
IEnvironmentService
private
environmentService
:
IEnvironmentService
,
@
IWorkspaceContextService
private
contextService
:
IWorkspaceContextService
,
@
IWorkspaceContextService
private
contextService
:
IWorkspaceContextService
,
@
IHashService
private
hashService
:
IHashService
)
{
)
{
super
(
modelService
,
modeService
);
super
(
modelService
,
modeService
);
...
@@ -381,7 +380,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
...
@@ -381,7 +380,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
"path": { "classification": "CustomerContent", "purpose": "FeatureInsight" }
"path": { "classification": "CustomerContent", "purpose": "FeatureInsight" }
}
}
*/
*/
this
.
telemetryService
.
publicLog
(
'
fileGet
'
,
{
mimeType
:
guessMimeTypes
(
this
.
resource
.
fsPath
).
join
(
'
,
'
),
ext
:
paths
.
extname
(
this
.
resource
.
fsPath
),
path
:
this
.
hashService
.
createSHA1
(
this
.
resource
.
fsPath
)
});
this
.
telemetryService
.
publicLog
(
'
fileGet
'
,
{
mimeType
:
guessMimeTypes
(
this
.
resource
.
fsPath
).
join
(
'
,
'
),
ext
:
paths
.
extname
(
this
.
resource
.
fsPath
),
path
:
anonymize
(
this
.
resource
.
fsPath
)
});
}
}
return
model
;
return
model
;
...
...
src/vs/workbench/test/workbenchTestServices.ts
浏览文件 @
25a0274d
...
@@ -59,7 +59,6 @@ import { IRecentlyOpened } from 'vs/platform/history/common/history';
...
@@ -59,7 +59,6 @@ import { IRecentlyOpened } from 'vs/platform/history/common/history';
import
{
ITextResourceConfigurationService
}
from
'
vs/editor/common/services/resourceConfiguration
'
;
import
{
ITextResourceConfigurationService
}
from
'
vs/editor/common/services/resourceConfiguration
'
;
import
{
IPosition
}
from
'
vs/editor/common/core/position
'
;
import
{
IPosition
}
from
'
vs/editor/common/core/position
'
;
import
{
ICommandAction
}
from
'
vs/platform/actions/common/actions
'
;
import
{
ICommandAction
}
from
'
vs/platform/actions/common/actions
'
;
import
{
IHashService
}
from
'
vs/workbench/services/hash/common/hashService
'
;
export
function
createFileInput
(
instantiationService
:
IInstantiationService
,
resource
:
URI
):
FileEditorInput
{
export
function
createFileInput
(
instantiationService
:
IInstantiationService
,
resource
:
URI
):
FileEditorInput
{
return
instantiationService
.
createInstance
(
FileEditorInput
,
resource
,
void
0
);
return
instantiationService
.
createInstance
(
FileEditorInput
,
resource
,
void
0
);
...
@@ -268,7 +267,6 @@ export function workbenchInstantiationService(): IInstantiationService {
...
@@ -268,7 +267,6 @@ export function workbenchInstantiationService(): IInstantiationService {
instantiationService
.
stub
(
ITextModelService
,
<
ITextModelService
>
instantiationService
.
createInstance
(
TextModelResolverService
));
instantiationService
.
stub
(
ITextModelService
,
<
ITextModelService
>
instantiationService
.
createInstance
(
TextModelResolverService
));
instantiationService
.
stub
(
IEnvironmentService
,
TestEnvironmentService
);
instantiationService
.
stub
(
IEnvironmentService
,
TestEnvironmentService
);
instantiationService
.
stub
(
IThemeService
,
new
TestThemeService
());
instantiationService
.
stub
(
IThemeService
,
new
TestThemeService
());
instantiationService
.
stub
(
IHashService
,
new
TestHashService
());
instantiationService
.
stub
(
IChoiceService
,
{
instantiationService
.
stub
(
IChoiceService
,
{
choose
:
(
severity
,
message
,
options
,
cancelId
):
TPromise
<
number
>
=>
{
choose
:
(
severity
,
message
,
options
,
cancelId
):
TPromise
<
number
>
=>
{
return
TPromise
.
as
(
cancelId
);
return
TPromise
.
as
(
cancelId
);
...
@@ -1240,14 +1238,6 @@ export class TestTextResourceConfigurationService implements ITextResourceConfig
...
@@ -1240,14 +1238,6 @@ export class TestTextResourceConfigurationService implements ITextResourceConfig
}
}
}
}
export
class
TestHashService
implements
IHashService
{
_serviceBrand
:
any
;
createSHA1
(
content
:
string
):
string
{
return
content
;
}
}
export
function
getRandomTestPath
(
tmpdir
:
string
,
...
segments
:
string
[]):
string
{
export
function
getRandomTestPath
(
tmpdir
:
string
,
...
segments
:
string
[]):
string
{
return
paths
.
join
(
tmpdir
,
...
segments
,
generateUuid
());
return
paths
.
join
(
tmpdir
,
...
segments
,
generateUuid
());
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录