Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
000f8392
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,发现更多精彩内容 >>
提交
000f8392
编写于
3月 27, 2020
作者:
D
Daniel Imms
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Only persist collections marked to do so
上级
f6545699
变更
10
显示空白变更内容
内联
并排
Showing
10 changed file
with
200 addition
and
124 deletion
+200
-124
src/vs/workbench/api/browser/mainThreadTerminalService.ts
src/vs/workbench/api/browser/mainThreadTerminalService.ts
+6
-3
src/vs/workbench/api/common/extHost.protocol.ts
src/vs/workbench/api/common/extHost.protocol.ts
+1
-1
src/vs/workbench/api/common/extHostTerminalService.ts
src/vs/workbench/api/common/extHostTerminalService.ts
+5
-2
src/vs/workbench/api/node/extHostTerminalService.ts
src/vs/workbench/api/node/extHostTerminalService.ts
+9
-4
src/vs/workbench/contrib/terminal/common/environmentVariable.ts
.../workbench/contrib/terminal/common/environmentVariable.ts
+7
-1
src/vs/workbench/contrib/terminal/common/environmentVariableCollection.ts
.../contrib/terminal/common/environmentVariableCollection.ts
+1
-1
src/vs/workbench/contrib/terminal/common/environmentVariableService.ts
...nch/contrib/terminal/common/environmentVariableService.ts
+15
-10
src/vs/workbench/contrib/terminal/common/environmentVariableShared.ts
...ench/contrib/terminal/common/environmentVariableShared.ts
+3
-3
src/vs/workbench/contrib/terminal/test/common/environmentVariableCollection.test.ts
...erminal/test/common/environmentVariableCollection.test.ts
+146
-92
src/vs/workbench/contrib/terminal/test/common/environmentVariableService.test.ts
...b/terminal/test/common/environmentVariableService.test.ts
+7
-7
未找到文件。
src/vs/workbench/api/browser/mainThreadTerminalService.ts
浏览文件 @
000f8392
...
@@ -77,7 +77,7 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
...
@@ -77,7 +77,7 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
if
(
this
.
_environmentVariableService
.
collections
.
size
>
0
)
{
if
(
this
.
_environmentVariableService
.
collections
.
size
>
0
)
{
const
collectionAsArray
=
[...
this
.
_environmentVariableService
.
collections
.
entries
()];
const
collectionAsArray
=
[...
this
.
_environmentVariableService
.
collections
.
entries
()];
const
serializedCollections
:
[
string
,
ISerializableEnvironmentVariableCollection
][]
=
collectionAsArray
.
map
(
e
=>
{
const
serializedCollections
:
[
string
,
ISerializableEnvironmentVariableCollection
][]
=
collectionAsArray
.
map
(
e
=>
{
return
[
e
[
0
],
serializeEnvironmentVariableCollection
(
e
[
1
])];
return
[
e
[
0
],
serializeEnvironmentVariableCollection
(
e
[
1
]
.
map
)];
});
});
this
.
_proxy
.
$initEnvironmentVariableCollections
(
serializedCollections
);
this
.
_proxy
.
$initEnvironmentVariableCollections
(
serializedCollections
);
}
}
...
@@ -357,9 +357,12 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
...
@@ -357,9 +357,12 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
return
terminal
;
return
terminal
;
}
}
$setEnvironmentVariableCollection
(
extensionIdentifier
:
string
,
collection
:
ISerializableEnvironmentVariableCollection
|
undefined
):
void
{
$setEnvironmentVariableCollection
(
extensionIdentifier
:
string
,
persistent
:
boolean
,
collection
:
ISerializableEnvironmentVariableCollection
|
undefined
):
void
{
if
(
collection
)
{
if
(
collection
)
{
const
translatedCollection
=
deserializeEnvironmentVariableCollection
(
collection
);
const
translatedCollection
=
{
persistent
,
map
:
deserializeEnvironmentVariableCollection
(
collection
)
};
this
.
_environmentVariableService
.
set
(
extensionIdentifier
,
translatedCollection
);
this
.
_environmentVariableService
.
set
(
extensionIdentifier
,
translatedCollection
);
}
else
{
}
else
{
this
.
_environmentVariableService
.
delete
(
extensionIdentifier
);
this
.
_environmentVariableService
.
delete
(
extensionIdentifier
);
...
...
src/vs/workbench/api/common/extHost.protocol.ts
浏览文件 @
000f8392
...
@@ -437,7 +437,7 @@ export interface MainThreadTerminalServiceShape extends IDisposable {
...
@@ -437,7 +437,7 @@ export interface MainThreadTerminalServiceShape extends IDisposable {
$stopSendingDataEvents
():
void
;
$stopSendingDataEvents
():
void
;
$startHandlingLinks
():
void
;
$startHandlingLinks
():
void
;
$stopHandlingLinks
():
void
;
$stopHandlingLinks
():
void
;
$setEnvironmentVariableCollection
(
extensionIdentifier
:
string
,
collection
:
ISerializableEnvironmentVariableCollection
|
undefined
):
void
;
$setEnvironmentVariableCollection
(
extensionIdentifier
:
string
,
persistent
:
boolean
,
collection
:
ISerializableEnvironmentVariableCollection
|
undefined
):
void
;
// Process
// Process
$sendProcessTitle
(
terminalId
:
number
,
title
:
string
):
void
;
$sendProcessTitle
(
terminalId
:
number
,
title
:
string
):
void
;
...
...
src/vs/workbench/api/common/extHostTerminalService.ts
浏览文件 @
000f8392
...
@@ -643,12 +643,15 @@ export abstract class BaseExtHostTerminalService implements IExtHostTerminalServ
...
@@ -643,12 +643,15 @@ export abstract class BaseExtHostTerminalService implements IExtHostTerminalServ
}
}
export
class
EnvironmentVariableCollection
implements
vscode
.
EnvironmentVariableCollection
{
export
class
EnvironmentVariableCollection
implements
vscode
.
EnvironmentVariableCollection
{
public
readonly
map
:
Map
<
string
,
vscode
.
EnvironmentVariableMutator
>
=
new
Map
();
readonly
map
:
Map
<
string
,
vscode
.
EnvironmentVariableMutator
>
=
new
Map
();
protected
readonly
_onDidChangeCollection
:
Emitter
<
void
>
=
new
Emitter
<
void
>
();
protected
readonly
_onDidChangeCollection
:
Emitter
<
void
>
=
new
Emitter
<
void
>
();
get
onDidChangeCollection
():
Event
<
void
>
{
return
this
.
_onDidChangeCollection
&&
this
.
_onDidChangeCollection
.
event
;
}
get
onDidChangeCollection
():
Event
<
void
>
{
return
this
.
_onDidChangeCollection
&&
this
.
_onDidChangeCollection
.
event
;
}
constructor
(
serialized
?:
ISerializableEnvironmentVariableCollection
)
{
constructor
(
readonly
persistent
:
boolean
,
serialized
?:
ISerializableEnvironmentVariableCollection
)
{
this
.
map
=
new
Map
(
serialized
);
this
.
map
=
new
Map
(
serialized
);
}
}
...
...
src/vs/workbench/api/node/extHostTerminalService.ts
浏览文件 @
000f8392
...
@@ -233,17 +233,22 @@ export class ExtHostTerminalService extends BaseExtHostTerminalService {
...
@@ -233,17 +233,22 @@ export class ExtHostTerminalService extends BaseExtHostTerminalService {
this
.
_isWorkspaceShellAllowed
=
isAllowed
;
this
.
_isWorkspaceShellAllowed
=
isAllowed
;
}
}
public
getEnvironmentVariableCollection
(
extension
:
IExtensionDescription
,
persistent
?:
boolean
):
vscode
.
EnvironmentVariableCollection
{
public
getEnvironmentVariableCollection
(
extension
:
IExtensionDescription
,
persistent
:
boolean
=
false
):
vscode
.
EnvironmentVariableCollection
{
let
collection
:
EnvironmentVariableCollection
|
undefined
;
let
collection
:
EnvironmentVariableCollection
|
undefined
;
if
(
persistent
)
{
if
(
persistent
)
{
// If persistent is specified, return the current collection if it exists
// If persistent is specified, return the current collection if it exists
collection
=
this
.
_environmentVariableCollections
.
get
(
extension
.
identifier
.
value
);
collection
=
this
.
_environmentVariableCollections
.
get
(
extension
.
identifier
.
value
);
// If persistence changed then create a new collection
if
(
collection
&&
!
collection
.
persistent
)
{
collection
=
undefined
;
}
}
}
if
(
!
collection
)
{
if
(
!
collection
)
{
// If not persistent, clear out the current collection and create a new one
// If not persistent, clear out the current collection and create a new one
dispose
(
this
.
_environmentVariableCollections
.
get
(
extension
.
identifier
.
value
));
dispose
(
this
.
_environmentVariableCollections
.
get
(
extension
.
identifier
.
value
));
collection
=
new
EnvironmentVariableCollection
();
collection
=
new
EnvironmentVariableCollection
(
persistent
);
this
.
_setEnvironmentVariableCollection
(
extension
.
identifier
.
value
,
collection
);
this
.
_setEnvironmentVariableCollection
(
extension
.
identifier
.
value
,
collection
);
}
}
...
@@ -252,13 +257,13 @@ export class ExtHostTerminalService extends BaseExtHostTerminalService {
...
@@ -252,13 +257,13 @@ export class ExtHostTerminalService extends BaseExtHostTerminalService {
private
_syncEnvironmentVariableCollection
(
extensionIdentifier
:
string
,
collection
:
EnvironmentVariableCollection
):
void
{
private
_syncEnvironmentVariableCollection
(
extensionIdentifier
:
string
,
collection
:
EnvironmentVariableCollection
):
void
{
const
serialized
=
serializeEnvironmentVariableCollection
(
collection
.
map
);
const
serialized
=
serializeEnvironmentVariableCollection
(
collection
.
map
);
this
.
_proxy
.
$setEnvironmentVariableCollection
(
extensionIdentifier
,
serialized
.
length
===
0
?
undefined
:
serialized
);
this
.
_proxy
.
$setEnvironmentVariableCollection
(
extensionIdentifier
,
collection
.
persistent
,
serialized
.
length
===
0
?
undefined
:
serialized
);
}
}
public
$initEnvironmentVariableCollections
(
collections
:
[
string
,
ISerializableEnvironmentVariableCollection
][]):
void
{
public
$initEnvironmentVariableCollections
(
collections
:
[
string
,
ISerializableEnvironmentVariableCollection
][]):
void
{
collections
.
forEach
(
entry
=>
{
collections
.
forEach
(
entry
=>
{
const
extensionIdentifier
=
entry
[
0
];
const
extensionIdentifier
=
entry
[
0
];
const
collection
=
new
EnvironmentVariableCollection
(
entry
[
1
]);
const
collection
=
new
EnvironmentVariableCollection
(
true
,
entry
[
1
]);
this
.
_setEnvironmentVariableCollection
(
extensionIdentifier
,
collection
);
this
.
_setEnvironmentVariableCollection
(
extensionIdentifier
,
collection
);
});
});
}
}
...
...
src/vs/workbench/contrib/terminal/common/environmentVariable.ts
浏览文件 @
000f8392
...
@@ -24,7 +24,13 @@ export interface IExtensionOwnedEnvironmentVariableMutator extends IEnvironmentV
...
@@ -24,7 +24,13 @@ export interface IExtensionOwnedEnvironmentVariableMutator extends IEnvironmentV
readonly
extensionIdentifier
:
string
;
readonly
extensionIdentifier
:
string
;
}
}
export
type
IEnvironmentVariableCollection
=
ReadonlyMap
<
string
,
IEnvironmentVariableMutator
>
;
export
interface
IEnvironmentVariableCollection
{
readonly
map
:
ReadonlyMap
<
string
,
IEnvironmentVariableMutator
>
;
}
export
interface
IEnvironmentVariableCollectionWithPersistence
extends
IEnvironmentVariableCollection
{
readonly
persistent
:
boolean
;
}
export
interface
IMergedEnvironmentVariableCollectionDiff
{
export
interface
IMergedEnvironmentVariableCollectionDiff
{
added
:
ReadonlyMap
<
string
,
IExtensionOwnedEnvironmentVariableMutator
[]
>
;
added
:
ReadonlyMap
<
string
,
IExtensionOwnedEnvironmentVariableMutator
[]
>
;
...
...
src/vs/workbench/contrib/terminal/common/environmentVariableCollection.ts
浏览文件 @
000f8392
...
@@ -11,7 +11,7 @@ export class MergedEnvironmentVariableCollection implements IMergedEnvironmentVa
...
@@ -11,7 +11,7 @@ export class MergedEnvironmentVariableCollection implements IMergedEnvironmentVa
constructor
(
collections
:
Map
<
string
,
IEnvironmentVariableCollection
>
)
{
constructor
(
collections
:
Map
<
string
,
IEnvironmentVariableCollection
>
)
{
collections
.
forEach
((
collection
,
extensionIdentifier
)
=>
{
collections
.
forEach
((
collection
,
extensionIdentifier
)
=>
{
const
it
=
collection
.
entries
();
const
it
=
collection
.
map
.
entries
();
let
next
=
it
.
next
();
let
next
=
it
.
next
();
while
(
!
next
.
done
)
{
while
(
!
next
.
done
)
{
const
variable
=
next
.
value
[
0
];
const
variable
=
next
.
value
[
0
];
...
...
src/vs/workbench/contrib/terminal/common/environmentVariableService.ts
浏览文件 @
000f8392
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
*--------------------------------------------------------------------------------------------*/
import
{
IEnvironmentVariableService
,
I
EnvironmentVariableCollection
,
IMergedEnvironmentVariableCollection
,
ISerializableEnvironmentVariableCollection
}
from
'
vs/workbench/contrib/terminal/common/environmentVariable
'
;
import
{
IEnvironmentVariableService
,
I
MergedEnvironmentVariableCollection
,
ISerializableEnvironmentVariableCollection
,
IEnvironmentVariableCollectionWithPersistence
}
from
'
vs/workbench/contrib/terminal/common/environmentVariable
'
;
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
import
{
debounce
,
throttle
}
from
'
vs/base/common/decorators
'
;
import
{
debounce
,
throttle
}
from
'
vs/base/common/decorators
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
...
@@ -24,7 +24,7 @@ interface ISerializableExtensionEnvironmentVariableCollection {
...
@@ -24,7 +24,7 @@ interface ISerializableExtensionEnvironmentVariableCollection {
export
class
EnvironmentVariableService
implements
IEnvironmentVariableService
{
export
class
EnvironmentVariableService
implements
IEnvironmentVariableService
{
_serviceBrand
:
undefined
;
_serviceBrand
:
undefined
;
collections
:
Map
<
string
,
IEnvironmentVariableCollection
>
=
new
Map
();
collections
:
Map
<
string
,
IEnvironmentVariableCollection
WithPersistence
>
=
new
Map
();
mergedCollection
:
IMergedEnvironmentVariableCollection
;
mergedCollection
:
IMergedEnvironmentVariableCollection
;
private
readonly
_onDidChangeCollections
=
new
Emitter
<
IMergedEnvironmentVariableCollection
>
();
private
readonly
_onDidChangeCollections
=
new
Emitter
<
IMergedEnvironmentVariableCollection
>
();
...
@@ -37,7 +37,10 @@ export class EnvironmentVariableService implements IEnvironmentVariableService {
...
@@ -37,7 +37,10 @@ export class EnvironmentVariableService implements IEnvironmentVariableService {
const
serializedPersistedCollections
=
this
.
_storageService
.
get
(
ENVIRONMENT_VARIABLE_COLLECTIONS_KEY
,
StorageScope
.
WORKSPACE
);
const
serializedPersistedCollections
=
this
.
_storageService
.
get
(
ENVIRONMENT_VARIABLE_COLLECTIONS_KEY
,
StorageScope
.
WORKSPACE
);
if
(
serializedPersistedCollections
)
{
if
(
serializedPersistedCollections
)
{
const
collectionsJson
:
ISerializableExtensionEnvironmentVariableCollection
[]
=
JSON
.
parse
(
serializedPersistedCollections
);
const
collectionsJson
:
ISerializableExtensionEnvironmentVariableCollection
[]
=
JSON
.
parse
(
serializedPersistedCollections
);
collectionsJson
.
forEach
(
c
=>
this
.
collections
.
set
(
c
.
extensionIdentifier
,
deserializeEnvironmentVariableCollection
(
c
.
collection
)));
collectionsJson
.
forEach
(
c
=>
this
.
collections
.
set
(
c
.
extensionIdentifier
,
{
persistent
:
true
,
map
:
deserializeEnvironmentVariableCollection
(
c
.
collection
)
}));
// Asynchronously invalidate collections where extensions have been uninstalled, this is
// Asynchronously invalidate collections where extensions have been uninstalled, this is
// async to avoid making all functions on the service synchronous and because extensions
// async to avoid making all functions on the service synchronous and because extensions
...
@@ -50,7 +53,7 @@ export class EnvironmentVariableService implements IEnvironmentVariableService {
...
@@ -50,7 +53,7 @@ export class EnvironmentVariableService implements IEnvironmentVariableService {
this
.
_extensionService
.
onDidChangeExtensions
(()
=>
this
.
_invalidateExtensionCollections
());
this
.
_extensionService
.
onDidChangeExtensions
(()
=>
this
.
_invalidateExtensionCollections
());
}
}
set
(
extensionIdentifier
:
string
,
collection
:
IEnvironmentVariableCollection
):
void
{
set
(
extensionIdentifier
:
string
,
collection
:
IEnvironmentVariableCollection
WithPersistence
):
void
{
this
.
collections
.
set
(
extensionIdentifier
,
collection
);
this
.
collections
.
set
(
extensionIdentifier
,
collection
);
this
.
_updateCollections
();
this
.
_updateCollections
();
}
}
...
@@ -72,12 +75,14 @@ export class EnvironmentVariableService implements IEnvironmentVariableService {
...
@@ -72,12 +75,14 @@ export class EnvironmentVariableService implements IEnvironmentVariableService {
}
}
protected
_persistCollections
():
void
{
protected
_persistCollections
():
void
{
const
keys
=
[...
this
.
collections
.
keys
()];
const
collectionsJson
:
ISerializableExtensionEnvironmentVariableCollection
[]
=
[];
const
collectionsJson
:
ISerializableExtensionEnvironmentVariableCollection
[]
=
keys
.
map
(
extensionIdentifier
=>
{
this
.
collections
.
forEach
((
collection
,
extensionIdentifier
)
=>
{
return
{
if
(
collection
.
persistent
)
{
collectionsJson
.
push
({
extensionIdentifier
,
extensionIdentifier
,
collection
:
serializeEnvironmentVariableCollection
(
this
.
collections
.
get
(
extensionIdentifier
)
!
)
collection
:
serializeEnvironmentVariableCollection
(
this
.
collections
.
get
(
extensionIdentifier
)
!
.
map
)
};
});
}
});
});
const
stringifiedJson
=
JSON
.
stringify
(
collectionsJson
);
const
stringifiedJson
=
JSON
.
stringify
(
collectionsJson
);
this
.
_storageService
.
store
(
ENVIRONMENT_VARIABLE_COLLECTIONS_KEY
,
stringifiedJson
,
StorageScope
.
WORKSPACE
);
this
.
_storageService
.
store
(
ENVIRONMENT_VARIABLE_COLLECTIONS_KEY
,
stringifiedJson
,
StorageScope
.
WORKSPACE
);
...
...
src/vs/workbench/contrib/terminal/common/environmentVariableShared.ts
浏览文件 @
000f8392
...
@@ -3,16 +3,16 @@
...
@@ -3,16 +3,16 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
*--------------------------------------------------------------------------------------------*/
import
{
IEnvironmentVariable
Collection
,
IEnvironmentVariable
Mutator
,
ISerializableEnvironmentVariableCollection
}
from
'
vs/workbench/contrib/terminal/common/environmentVariable
'
;
import
{
IEnvironmentVariableMutator
,
ISerializableEnvironmentVariableCollection
}
from
'
vs/workbench/contrib/terminal/common/environmentVariable
'
;
// This file is shared between the renderer and extension host
// This file is shared between the renderer and extension host
export
function
serializeEnvironmentVariableCollection
(
collection
:
IEnvironmentVariableCollection
):
ISerializableEnvironmentVariableCollection
{
export
function
serializeEnvironmentVariableCollection
(
collection
:
ReadonlyMap
<
string
,
IEnvironmentVariableMutator
>
):
ISerializableEnvironmentVariableCollection
{
return
[...
collection
.
entries
()];
return
[...
collection
.
entries
()];
}
}
export
function
deserializeEnvironmentVariableCollection
(
export
function
deserializeEnvironmentVariableCollection
(
serializedCollection
:
ISerializableEnvironmentVariableCollection
serializedCollection
:
ISerializableEnvironmentVariableCollection
):
IEnvironmentVariableCollection
{
):
Map
<
string
,
IEnvironmentVariableMutator
>
{
return
new
Map
<
string
,
IEnvironmentVariableMutator
>
(
serializedCollection
);
return
new
Map
<
string
,
IEnvironmentVariableMutator
>
(
serializedCollection
);
}
}
src/vs/workbench/contrib/terminal/test/common/environmentVariableCollection.test.ts
浏览文件 @
000f8392
...
@@ -9,22 +9,30 @@ import { IProcessEnvironment } from 'vs/base/common/platform';
...
@@ -9,22 +9,30 @@ import { IProcessEnvironment } from 'vs/base/common/platform';
import
{
MergedEnvironmentVariableCollection
}
from
'
vs/workbench/contrib/terminal/common/environmentVariableCollection
'
;
import
{
MergedEnvironmentVariableCollection
}
from
'
vs/workbench/contrib/terminal/common/environmentVariableCollection
'
;
import
{
deserializeEnvironmentVariableCollection
}
from
'
vs/workbench/contrib/terminal/common/environmentVariableShared
'
;
import
{
deserializeEnvironmentVariableCollection
}
from
'
vs/workbench/contrib/terminal/common/environmentVariableShared
'
;
suite
.
only
(
'
EnvironmentVariable - MergedEnvironmentVariableCollection
'
,
()
=>
{
suite
(
'
EnvironmentVariable - MergedEnvironmentVariableCollection
'
,
()
=>
{
suite
(
'
ctor
'
,
()
=>
{
suite
(
'
ctor
'
,
()
=>
{
test
(
'
Should keep entries that come after a Prepend or Append type mutators
'
,
()
=>
{
test
(
'
Should keep entries that come after a Prepend or Append type mutators
'
,
()
=>
{
const
merged
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
const
merged
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
[
'
ext1
'
,
deserializeEnvironmentVariableCollection
([
[
'
ext1
'
,
{
map
:
deserializeEnvironmentVariableCollection
([
[
'
A
'
,
{
value
:
'
a1
'
,
type
:
EnvironmentVariableMutatorType
.
Prepend
}]
[
'
A
'
,
{
value
:
'
a1
'
,
type
:
EnvironmentVariableMutatorType
.
Prepend
}]
])],
])
[
'
ext2
'
,
deserializeEnvironmentVariableCollection
([
}],
[
'
ext2
'
,
{
map
:
deserializeEnvironmentVariableCollection
([
[
'
A
'
,
{
value
:
'
a2
'
,
type
:
EnvironmentVariableMutatorType
.
Append
}]
[
'
A
'
,
{
value
:
'
a2
'
,
type
:
EnvironmentVariableMutatorType
.
Append
}]
])],
])
[
'
ext3
'
,
deserializeEnvironmentVariableCollection
([
}],
[
'
ext3
'
,
{
map
:
deserializeEnvironmentVariableCollection
([
[
'
A
'
,
{
value
:
'
a3
'
,
type
:
EnvironmentVariableMutatorType
.
Prepend
}]
[
'
A
'
,
{
value
:
'
a3
'
,
type
:
EnvironmentVariableMutatorType
.
Prepend
}]
])],
])
[
'
ext4
'
,
deserializeEnvironmentVariableCollection
([
}],
[
'
ext4
'
,
{
map
:
deserializeEnvironmentVariableCollection
([
[
'
A
'
,
{
value
:
'
a4
'
,
type
:
EnvironmentVariableMutatorType
.
Append
}]
[
'
A
'
,
{
value
:
'
a4
'
,
type
:
EnvironmentVariableMutatorType
.
Append
}]
])]
])
}]
]));
]));
deepStrictEqual
([...
merged
.
map
.
entries
()],
[
deepStrictEqual
([...
merged
.
map
.
entries
()],
[
[
'
A
'
,
[
[
'
A
'
,
[
...
@@ -38,18 +46,26 @@ suite.only('EnvironmentVariable - MergedEnvironmentVariableCollection', () => {
...
@@ -38,18 +46,26 @@ suite.only('EnvironmentVariable - MergedEnvironmentVariableCollection', () => {
test
(
'
Should remove entries that come after a Replace type mutator
'
,
()
=>
{
test
(
'
Should remove entries that come after a Replace type mutator
'
,
()
=>
{
const
merged
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
const
merged
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
[
'
ext1
'
,
deserializeEnvironmentVariableCollection
([
[
'
ext1
'
,
{
map
:
deserializeEnvironmentVariableCollection
([
[
'
A
'
,
{
value
:
'
a1
'
,
type
:
EnvironmentVariableMutatorType
.
Prepend
}]
[
'
A
'
,
{
value
:
'
a1
'
,
type
:
EnvironmentVariableMutatorType
.
Prepend
}]
])],
])
[
'
ext2
'
,
deserializeEnvironmentVariableCollection
([
}],
[
'
ext2
'
,
{
map
:
deserializeEnvironmentVariableCollection
([
[
'
A
'
,
{
value
:
'
a2
'
,
type
:
EnvironmentVariableMutatorType
.
Append
}]
[
'
A
'
,
{
value
:
'
a2
'
,
type
:
EnvironmentVariableMutatorType
.
Append
}]
])],
])
[
'
ext3
'
,
deserializeEnvironmentVariableCollection
([
}],
[
'
ext3
'
,
{
map
:
deserializeEnvironmentVariableCollection
([
[
'
A
'
,
{
value
:
'
a3
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
}]
[
'
A
'
,
{
value
:
'
a3
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
}]
])],
])
[
'
ext4
'
,
deserializeEnvironmentVariableCollection
([
}],
[
'
ext4
'
,
{
map
:
deserializeEnvironmentVariableCollection
([
[
'
A
'
,
{
value
:
'
a4
'
,
type
:
EnvironmentVariableMutatorType
.
Append
}]
[
'
A
'
,
{
value
:
'
a4
'
,
type
:
EnvironmentVariableMutatorType
.
Append
}]
])]
])
}]
]));
]));
deepStrictEqual
([...
merged
.
map
.
entries
()],
[
deepStrictEqual
([...
merged
.
map
.
entries
()],
[
[
'
A
'
,
[
[
'
A
'
,
[
...
@@ -64,11 +80,13 @@ suite.only('EnvironmentVariable - MergedEnvironmentVariableCollection', () => {
...
@@ -64,11 +80,13 @@ suite.only('EnvironmentVariable - MergedEnvironmentVariableCollection', () => {
suite
(
'
applyToProcessEnvironment
'
,
()
=>
{
suite
(
'
applyToProcessEnvironment
'
,
()
=>
{
test
(
'
should apply the collection to an environment
'
,
()
=>
{
test
(
'
should apply the collection to an environment
'
,
()
=>
{
const
merged
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
const
merged
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
[
'
ext
'
,
deserializeEnvironmentVariableCollection
([
[
'
ext
'
,
{
map
:
deserializeEnvironmentVariableCollection
([
[
'
A
'
,
{
value
:
'
a
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
}],
[
'
A
'
,
{
value
:
'
a
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
}],
[
'
B
'
,
{
value
:
'
b
'
,
type
:
EnvironmentVariableMutatorType
.
Append
}],
[
'
B
'
,
{
value
:
'
b
'
,
type
:
EnvironmentVariableMutatorType
.
Append
}],
[
'
C
'
,
{
value
:
'
c
'
,
type
:
EnvironmentVariableMutatorType
.
Prepend
}]
[
'
C
'
,
{
value
:
'
c
'
,
type
:
EnvironmentVariableMutatorType
.
Prepend
}]
])]
])
}]
]));
]));
const
env
:
IProcessEnvironment
=
{
const
env
:
IProcessEnvironment
=
{
A
:
'
foo
'
,
A
:
'
foo
'
,
...
@@ -85,11 +103,13 @@ suite.only('EnvironmentVariable - MergedEnvironmentVariableCollection', () => {
...
@@ -85,11 +103,13 @@ suite.only('EnvironmentVariable - MergedEnvironmentVariableCollection', () => {
test
(
'
should apply the collection to environment entries with no values
'
,
()
=>
{
test
(
'
should apply the collection to environment entries with no values
'
,
()
=>
{
const
merged
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
const
merged
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
[
'
ext
'
,
deserializeEnvironmentVariableCollection
([
[
'
ext
'
,
{
map
:
deserializeEnvironmentVariableCollection
([
[
'
A
'
,
{
value
:
'
a
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
}],
[
'
A
'
,
{
value
:
'
a
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
}],
[
'
B
'
,
{
value
:
'
b
'
,
type
:
EnvironmentVariableMutatorType
.
Append
}],
[
'
B
'
,
{
value
:
'
b
'
,
type
:
EnvironmentVariableMutatorType
.
Append
}],
[
'
C
'
,
{
value
:
'
c
'
,
type
:
EnvironmentVariableMutatorType
.
Prepend
}]
[
'
C
'
,
{
value
:
'
c
'
,
type
:
EnvironmentVariableMutatorType
.
Prepend
}]
])]
])
}]
]));
]));
const
env
:
IProcessEnvironment
=
{};
const
env
:
IProcessEnvironment
=
{};
merged
.
applyToProcessEnvironment
(
env
);
merged
.
applyToProcessEnvironment
(
env
);
...
@@ -105,9 +125,11 @@ suite.only('EnvironmentVariable - MergedEnvironmentVariableCollection', () => {
...
@@ -105,9 +125,11 @@ suite.only('EnvironmentVariable - MergedEnvironmentVariableCollection', () => {
test
(
'
should generate added diffs from when the first entry is added
'
,
()
=>
{
test
(
'
should generate added diffs from when the first entry is added
'
,
()
=>
{
const
merged1
=
new
MergedEnvironmentVariableCollection
(
new
Map
([]));
const
merged1
=
new
MergedEnvironmentVariableCollection
(
new
Map
([]));
const
merged2
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
const
merged2
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
[
'
ext1
'
,
deserializeEnvironmentVariableCollection
([
[
'
ext1
'
,
{
map
:
deserializeEnvironmentVariableCollection
([
[
'
A
'
,
{
value
:
'
a
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
}]
[
'
A
'
,
{
value
:
'
a
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
}]
])]
])
}]
]));
]));
const
diff
=
merged1
.
diff
(
merged2
);
const
diff
=
merged1
.
diff
(
merged2
);
strictEqual
(
diff
.
changed
.
size
,
0
);
strictEqual
(
diff
.
changed
.
size
,
0
);
...
@@ -120,15 +142,19 @@ suite.only('EnvironmentVariable - MergedEnvironmentVariableCollection', () => {
...
@@ -120,15 +142,19 @@ suite.only('EnvironmentVariable - MergedEnvironmentVariableCollection', () => {
test
(
'
should generate added diffs from the same extension
'
,
()
=>
{
test
(
'
should generate added diffs from the same extension
'
,
()
=>
{
const
merged1
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
const
merged1
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
[
'
ext1
'
,
deserializeEnvironmentVariableCollection
([
[
'
ext1
'
,
{
map
:
deserializeEnvironmentVariableCollection
([
[
'
A
'
,
{
value
:
'
a
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
}]
[
'
A
'
,
{
value
:
'
a
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
}]
])]
])
}]
]));
]));
const
merged2
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
const
merged2
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
[
'
ext1
'
,
deserializeEnvironmentVariableCollection
([
[
'
ext1
'
,
{
map
:
deserializeEnvironmentVariableCollection
([
[
'
A
'
,
{
value
:
'
a
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
}],
[
'
A
'
,
{
value
:
'
a
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
}],
[
'
B
'
,
{
value
:
'
b
'
,
type
:
EnvironmentVariableMutatorType
.
Append
}]
[
'
B
'
,
{
value
:
'
b
'
,
type
:
EnvironmentVariableMutatorType
.
Append
}]
])]
])
}]
]));
]));
const
diff
=
merged1
.
diff
(
merged2
);
const
diff
=
merged1
.
diff
(
merged2
);
strictEqual
(
diff
.
changed
.
size
,
0
);
strictEqual
(
diff
.
changed
.
size
,
0
);
...
@@ -141,18 +167,24 @@ suite.only('EnvironmentVariable - MergedEnvironmentVariableCollection', () => {
...
@@ -141,18 +167,24 @@ suite.only('EnvironmentVariable - MergedEnvironmentVariableCollection', () => {
test
(
'
should generate added diffs from a different extension
'
,
()
=>
{
test
(
'
should generate added diffs from a different extension
'
,
()
=>
{
const
merged1
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
const
merged1
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
[
'
ext1
'
,
deserializeEnvironmentVariableCollection
([
[
'
ext1
'
,
{
map
:
deserializeEnvironmentVariableCollection
([
[
'
A
'
,
{
value
:
'
a1
'
,
type
:
EnvironmentVariableMutatorType
.
Prepend
}]
[
'
A
'
,
{
value
:
'
a1
'
,
type
:
EnvironmentVariableMutatorType
.
Prepend
}]
])]
])
}]
]));
]));
const
merged2
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
const
merged2
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
[
'
ext2
'
,
deserializeEnvironmentVariableCollection
([
[
'
ext2
'
,
{
map
:
deserializeEnvironmentVariableCollection
([
[
'
A
'
,
{
value
:
'
a2
'
,
type
:
EnvironmentVariableMutatorType
.
Append
}]
[
'
A
'
,
{
value
:
'
a2
'
,
type
:
EnvironmentVariableMutatorType
.
Append
}]
])],
])
[
'
ext1
'
,
deserializeEnvironmentVariableCollection
([
}],
[
'
ext1
'
,
{
map
:
deserializeEnvironmentVariableCollection
([
[
'
A
'
,
{
value
:
'
a1
'
,
type
:
EnvironmentVariableMutatorType
.
Prepend
}]
[
'
A
'
,
{
value
:
'
a1
'
,
type
:
EnvironmentVariableMutatorType
.
Prepend
}]
])]
])
}]
]));
]));
const
diff
=
merged1
.
diff
(
merged2
);
const
diff
=
merged1
.
diff
(
merged2
);
strictEqual
(
diff
.
changed
.
size
,
0
);
strictEqual
(
diff
.
changed
.
size
,
0
);
...
@@ -162,13 +194,17 @@ suite.only('EnvironmentVariable - MergedEnvironmentVariableCollection', () => {
...
@@ -162,13 +194,17 @@ suite.only('EnvironmentVariable - MergedEnvironmentVariableCollection', () => {
]);
]);
const
merged3
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
const
merged3
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
[
'
ext1
'
,
deserializeEnvironmentVariableCollection
([
[
'
ext1
'
,
{
map
:
deserializeEnvironmentVariableCollection
([
[
'
A
'
,
{
value
:
'
a1
'
,
type
:
EnvironmentVariableMutatorType
.
Prepend
}]
[
'
A
'
,
{
value
:
'
a1
'
,
type
:
EnvironmentVariableMutatorType
.
Prepend
}]
])],
])
}],
// This entry should get removed
// This entry should get removed
[
'
ext2
'
,
deserializeEnvironmentVariableCollection
([
[
'
ext2
'
,
{
map
:
deserializeEnvironmentVariableCollection
([
[
'
A
'
,
{
value
:
'
a2
'
,
type
:
EnvironmentVariableMutatorType
.
Append
}]
[
'
A
'
,
{
value
:
'
a2
'
,
type
:
EnvironmentVariableMutatorType
.
Append
}]
])]
])
}]
]));
]));
const
diff2
=
merged1
.
diff
(
merged3
);
const
diff2
=
merged1
.
diff
(
merged3
);
strictEqual
(
diff2
.
changed
.
size
,
0
);
strictEqual
(
diff2
.
changed
.
size
,
0
);
...
@@ -178,18 +214,24 @@ suite.only('EnvironmentVariable - MergedEnvironmentVariableCollection', () => {
...
@@ -178,18 +214,24 @@ suite.only('EnvironmentVariable - MergedEnvironmentVariableCollection', () => {
test
(
'
should remove entries in the diff that come after a Replce
'
,
()
=>
{
test
(
'
should remove entries in the diff that come after a Replce
'
,
()
=>
{
const
merged1
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
const
merged1
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
[
'
ext1
'
,
deserializeEnvironmentVariableCollection
([
[
'
ext1
'
,
{
map
:
deserializeEnvironmentVariableCollection
([
[
'
A
'
,
{
value
:
'
a1
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
}]
[
'
A
'
,
{
value
:
'
a1
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
}]
])]
])
}]
]));
]));
const
merged4
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
const
merged4
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
[
'
ext1
'
,
deserializeEnvironmentVariableCollection
([
[
'
ext1
'
,
{
map
:
deserializeEnvironmentVariableCollection
([
[
'
A
'
,
{
value
:
'
a1
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
}]
[
'
A
'
,
{
value
:
'
a1
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
}]
])],
])
}],
// This entry should get removed as it comes after a replace
// This entry should get removed as it comes after a replace
[
'
ext2
'
,
deserializeEnvironmentVariableCollection
([
[
'
ext2
'
,
{
map
:
deserializeEnvironmentVariableCollection
([
[
'
A
'
,
{
value
:
'
a2
'
,
type
:
EnvironmentVariableMutatorType
.
Append
}]
[
'
A
'
,
{
value
:
'
a2
'
,
type
:
EnvironmentVariableMutatorType
.
Append
}]
])]
])
}]
]));
]));
const
diff
=
merged1
.
diff
(
merged4
);
const
diff
=
merged1
.
diff
(
merged4
);
strictEqual
(
diff
.
changed
.
size
,
0
);
strictEqual
(
diff
.
changed
.
size
,
0
);
...
@@ -199,15 +241,19 @@ suite.only('EnvironmentVariable - MergedEnvironmentVariableCollection', () => {
...
@@ -199,15 +241,19 @@ suite.only('EnvironmentVariable - MergedEnvironmentVariableCollection', () => {
test
(
'
should generate removed diffs
'
,
()
=>
{
test
(
'
should generate removed diffs
'
,
()
=>
{
const
merged1
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
const
merged1
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
[
'
ext1
'
,
deserializeEnvironmentVariableCollection
([
[
'
ext1
'
,
{
map
:
deserializeEnvironmentVariableCollection
([
[
'
A
'
,
{
value
:
'
a
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
}],
[
'
A
'
,
{
value
:
'
a
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
}],
[
'
B
'
,
{
value
:
'
b
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
}]
[
'
B
'
,
{
value
:
'
b
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
}]
])]
])
}]
]));
]));
const
merged2
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
const
merged2
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
[
'
ext1
'
,
deserializeEnvironmentVariableCollection
([
[
'
ext1
'
,
{
map
:
deserializeEnvironmentVariableCollection
([
[
'
A
'
,
{
value
:
'
a
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
}]
[
'
A
'
,
{
value
:
'
a
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
}]
])]
])
}]
]));
]));
const
diff
=
merged1
.
diff
(
merged2
);
const
diff
=
merged1
.
diff
(
merged2
);
strictEqual
(
diff
.
changed
.
size
,
0
);
strictEqual
(
diff
.
changed
.
size
,
0
);
...
@@ -219,16 +265,20 @@ suite.only('EnvironmentVariable - MergedEnvironmentVariableCollection', () => {
...
@@ -219,16 +265,20 @@ suite.only('EnvironmentVariable - MergedEnvironmentVariableCollection', () => {
test
(
'
should generate changed diffs
'
,
()
=>
{
test
(
'
should generate changed diffs
'
,
()
=>
{
const
merged1
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
const
merged1
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
[
'
ext1
'
,
deserializeEnvironmentVariableCollection
([
[
'
ext1
'
,
{
map
:
deserializeEnvironmentVariableCollection
([
[
'
A
'
,
{
value
:
'
a1
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
}],
[
'
A
'
,
{
value
:
'
a1
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
}],
[
'
B
'
,
{
value
:
'
b
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
}]
[
'
B
'
,
{
value
:
'
b
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
}]
])]
])
}]
]));
]));
const
merged2
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
const
merged2
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
[
'
ext1
'
,
deserializeEnvironmentVariableCollection
([
[
'
ext1
'
,
{
map
:
deserializeEnvironmentVariableCollection
([
[
'
A
'
,
{
value
:
'
a2
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
}],
[
'
A
'
,
{
value
:
'
a2
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
}],
[
'
B
'
,
{
value
:
'
b
'
,
type
:
EnvironmentVariableMutatorType
.
Append
}]
[
'
B
'
,
{
value
:
'
b
'
,
type
:
EnvironmentVariableMutatorType
.
Append
}]
])]
])
}]
]));
]));
const
diff
=
merged1
.
diff
(
merged2
);
const
diff
=
merged1
.
diff
(
merged2
);
strictEqual
(
diff
.
added
.
size
,
0
);
strictEqual
(
diff
.
added
.
size
,
0
);
...
@@ -241,16 +291,20 @@ suite.only('EnvironmentVariable - MergedEnvironmentVariableCollection', () => {
...
@@ -241,16 +291,20 @@ suite.only('EnvironmentVariable - MergedEnvironmentVariableCollection', () => {
test
(
'
should generate diffs with added, changed and removed
'
,
()
=>
{
test
(
'
should generate diffs with added, changed and removed
'
,
()
=>
{
const
merged1
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
const
merged1
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
[
'
ext1
'
,
deserializeEnvironmentVariableCollection
([
[
'
ext1
'
,
{
map
:
deserializeEnvironmentVariableCollection
([
[
'
A
'
,
{
value
:
'
a1
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
}],
[
'
A
'
,
{
value
:
'
a1
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
}],
[
'
B
'
,
{
value
:
'
b
'
,
type
:
EnvironmentVariableMutatorType
.
Prepend
}]
[
'
B
'
,
{
value
:
'
b
'
,
type
:
EnvironmentVariableMutatorType
.
Prepend
}]
])]
])
}]
]));
]));
const
merged2
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
const
merged2
=
new
MergedEnvironmentVariableCollection
(
new
Map
([
[
'
ext1
'
,
deserializeEnvironmentVariableCollection
([
[
'
ext1
'
,
{
map
:
deserializeEnvironmentVariableCollection
([
[
'
A
'
,
{
value
:
'
a2
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
}],
[
'
A
'
,
{
value
:
'
a2
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
}],
[
'
C
'
,
{
value
:
'
c
'
,
type
:
EnvironmentVariableMutatorType
.
Append
}]
[
'
C
'
,
{
value
:
'
c
'
,
type
:
EnvironmentVariableMutatorType
.
Append
}]
])]
])
}]
]));
]));
const
diff
=
merged1
.
diff
(
merged2
);
const
diff
=
merged1
.
diff
(
merged2
);
deepStrictEqual
([...
diff
.
added
.
entries
()],
[
deepStrictEqual
([...
diff
.
added
.
entries
()],
[
...
...
src/vs/workbench/contrib/terminal/test/common/environmentVariableService.test.ts
浏览文件 @
000f8392
...
@@ -47,7 +47,7 @@ suite('EnvironmentVariable - EnvironmentVariableService', () => {
...
@@ -47,7 +47,7 @@ suite('EnvironmentVariable - EnvironmentVariableService', () => {
collection
.
set
(
'
A
'
,
{
value
:
'
a
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
});
collection
.
set
(
'
A
'
,
{
value
:
'
a
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
});
collection
.
set
(
'
B
'
,
{
value
:
'
b
'
,
type
:
EnvironmentVariableMutatorType
.
Append
});
collection
.
set
(
'
B
'
,
{
value
:
'
b
'
,
type
:
EnvironmentVariableMutatorType
.
Append
});
collection
.
set
(
'
C
'
,
{
value
:
'
c
'
,
type
:
EnvironmentVariableMutatorType
.
Prepend
});
collection
.
set
(
'
C
'
,
{
value
:
'
c
'
,
type
:
EnvironmentVariableMutatorType
.
Prepend
});
environmentVariableService
.
set
(
'
ext1
'
,
collection
);
environmentVariableService
.
set
(
'
ext1
'
,
{
map
:
collection
,
persistent
:
true
}
);
deepStrictEqual
([...
environmentVariableService
.
mergedCollection
.
map
.
entries
()],
[
deepStrictEqual
([...
environmentVariableService
.
mergedCollection
.
map
.
entries
()],
[
[
'
A
'
,
[{
extensionIdentifier
:
'
ext1
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
,
value
:
'
a
'
}]],
[
'
A
'
,
[{
extensionIdentifier
:
'
ext1
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
,
value
:
'
a
'
}]],
[
'
B
'
,
[{
extensionIdentifier
:
'
ext1
'
,
type
:
EnvironmentVariableMutatorType
.
Append
,
value
:
'
b
'
}]],
[
'
B
'
,
[{
extensionIdentifier
:
'
ext1
'
,
type
:
EnvironmentVariableMutatorType
.
Append
,
value
:
'
b
'
}]],
...
@@ -75,9 +75,9 @@ suite('EnvironmentVariable - EnvironmentVariableService', () => {
...
@@ -75,9 +75,9 @@ suite('EnvironmentVariable - EnvironmentVariableService', () => {
collection2
.
set
(
'
B
'
,
{
value
:
'
b2
'
,
type
:
EnvironmentVariableMutatorType
.
Append
});
collection2
.
set
(
'
B
'
,
{
value
:
'
b2
'
,
type
:
EnvironmentVariableMutatorType
.
Append
});
collection3
.
set
(
'
A
'
,
{
value
:
'
a3
'
,
type
:
EnvironmentVariableMutatorType
.
Prepend
});
collection3
.
set
(
'
A
'
,
{
value
:
'
a3
'
,
type
:
EnvironmentVariableMutatorType
.
Prepend
});
collection3
.
set
(
'
B
'
,
{
value
:
'
b3
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
});
collection3
.
set
(
'
B
'
,
{
value
:
'
b3
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
});
environmentVariableService
.
set
(
'
ext1
'
,
collection1
);
environmentVariableService
.
set
(
'
ext1
'
,
{
map
:
collection1
,
persistent
:
true
}
);
environmentVariableService
.
set
(
'
ext2
'
,
collection2
);
environmentVariableService
.
set
(
'
ext2
'
,
{
map
:
collection2
,
persistent
:
true
}
);
environmentVariableService
.
set
(
'
ext3
'
,
collection3
);
environmentVariableService
.
set
(
'
ext3
'
,
{
map
:
collection3
,
persistent
:
true
}
);
deepStrictEqual
([...
environmentVariableService
.
mergedCollection
.
map
.
entries
()],
[
deepStrictEqual
([...
environmentVariableService
.
mergedCollection
.
map
.
entries
()],
[
[
'
A
'
,
[
[
'
A
'
,
[
{
extensionIdentifier
:
'
ext2
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
,
value
:
'
a2
'
},
{
extensionIdentifier
:
'
ext2
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
,
value
:
'
a2
'
},
...
@@ -94,9 +94,9 @@ suite('EnvironmentVariable - EnvironmentVariableService', () => {
...
@@ -94,9 +94,9 @@ suite('EnvironmentVariable - EnvironmentVariableService', () => {
collection1
.
set
(
'
A
'
,
{
value
:
'
:a1
'
,
type
:
EnvironmentVariableMutatorType
.
Append
});
collection1
.
set
(
'
A
'
,
{
value
:
'
:a1
'
,
type
:
EnvironmentVariableMutatorType
.
Append
});
collection2
.
set
(
'
A
'
,
{
value
:
'
a2:
'
,
type
:
EnvironmentVariableMutatorType
.
Prepend
});
collection2
.
set
(
'
A
'
,
{
value
:
'
a2:
'
,
type
:
EnvironmentVariableMutatorType
.
Prepend
});
collection3
.
set
(
'
A
'
,
{
value
:
'
a3
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
});
collection3
.
set
(
'
A
'
,
{
value
:
'
a3
'
,
type
:
EnvironmentVariableMutatorType
.
Replace
});
environmentVariableService
.
set
(
'
ext1
'
,
collection1
);
environmentVariableService
.
set
(
'
ext1
'
,
{
map
:
collection1
,
persistent
:
true
}
);
environmentVariableService
.
set
(
'
ext2
'
,
collection2
);
environmentVariableService
.
set
(
'
ext2
'
,
{
map
:
collection2
,
persistent
:
true
}
);
environmentVariableService
.
set
(
'
ext3
'
,
collection3
);
environmentVariableService
.
set
(
'
ext3
'
,
{
map
:
collection3
,
persistent
:
true
}
);
// The entries should be ordered in the order they are applied
// The entries should be ordered in the order they are applied
deepStrictEqual
([...
environmentVariableService
.
mergedCollection
.
map
.
entries
()],
[
deepStrictEqual
([...
environmentVariableService
.
mergedCollection
.
map
.
entries
()],
[
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录