Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
073735c5
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,发现更多精彩内容 >>
未验证
提交
073735c5
编写于
11月 04, 2019
作者:
J
Johannes Rieken
提交者:
GitHub
11月 04, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into joh/willRename
上级
ca988713
c6be0b54
变更
62
展开全部
显示空白变更内容
内联
并排
Showing
62 changed file
with
2676 addition
and
3581 deletion
+2676
-3581
build/azure-pipelines/publish-types/check-version.ts
build/azure-pipelines/publish-types/check-version.ts
+2
-2
extensions/json-language-features/server/yarn.lock
extensions/json-language-features/server/yarn.lock
+9
-9
extensions/markdown-language-features/media/index.js
extensions/markdown-language-features/media/index.js
+2
-2
extensions/markdown-language-features/media/pre.js
extensions/markdown-language-features/media/pre.js
+2
-2
extensions/markdown-language-features/package.json
extensions/markdown-language-features/package.json
+4
-4
extensions/markdown-language-features/preview-src/scroll-sync.ts
...ons/markdown-language-features/preview-src/scroll-sync.ts
+13
-3
extensions/markdown-language-features/yarn.lock
extensions/markdown-language-features/yarn.lock
+846
-2502
extensions/npm/src/tasks.ts
extensions/npm/src/tasks.ts
+1
-1
extensions/typescript-language-features/package.json
extensions/typescript-language-features/package.json
+4
-0
src/bootstrap-fork.js
src/bootstrap-fork.js
+1
-20
src/vs/base/browser/ui/menu/menubar.ts
src/vs/base/browser/ui/menu/menubar.ts
+1
-1
src/vs/base/common/buffer.ts
src/vs/base/common/buffer.ts
+14
-316
src/vs/base/common/errors.ts
src/vs/base/common/errors.ts
+0
-1
src/vs/base/common/stream.ts
src/vs/base/common/stream.ts
+487
-0
src/vs/base/test/common/stream.test.ts
src/vs/base/test/common/stream.test.ts
+176
-0
src/vs/base/test/node/buffer.test.ts
src/vs/base/test/node/buffer.test.ts
+11
-11
src/vs/editor/common/config/editorOptions.ts
src/vs/editor/common/config/editorOptions.ts
+5
-5
src/vs/editor/contrib/referenceSearch/referencesModel.ts
src/vs/editor/contrib/referenceSearch/referencesModel.ts
+33
-59
src/vs/editor/contrib/referenceSearch/referencesTree.ts
src/vs/editor/contrib/referenceSearch/referencesTree.ts
+1
-1
src/vs/editor/contrib/referenceSearch/referencesWidget.ts
src/vs/editor/contrib/referenceSearch/referencesWidget.ts
+7
-7
src/vs/editor/contrib/suggest/suggestController.ts
src/vs/editor/contrib/suggest/suggestController.ts
+13
-14
src/vs/platform/files/common/fileService.ts
src/vs/platform/files/common/fileService.ts
+89
-123
src/vs/platform/files/common/files.ts
src/vs/platform/files/common/files.ts
+57
-24
src/vs/platform/files/common/io.ts
src/vs/platform/files/common/io.ts
+114
-0
src/vs/platform/files/node/diskFileSystemProvider.ts
src/vs/platform/files/node/diskFileSystemProvider.ts
+34
-9
src/vs/platform/files/test/node/diskFileService.test.ts
src/vs/platform/files/test/node/diskFileService.test.ts
+318
-193
src/vs/platform/quickinput/common/quickInput.ts
src/vs/platform/quickinput/common/quickInput.ts
+2
-2
src/vs/platform/remote/common/remoteAgentFileSystemChannel.ts
...vs/platform/remote/common/remoteAgentFileSystemChannel.ts
+49
-3
src/vs/platform/request/node/requestService.ts
src/vs/platform/request/node/requestService.ts
+5
-5
src/vs/workbench/api/browser/mainThreadFileSystem.ts
src/vs/workbench/api/browser/mainThreadFileSystem.ts
+2
-2
src/vs/workbench/browser/parts/editor/breadcrumbsModel.ts
src/vs/workbench/browser/parts/editor/breadcrumbsModel.ts
+8
-3
src/vs/workbench/browser/parts/editor/breadcrumbsPicker.ts
src/vs/workbench/browser/parts/editor/breadcrumbsPicker.ts
+3
-7
src/vs/workbench/browser/parts/editor/editorGroupView.ts
src/vs/workbench/browser/parts/editor/editorGroupView.ts
+2
-2
src/vs/workbench/browser/parts/quickinput/quickInput.ts
src/vs/workbench/browser/parts/quickinput/quickInput.ts
+129
-119
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
+5
-5
src/vs/workbench/browser/web.main.ts
src/vs/workbench/browser/web.main.ts
+2
-2
src/vs/workbench/contrib/debug/browser/breakpointsView.ts
src/vs/workbench/contrib/debug/browser/breakpointsView.ts
+12
-5
src/vs/workbench/contrib/debug/browser/media/debug.contribution.css
...kbench/contrib/debug/browser/media/debug.contribution.css
+2
-1
src/vs/workbench/contrib/extensions/browser/extensionEditor.ts
...s/workbench/contrib/extensions/browser/extensionEditor.ts
+2
-0
src/vs/workbench/contrib/files/common/explorerModel.ts
src/vs/workbench/contrib/files/common/explorerModel.ts
+1
-0
src/vs/workbench/contrib/files/electron-browser/textFileEditor.ts
...orkbench/contrib/files/electron-browser/textFileEditor.ts
+2
-3
src/vs/workbench/contrib/outline/browser/outlinePanel.ts
src/vs/workbench/contrib/outline/browser/outlinePanel.ts
+1
-1
src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts
.../workbench/contrib/preferences/browser/settingsEditor2.ts
+3
-6
src/vs/workbench/contrib/remote/browser/remote.ts
src/vs/workbench/contrib/remote/browser/remote.ts
+28
-12
src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts
...vs/workbench/contrib/tasks/browser/abstractTaskService.ts
+33
-33
src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts
src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts
+39
-13
src/vs/workbench/contrib/tasks/common/jsonSchemaCommon.ts
src/vs/workbench/contrib/tasks/common/jsonSchemaCommon.ts
+2
-2
src/vs/workbench/contrib/tasks/common/jsonSchema_v2.ts
src/vs/workbench/contrib/tasks/common/jsonSchema_v2.ts
+1
-1
src/vs/workbench/contrib/update/browser/releaseNotesEditor.ts
...vs/workbench/contrib/update/browser/releaseNotesEditor.ts
+2
-1
src/vs/workbench/contrib/url/common/trustedDomainsFileSystemProvider.ts
...ch/contrib/url/common/trustedDomainsFileSystemProvider.ts
+2
-12
src/vs/workbench/contrib/webview/browser/baseWebviewElement.ts
...s/workbench/contrib/webview/browser/baseWebviewElement.ts
+2
-2
src/vs/workbench/contrib/webview/browser/pre/fake.html
src/vs/workbench/contrib/webview/browser/pre/fake.html
+11
-0
src/vs/workbench/contrib/welcome/walkThrough/browser/walkThroughPart.ts
...ch/contrib/welcome/walkThrough/browser/walkThroughPart.ts
+4
-4
src/vs/workbench/electron-browser/desktop.main.ts
src/vs/workbench/electron-browser/desktop.main.ts
+2
-2
src/vs/workbench/services/configuration/browser/configurationService.ts
...ch/services/configuration/browser/configurationService.ts
+1
-1
src/vs/workbench/services/extensions/browser/webWorkerFileSystemProvider.ts
...ervices/extensions/browser/webWorkerFileSystemProvider.ts
+2
-3
src/vs/workbench/services/progress/browser/editorProgressService.ts
...kbench/services/progress/browser/editorProgressService.ts
+0
-11
src/vs/workbench/services/progress/browser/progressIndicator.ts
.../workbench/services/progress/browser/progressIndicator.ts
+55
-3
src/vs/workbench/services/telemetry/browser/telemetryService.ts
.../workbench/services/telemetry/browser/telemetryService.ts
+1
-1
src/vs/workbench/services/textfile/common/textFileEditorModel.ts
...workbench/services/textfile/common/textFileEditorModel.ts
+1
-1
src/vs/workbench/services/userData/common/fileUserDataProvider.ts
...orkbench/services/userData/common/fileUserDataProvider.ts
+14
-2
src/vs/workbench/services/userData/common/inMemoryUserDataProvider.ts
...ench/services/userData/common/inMemoryUserDataProvider.ts
+2
-2
未找到文件。
build/azure-pipelines/publish-types/check-version.ts
浏览文件 @
073735c5
...
...
@@ -35,7 +35,7 @@ function isValidTag(t: string) {
return
false
;
}
if
(
parseInt
(
major
,
10
)
===
NaN
||
parseInt
(
minor
,
10
)
===
NaN
)
{
if
(
isNaN
(
parseInt
(
major
,
10
))
||
isNaN
(
parseInt
(
minor
,
10
))
)
{
return
false
;
}
...
...
extensions/json-language-features/server/yarn.lock
浏览文件 @
073735c5
...
...
@@ -80,10 +80,10 @@ request-light@^0.2.5:
https-proxy-agent "^2.2.3"
vscode-nls "^4.1.1"
vscode-json-languageservice@^3.4.
1
:
version "3.4.
1
"
resolved "https://registry.yarnpkg.com/vscode-json-languageservice/-/vscode-json-languageservice-3.4.
1.tgz#e051f3bb2de5d23995763deac108622a5e93604a
"
integrity sha512-
IWJreQ9HtBSyveqaC3UUEArUqCnt5zYLgHewSJ0CvxlIJfvY7yD8GDbLuLxGeHMWwSudYlODit1IfwNzvjZjEg
==
vscode-json-languageservice@^3.4.
3
:
version "3.4.
3
"
resolved "https://registry.yarnpkg.com/vscode-json-languageservice/-/vscode-json-languageservice-3.4.
3.tgz#e0792619ec3f8730194c93ef74474d4429606cd6
"
integrity sha512-
SRIy75K4/6H1vmMYVsxYwynFUNMOEzIhTy+Pm6D24JHTquwMe7rx/35X75u2sw65e46ZP67izyrJ6ahaAi8UjQ
==
dependencies:
jsonc-parser "^2.2.0"
vscode-languageserver-types "^3.15.0-next.5"
...
...
@@ -126,12 +126,12 @@ vscode-textbuffer@^1.0.0:
resolved "https://registry.yarnpkg.com/vscode-textbuffer/-/vscode-textbuffer-1.0.0.tgz#1faee638c8e0e4131c8d5c353993a1874acda086"
integrity sha512-zPaHo4urgpwsm+PrJWfNakolRpryNja18SUip/qIIsfhuEqEIPEXMxHOlFPjvDC4JgTaimkncNW7UMXRJTY6ow==
vscode-uri@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-2.0.3.tgz#25e5f37f552fbee3cec7e5f80cef8469cefc6543"
integrity sha512-4D3DI3F4uRy09WNtDGD93H9q034OHImxiIcSq664Hq1Y1AScehlP3qqZyTkX/RWxeu0MRMHGkrxYqm2qlDF/aw==
vscode-uri@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-2.1.0.tgz#475a4269e63edbc13914b40c84bc1416e3398156"
integrity sha512-3voe44nOhb6OdKlpZShVsmVvY2vFQHMe6REP3Ky9RVJuPyM/XidsjH6HncCIDdSmbcF5YQHrTC/Q+Q2loJGkOw==
vscode-uri@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-2.1.1.tgz#5aa1803391b6ebdd17d047f51365cf62c38f6e90"
integrity sha512-eY9jmGoEnVf8VE8xr5znSah7Qt1P/xsCdErz+g8HYZtJ7bZqKH5E3d+6oVNm1AC/c6IHUDokbmVXKOi4qPAC9A==
extensions/markdown-language-features/media/index.js
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
extensions/markdown-language-features/media/pre.js
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
extensions/markdown-language-features/package.json
浏览文件 @
073735c5
...
...
@@ -331,10 +331,10 @@
"lodash.throttle"
:
"^4.1.1"
,
"mocha-junit-reporter"
:
"^1.17.0"
,
"mocha-multi-reporters"
:
"^1.1.7"
,
"ts-loader"
:
"^
4.0
.1"
,
"typescript"
:
"^3.
3.1
"
,
"ts-loader"
:
"^
6.2
.1"
,
"typescript"
:
"^3.
6.4
"
,
"vscode"
:
"^1.1.10"
,
"webpack"
:
"^4.
1.0
"
,
"webpack-cli"
:
"^
2.0.1
0"
"webpack"
:
"^4.
41.2
"
,
"webpack-cli"
:
"^
3.3.
0"
}
}
extensions/markdown-language-features/preview-src/scroll-sync.ts
浏览文件 @
073735c5
...
...
@@ -27,7 +27,15 @@ const getCodeLineElements = (() => {
elements
=
[{
element
:
document
.
body
,
line
:
0
}];
for
(
const
element
of
document
.
getElementsByClassName
(
'
code-line
'
))
{
const
line
=
+
element
.
getAttribute
(
'
data-line
'
)
!
;
if
(
!
isNaN
(
line
))
{
if
(
isNaN
(
line
))
{
continue
;
}
if
(
element
.
tagName
===
'
CODE
'
&&
element
.
parentElement
&&
element
.
parentElement
.
tagName
===
'
PRE
'
)
{
// Fenched code blocks are a special case since the `code-line` can only be marked on
// the `<code>` element and not the parent `<pre>` element.
elements
.
push
({
element
:
element
.
parentElement
as
HTMLElement
,
line
});
}
else
{
elements
.
push
({
element
:
element
as
HTMLElement
,
line
});
}
}
...
...
@@ -81,6 +89,9 @@ export function getLineElementsAtPageOffset(offset: number): { previous: CodeLin
const
loElement
=
lines
[
lo
];
return
{
previous
:
loElement
,
next
:
hiElement
};
}
if
(
hi
>
1
&&
hi
<
lines
.
length
&&
hiBounds
.
top
+
hiBounds
.
height
>
position
)
{
return
{
previous
:
hiElement
,
next
:
lines
[
hi
+
1
]
};
}
return
{
previous
:
hiElement
};
}
...
...
@@ -125,8 +136,7 @@ export function getEditorLineNumberForPageOffset(offset: number) {
const
progressBetweenElements
=
offsetFromPrevious
/
(
next
.
element
.
getBoundingClientRect
().
top
-
previousBounds
.
top
);
const
line
=
previous
.
line
+
progressBetweenElements
*
(
next
.
line
-
previous
.
line
);
return
clampLine
(
line
);
}
else
{
}
else
{
const
progressWithinElement
=
offsetFromPrevious
/
(
previousBounds
.
height
);
const
line
=
previous
.
line
+
progressWithinElement
;
return
clampLine
(
line
);
...
...
extensions/markdown-language-features/yarn.lock
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
extensions/npm/src/tasks.ts
浏览文件 @
073735c5
...
...
@@ -253,7 +253,7 @@ async function provideNpmScriptsForFolder(packageJsonUri: Uri): Promise<Task[]>
result
.
push
(
task
);
});
// always add npm install (without a problem matcher)
result
.
push
(
createTask
(
'
install
'
,
'
install
'
,
folder
,
packageJsonUri
,
undefined
,
[]));
result
.
push
(
createTask
(
'
install
'
,
'
install
'
,
folder
,
packageJsonUri
,
'
install dependencies from package
'
,
[]));
return
result
;
}
...
...
extensions/typescript-language-features/package.json
浏览文件 @
073735c5
...
...
@@ -94,6 +94,10 @@
"fileMatch"
:
".babelrc.json"
,
"url"
:
"https://schemastore.azurewebsites.net/schemas/json/babelrc.json"
},
{
"fileMatch"
:
"babel.config.json"
,
"url"
:
"https://schemastore.azurewebsites.net/schemas/json/babelrc.json"
},
{
"fileMatch"
:
"jsconfig.json"
,
"url"
:
"https://schemastore.azurewebsites.net/schemas/json/jsconfig.json"
...
...
src/bootstrap-fork.js
浏览文件 @
073735c5
...
...
@@ -20,11 +20,6 @@ if (!!process.send && process.env.PIPE_LOGGING === 'true') {
pipeLoggingToParent
();
}
// Disable IO if configured
if
(
!
process
.
env
[
'
VSCODE_ALLOW_IO
'
])
{
disableSTDIO
();
}
// Handle Exceptions
if
(
!
process
.
env
[
'
VSCODE_HANDLES_UNCAUGHT_ERRORS
'
])
{
handleExceptions
();
...
...
@@ -141,20 +136,6 @@ function pipeLoggingToParent() {
console
.
error
=
function
()
{
safeSend
({
type
:
'
__$console
'
,
severity
:
'
error
'
,
arguments
:
safeToArray
(
arguments
)
});
};
}
function
disableSTDIO
()
{
// const stdout, stderr and stdin be no-op streams. This prevents an issue where we would get an EBADF
// error when we are inside a forked process and this process tries to access those channels.
const
stream
=
require
(
'
stream
'
);
const
writable
=
new
stream
.
Writable
({
write
:
function
()
{
/* No OP */
}
});
process
[
'
__defineGetter__
'
](
'
stdout
'
,
function
()
{
return
writable
;
});
process
[
'
__defineGetter__
'
](
'
stderr
'
,
function
()
{
return
writable
;
});
process
[
'
__defineGetter__
'
](
'
stdin
'
,
function
()
{
return
writable
;
});
}
function
handleExceptions
()
{
// Handle uncaught exceptions
...
...
src/vs/base/browser/ui/menu/menubar.ts
浏览文件 @
073735c5
...
...
@@ -309,7 +309,7 @@ export class MenuBar extends Disposable {
createOverflowMenu
():
void
{
const
label
=
this
.
options
.
compactMode
!==
undefined
?
nls
.
localize
(
'
mAppMenu
'
,
'
Application Menu
'
)
:
nls
.
localize
(
'
mMore
'
,
"
...
"
);
const
buttonElement
=
$
(
'
div.menubar-menu-button
'
,
{
'
role
'
:
'
menuitem
'
,
'
tabindex
'
:
-
1
,
'
aria-label
'
:
label
,
'
aria-haspopup
'
:
true
});
const
buttonElement
=
$
(
'
div.menubar-menu-button
'
,
{
'
role
'
:
'
menuitem
'
,
'
tabindex
'
:
-
1
,
'
aria-label
'
:
label
,
'
title
'
:
label
,
'
aria-haspopup
'
:
true
});
const
titleElement
=
$
(
'
div.menubar-menu-title.toolbar-toggle-more
'
,
{
'
role
'
:
'
none
'
,
'
aria-hidden
'
:
true
});
buttonElement
.
appendChild
(
titleElement
);
...
...
src/vs/base/common/buffer.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/base/common/errors.ts
浏览文件 @
073735c5
...
...
@@ -195,7 +195,6 @@ export function getErrorMessage(err: any): string {
return
String
(
err
);
}
export
class
NotImplementedError
extends
Error
{
constructor
(
message
?:
string
)
{
super
(
'
NotImplemented
'
);
...
...
src/vs/base/common/stream.ts
0 → 100644
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/base/test/common/stream.test.ts
0 → 100644
浏览文件 @
073735c5
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
*
as
assert
from
'
assert
'
;
import
{
isReadableStream
,
newWriteableStream
,
Readable
,
consumeReadable
,
consumeReadableWithLimit
,
consumeStream
,
ReadableStream
,
toStream
,
toReadable
,
transform
,
consumeStreamWithLimit
}
from
'
vs/base/common/stream
'
;
suite
(
'
Stream
'
,
()
=>
{
test
(
'
isReadableStream
'
,
()
=>
{
assert
.
ok
(
!
isReadableStream
(
Object
.
create
(
null
)));
assert
.
ok
(
isReadableStream
(
newWriteableStream
(
d
=>
d
)));
});
test
(
'
WriteableStream
'
,
()
=>
{
const
stream
=
newWriteableStream
<
string
>
(
strings
=>
strings
.
join
());
let
error
=
false
;
stream
.
on
(
'
error
'
,
e
=>
{
error
=
true
;
});
let
end
=
false
;
stream
.
on
(
'
end
'
,
()
=>
{
end
=
true
;
});
stream
.
write
(
'
Hello
'
);
const
chunks
:
string
[]
=
[];
stream
.
on
(
'
data
'
,
data
=>
{
chunks
.
push
(
data
);
});
assert
.
equal
(
chunks
[
0
],
'
Hello
'
);
stream
.
write
(
'
World
'
);
assert
.
equal
(
chunks
[
1
],
'
World
'
);
assert
.
equal
(
error
,
false
);
assert
.
equal
(
end
,
false
);
stream
.
pause
();
stream
.
write
(
'
1
'
);
stream
.
write
(
'
2
'
);
stream
.
write
(
'
3
'
);
assert
.
equal
(
chunks
.
length
,
2
);
stream
.
resume
();
assert
.
equal
(
chunks
.
length
,
3
);
assert
.
equal
(
chunks
[
2
],
'
1,2,3
'
);
stream
.
error
(
new
Error
());
assert
.
equal
(
error
,
true
);
stream
.
end
(
'
Final Bit
'
);
assert
.
equal
(
chunks
.
length
,
4
);
assert
.
equal
(
chunks
[
3
],
'
Final Bit
'
);
stream
.
destroy
();
stream
.
write
(
'
Unexpected
'
);
assert
.
equal
(
chunks
.
length
,
4
);
});
test
(
'
consumeReadable
'
,
()
=>
{
const
readable
=
arrayToReadable
([
'
1
'
,
'
2
'
,
'
3
'
,
'
4
'
,
'
5
'
]);
const
consumed
=
consumeReadable
(
readable
,
strings
=>
strings
.
join
());
assert
.
equal
(
consumed
,
'
1,2,3,4,5
'
);
});
test
(
'
consumeReadableWithLimit
'
,
()
=>
{
for
(
let
i
=
0
;
i
<
5
;
i
++
)
{
const
readable
=
arrayToReadable
([
'
1
'
,
'
2
'
,
'
3
'
,
'
4
'
,
'
5
'
]);
const
consumedOrReadable
=
consumeReadableWithLimit
(
readable
,
strings
=>
strings
.
join
(),
i
);
if
(
typeof
consumedOrReadable
===
'
string
'
)
{
assert
.
fail
(
'
Unexpected result
'
);
}
else
{
const
consumed
=
consumeReadable
(
consumedOrReadable
,
strings
=>
strings
.
join
());
assert
.
equal
(
consumed
,
'
1,2,3,4,5
'
);
}
}
let
readable
=
arrayToReadable
([
'
1
'
,
'
2
'
,
'
3
'
,
'
4
'
,
'
5
'
]);
let
consumedOrReadable
=
consumeReadableWithLimit
(
readable
,
strings
=>
strings
.
join
(),
5
);
assert
.
equal
(
consumedOrReadable
,
'
1,2,3,4,5
'
);
readable
=
arrayToReadable
([
'
1
'
,
'
2
'
,
'
3
'
,
'
4
'
,
'
5
'
]);
consumedOrReadable
=
consumeReadableWithLimit
(
readable
,
strings
=>
strings
.
join
(),
6
);
assert
.
equal
(
consumedOrReadable
,
'
1,2,3,4,5
'
);
});
function
arrayToReadable
<
T
>
(
array
:
T
[]):
Readable
<
T
>
{
return
{
read
:
()
=>
array
.
shift
()
||
null
};
}
function
readableToStream
(
readable
:
Readable
<
string
>
):
ReadableStream
<
string
>
{
const
stream
=
newWriteableStream
<
string
>
(
strings
=>
strings
.
join
());
// Simulate async behavior
setTimeout
(()
=>
{
let
chunk
:
string
|
null
=
null
;
while
((
chunk
=
readable
.
read
())
!==
null
)
{
stream
.
write
(
chunk
);
}
stream
.
end
();
},
0
);
return
stream
;
}
test
(
'
consumeStream
'
,
async
()
=>
{
const
stream
=
readableToStream
(
arrayToReadable
([
'
1
'
,
'
2
'
,
'
3
'
,
'
4
'
,
'
5
'
]));
const
consumed
=
await
consumeStream
(
stream
,
strings
=>
strings
.
join
());
assert
.
equal
(
consumed
,
'
1,2,3,4,5
'
);
});
test
(
'
consumeStreamWithLimit
'
,
async
()
=>
{
for
(
let
i
=
0
;
i
<
5
;
i
++
)
{
const
readable
=
readableToStream
(
arrayToReadable
([
'
1
'
,
'
2
'
,
'
3
'
,
'
4
'
,
'
5
'
]));
const
consumedOrStream
=
await
consumeStreamWithLimit
(
readable
,
strings
=>
strings
.
join
(),
i
);
if
(
typeof
consumedOrStream
===
'
string
'
)
{
assert
.
fail
(
'
Unexpected result
'
);
}
else
{
const
consumed
=
await
consumeStream
(
consumedOrStream
,
strings
=>
strings
.
join
());
assert
.
equal
(
consumed
,
'
1,2,3,4,5
'
);
}
}
let
stream
=
readableToStream
(
arrayToReadable
([
'
1
'
,
'
2
'
,
'
3
'
,
'
4
'
,
'
5
'
]));
let
consumedOrStream
=
await
consumeStreamWithLimit
(
stream
,
strings
=>
strings
.
join
(),
5
);
assert
.
equal
(
consumedOrStream
,
'
1,2,3,4,5
'
);
stream
=
readableToStream
(
arrayToReadable
([
'
1
'
,
'
2
'
,
'
3
'
,
'
4
'
,
'
5
'
]));
consumedOrStream
=
await
consumeStreamWithLimit
(
stream
,
strings
=>
strings
.
join
(),
6
);
assert
.
equal
(
consumedOrStream
,
'
1,2,3,4,5
'
);
});
test
(
'
toStream
'
,
async
()
=>
{
const
stream
=
toStream
(
'
1,2,3,4,5
'
,
strings
=>
strings
.
join
());
const
consumed
=
await
consumeStream
(
stream
,
strings
=>
strings
.
join
());
assert
.
equal
(
consumed
,
'
1,2,3,4,5
'
);
});
test
(
'
toReadable
'
,
async
()
=>
{
const
readable
=
toReadable
(
'
1,2,3,4,5
'
);
const
consumed
=
await
consumeReadable
(
readable
,
strings
=>
strings
.
join
());
assert
.
equal
(
consumed
,
'
1,2,3,4,5
'
);
});
test
(
'
transform
'
,
async
()
=>
{
const
source
=
newWriteableStream
<
string
>
(
strings
=>
strings
.
join
());
const
result
=
transform
(
source
,
{
data
:
string
=>
string
+
string
},
strings
=>
strings
.
join
());
// Simulate async behavior
setTimeout
(()
=>
{
source
.
write
(
'
1
'
);
source
.
write
(
'
2
'
);
source
.
write
(
'
3
'
);
source
.
write
(
'
4
'
);
source
.
end
(
'
5
'
);
},
0
);
const
consumed
=
await
consumeStream
(
result
,
strings
=>
strings
.
join
());
assert
.
equal
(
consumed
,
'
11,22,33,44,55
'
);
});
});
src/vs/base/test/node/buffer.test.ts
浏览文件 @
073735c5
...
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
*
as
assert
from
'
assert
'
;
import
{
VSBuffer
,
bufferToReadable
,
readableToBuffer
,
bufferToStream
,
streamToBuffer
,
w
riteableBufferStream
}
from
'
vs/base/common/buffer
'
;
import
{
VSBuffer
,
bufferToReadable
,
readableToBuffer
,
bufferToStream
,
streamToBuffer
,
newW
riteableBufferStream
}
from
'
vs/base/common/buffer
'
;
import
{
timeout
}
from
'
vs/base/common/async
'
;
suite
(
'
Buffer
'
,
()
=>
{
...
...
@@ -30,7 +30,7 @@ suite('Buffer', () => {
});
test
(
'
bufferWriteableStream - basics (no error)
'
,
async
()
=>
{
const
stream
=
w
riteableBufferStream
();
const
stream
=
newW
riteableBufferStream
();
let
chunks
:
VSBuffer
[]
=
[];
stream
.
on
(
'
data
'
,
data
=>
{
...
...
@@ -60,7 +60,7 @@ suite('Buffer', () => {
});
test
(
'
bufferWriteableStream - basics (error)
'
,
async
()
=>
{
const
stream
=
w
riteableBufferStream
();
const
stream
=
newW
riteableBufferStream
();
let
chunks
:
VSBuffer
[]
=
[];
stream
.
on
(
'
data
'
,
data
=>
{
...
...
@@ -89,7 +89,7 @@ suite('Buffer', () => {
});
test
(
'
bufferWriteableStream - buffers data when no listener
'
,
async
()
=>
{
const
stream
=
w
riteableBufferStream
();
const
stream
=
newW
riteableBufferStream
();
await
timeout
(
0
);
stream
.
write
(
VSBuffer
.
fromString
(
'
Hello
'
));
...
...
@@ -118,7 +118,7 @@ suite('Buffer', () => {
});
test
(
'
bufferWriteableStream - buffers errors when no listener
'
,
async
()
=>
{
const
stream
=
w
riteableBufferStream
();
const
stream
=
newW
riteableBufferStream
();
await
timeout
(
0
);
stream
.
write
(
VSBuffer
.
fromString
(
'
Hello
'
));
...
...
@@ -149,7 +149,7 @@ suite('Buffer', () => {
});
test
(
'
bufferWriteableStream - buffers end when no listener
'
,
async
()
=>
{
const
stream
=
w
riteableBufferStream
();
const
stream
=
newW
riteableBufferStream
();
await
timeout
(
0
);
stream
.
write
(
VSBuffer
.
fromString
(
'
Hello
'
));
...
...
@@ -178,7 +178,7 @@ suite('Buffer', () => {
});
test
(
'
bufferWriteableStream - nothing happens after end()
'
,
async
()
=>
{
const
stream
=
w
riteableBufferStream
();
const
stream
=
newW
riteableBufferStream
();
let
chunks
:
VSBuffer
[]
=
[];
stream
.
on
(
'
data
'
,
data
=>
{
...
...
@@ -222,7 +222,7 @@ suite('Buffer', () => {
});
test
(
'
bufferWriteableStream - pause/resume (simple)
'
,
async
()
=>
{
const
stream
=
w
riteableBufferStream
();
const
stream
=
newW
riteableBufferStream
();
let
chunks
:
VSBuffer
[]
=
[];
stream
.
on
(
'
data
'
,
data
=>
{
...
...
@@ -259,7 +259,7 @@ suite('Buffer', () => {
});
test
(
'
bufferWriteableStream - pause/resume (pause after first write)
'
,
async
()
=>
{
const
stream
=
w
riteableBufferStream
();
const
stream
=
newW
riteableBufferStream
();
let
chunks
:
VSBuffer
[]
=
[];
stream
.
on
(
'
data
'
,
data
=>
{
...
...
@@ -299,7 +299,7 @@ suite('Buffer', () => {
});
test
(
'
bufferWriteableStream - pause/resume (error)
'
,
async
()
=>
{
const
stream
=
w
riteableBufferStream
();
const
stream
=
newW
riteableBufferStream
();
let
chunks
:
VSBuffer
[]
=
[];
stream
.
on
(
'
data
'
,
data
=>
{
...
...
@@ -336,7 +336,7 @@ suite('Buffer', () => {
});
test
(
'
bufferWriteableStream - destroy
'
,
async
()
=>
{
const
stream
=
w
riteableBufferStream
();
const
stream
=
newW
riteableBufferStream
();
let
chunks
:
VSBuffer
[]
=
[];
stream
.
on
(
'
data
'
,
data
=>
{
...
...
src/vs/editor/common/config/editorOptions.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/editor/contrib/referenceSearch/referencesModel.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/editor/contrib/referenceSearch/referencesTree.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/editor/contrib/referenceSearch/referencesWidget.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/editor/contrib/suggest/suggestController.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/platform/files/common/fileService.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/platform/files/common/files.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/platform/files/common/io.ts
0 → 100644
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/platform/files/node/diskFileSystemProvider.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/platform/files/test/node/diskFileService.test.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/platform/quickinput/common/quickInput.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/platform/remote/common/remoteAgentFileSystemChannel.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/platform/request/node/requestService.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/workbench/api/browser/mainThreadFileSystem.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/workbench/browser/parts/editor/breadcrumbsModel.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/workbench/browser/parts/editor/breadcrumbsPicker.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/workbench/browser/parts/editor/editorGroupView.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/workbench/browser/parts/quickinput/quickInput.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/workbench/browser/parts/quickinput/quickInputList.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/workbench/browser/web.main.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/workbench/contrib/debug/browser/breakpointsView.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/workbench/contrib/debug/browser/media/debug.contribution.css
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/workbench/contrib/extensions/browser/extensionEditor.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/workbench/contrib/files/common/explorerModel.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/workbench/contrib/files/electron-browser/textFileEditor.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/workbench/contrib/outline/browser/outlinePanel.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/workbench/contrib/remote/browser/remote.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/workbench/contrib/tasks/common/jsonSchemaCommon.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/workbench/contrib/tasks/common/jsonSchema_v2.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/workbench/contrib/update/browser/releaseNotesEditor.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/workbench/contrib/url/common/trustedDomainsFileSystemProvider.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/workbench/contrib/webview/browser/baseWebviewElement.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/workbench/contrib/webview/browser/pre/fake.html
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/workbench/contrib/welcome/walkThrough/browser/walkThroughPart.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/workbench/electron-browser/desktop.main.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/workbench/services/configuration/browser/configurationService.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/workbench/services/extensions/browser/webWorkerFileSystemProvider.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/workbench/services/progress/browser/editorProgressService.ts
已删除
100644 → 0
浏览文件 @
ca988713
此差异已折叠。
点击以展开。
src/vs/workbench/services/progress/browser/progressIndicator.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/workbench/services/telemetry/browser/telemetryService.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/workbench/services/textfile/common/textFileEditorModel.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/workbench/services/userData/common/fileUserDataProvider.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
src/vs/workbench/services/userData/common/inMemoryUserDataProvider.ts
浏览文件 @
073735c5
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录