Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
b57003f3
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,发现更多精彩内容 >>
提交
b57003f3
编写于
8月 16, 2018
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
NodeBuffer => Buffer
上级
e2b722d2
变更
13
显示空白变更内容
内联
并排
Showing
13 changed file
with
23 addition
and
23 deletion
+23
-23
extensions/git/src/encoding.ts
extensions/git/src/encoding.ts
+1
-1
extensions/git/src/typings/jschardet.d.ts
extensions/git/src/typings/jschardet.d.ts
+1
-1
extensions/php-language-features/src/features/validationProvider.ts
.../php-language-features/src/features/validationProvider.ts
+1
-1
src/typings/iconv-lite.d.ts
src/typings/iconv-lite.d.ts
+2
-2
src/typings/jschardet.d.ts
src/typings/jschardet.d.ts
+1
-1
src/vs/base/node/crypto.ts
src/vs/base/node/crypto.ts
+1
-1
src/vs/base/node/decoder.ts
src/vs/base/node/decoder.ts
+1
-1
src/vs/base/node/encoding.ts
src/vs/base/node/encoding.ts
+4
-4
src/vs/base/node/extfs.ts
src/vs/base/node/extfs.ts
+3
-3
src/vs/base/node/pfs.ts
src/vs/base/node/pfs.ts
+1
-1
src/vs/base/node/stream.ts
src/vs/base/node/stream.ts
+2
-2
src/vs/workbench/services/files/node/watcher/win32/csharpWatcherService.ts
...services/files/node/watcher/win32/csharpWatcherService.ts
+3
-3
src/vs/workbench/services/search/node/worker/searchWorker.ts
src/vs/workbench/services/search/node/worker/searchWorker.ts
+2
-2
未找到文件。
extensions/git/src/encoding.ts
浏览文件 @
b57003f3
...
...
@@ -9,7 +9,7 @@ import * as jschardet from 'jschardet';
jschardet
.
Constants
.
MINIMUM_THRESHOLD
=
0.2
;
function
detectEncodingByBOM
(
buffer
:
Node
Buffer
):
string
|
null
{
function
detectEncodingByBOM
(
buffer
:
Buffer
):
string
|
null
{
if
(
!
buffer
||
buffer
.
length
<
2
)
{
return
null
;
}
...
...
extensions/git/src/typings/jschardet.d.ts
浏览文件 @
b57003f3
...
...
@@ -3,7 +3,7 @@ declare module 'jschardet' {
encoding
:
string
,
confidence
:
number
}
export
function
detect
(
buffer
:
Node
Buffer
):
IDetectedMap
;
export
function
detect
(
buffer
:
Buffer
):
IDetectedMap
;
export
const
Constants
:
{
MINIMUM_THRESHOLD
:
number
,
...
...
extensions/php-language-features/src/features/validationProvider.ts
浏览文件 @
b57003f3
...
...
@@ -23,7 +23,7 @@ export class LineDecoder {
this
.
remaining
=
null
;
}
public
write
(
buffer
:
Node
Buffer
):
string
[]
{
public
write
(
buffer
:
Buffer
):
string
[]
{
var
result
:
string
[]
=
[];
var
value
=
this
.
remaining
?
this
.
remaining
+
this
.
stringDecoder
.
write
(
buffer
)
...
...
src/typings/iconv-lite.d.ts
浏览文件 @
b57003f3
...
...
@@ -6,9 +6,9 @@
/// <reference path='./node.d.ts'/>
declare
module
'
iconv-lite
'
{
export
function
decode
(
buffer
:
Node
Buffer
,
encoding
:
string
):
string
;
export
function
decode
(
buffer
:
Buffer
,
encoding
:
string
):
string
;
export
function
encode
(
content
:
string
|
NodeBuffer
,
encoding
:
string
,
options
?:
{
addBOM
?:
boolean
}):
Node
Buffer
;
export
function
encode
(
content
:
string
|
Buffer
,
encoding
:
string
,
options
?:
{
addBOM
?:
boolean
}):
Buffer
;
export
function
encodingExists
(
encoding
:
string
):
boolean
;
...
...
src/typings/jschardet.d.ts
浏览文件 @
b57003f3
...
...
@@ -3,7 +3,7 @@ declare module 'jschardet' {
encoding
:
string
,
confidence
:
number
}
export
function
detect
(
buffer
:
Node
Buffer
):
IDetectedMap
;
export
function
detect
(
buffer
:
Buffer
):
IDetectedMap
;
export
const
Constants
:
{
MINIMUM_THRESHOLD
:
number
,
...
...
src/vs/base/node/crypto.ts
浏览文件 @
b57003f3
...
...
@@ -32,7 +32,7 @@ export function checksum(path: string, sha1hash: string): TPromise<void> {
input
.
once
(
'
error
'
,
done
);
input
.
once
(
'
end
'
,
done
);
hashStream
.
once
(
'
error
'
,
done
);
hashStream
.
once
(
'
data
'
,
(
data
:
Node
Buffer
)
=>
done
(
null
,
data
.
toString
(
'
hex
'
)));
hashStream
.
once
(
'
data
'
,
(
data
:
Buffer
)
=>
done
(
null
,
data
.
toString
(
'
hex
'
)));
});
return
promise
.
then
(
hash
=>
{
...
...
src/vs/base/node/decoder.ts
浏览文件 @
b57003f3
...
...
@@ -25,7 +25,7 @@ export class LineDecoder {
this
.
remaining
=
null
;
}
public
write
(
buffer
:
Node
Buffer
):
string
[]
{
public
write
(
buffer
:
Buffer
):
string
[]
{
let
result
:
string
[]
=
[];
let
value
=
this
.
remaining
?
this
.
remaining
+
this
.
stringDecoder
.
write
(
buffer
)
...
...
src/vs/base/node/encoding.ts
浏览文件 @
b57003f3
...
...
@@ -119,11 +119,11 @@ export function bomLength(encoding: string): number {
return
0
;
}
export
function
decode
(
buffer
:
Node
Buffer
,
encoding
:
string
):
string
{
export
function
decode
(
buffer
:
Buffer
,
encoding
:
string
):
string
{
return
iconv
.
decode
(
buffer
,
toNodeEncoding
(
encoding
));
}
export
function
encode
(
content
:
string
|
NodeBuffer
,
encoding
:
string
,
options
?:
{
addBOM
?:
boolean
}):
Node
Buffer
{
export
function
encode
(
content
:
string
|
Buffer
,
encoding
:
string
,
options
?:
{
addBOM
?:
boolean
}):
Buffer
{
return
iconv
.
encode
(
content
,
toNodeEncoding
(
encoding
),
options
);
}
...
...
@@ -147,7 +147,7 @@ function toNodeEncoding(enc: string): string {
return
enc
;
}
export
function
detectEncodingByBOMFromBuffer
(
buffer
:
Node
Buffer
,
bytesRead
:
number
):
string
{
export
function
detectEncodingByBOMFromBuffer
(
buffer
:
Buffer
,
bytesRead
:
number
):
string
{
if
(
!
buffer
||
bytesRead
<
2
)
{
return
null
;
}
...
...
@@ -193,7 +193,7 @@ const IGNORE_ENCODINGS = ['ascii', 'utf-8', 'utf-16', 'utf-32'];
/**
* Guesses the encoding from buffer.
*/
export
function
guessEncodingByBuffer
(
buffer
:
Node
Buffer
):
TPromise
<
string
>
{
export
function
guessEncodingByBuffer
(
buffer
:
Buffer
):
TPromise
<
string
>
{
return
toWinJsPromise
(
import
(
'
jschardet
'
)).
then
(
jschardet
=>
{
jschardet
.
Constants
.
MINIMUM_THRESHOLD
=
MINIMUM_THRESHOLD
;
...
...
src/vs/base/node/extfs.ts
浏览文件 @
b57003f3
...
...
@@ -365,7 +365,7 @@ export interface IWriteFileOptions {
}
let
canFlush
=
true
;
export
function
writeFileAndFlush
(
path
:
string
,
data
:
string
|
Node
Buffer
|
NodeJS
.
ReadableStream
,
options
:
IWriteFileOptions
,
callback
:
(
error
?:
Error
)
=>
void
):
void
{
export
function
writeFileAndFlush
(
path
:
string
,
data
:
string
|
Buffer
|
NodeJS
.
ReadableStream
,
options
:
IWriteFileOptions
,
callback
:
(
error
?:
Error
)
=>
void
):
void
{
options
=
ensureOptions
(
options
);
if
(
typeof
data
===
'
string
'
||
Buffer
.
isBuffer
(
data
))
{
...
...
@@ -466,7 +466,7 @@ function doWriteFileStreamAndFlush(path: string, reader: NodeJS.ReadableStream,
// not in some cache.
//
// See https://github.com/nodejs/node/blob/v5.10.0/lib/fs.js#L1194
function
doWriteFileAndFlush
(
path
:
string
,
data
:
string
|
Node
Buffer
,
options
:
IWriteFileOptions
,
callback
:
(
error
?:
Error
)
=>
void
):
void
{
function
doWriteFileAndFlush
(
path
:
string
,
data
:
string
|
Buffer
,
options
:
IWriteFileOptions
,
callback
:
(
error
?:
Error
)
=>
void
):
void
{
if
(
options
.
encoding
)
{
data
=
encode
(
data
,
options
.
encoding
.
charset
,
{
addBOM
:
options
.
encoding
.
addBOM
});
}
...
...
@@ -503,7 +503,7 @@ function doWriteFileAndFlush(path: string, data: string | NodeBuffer, options: I
});
}
export
function
writeFileAndFlushSync
(
path
:
string
,
data
:
string
|
Node
Buffer
,
options
?:
IWriteFileOptions
):
void
{
export
function
writeFileAndFlushSync
(
path
:
string
,
data
:
string
|
Buffer
,
options
?:
IWriteFileOptions
):
void
{
options
=
ensureOptions
(
options
);
if
(
options
.
encoding
)
{
...
...
src/vs/base/node/pfs.ts
浏览文件 @
b57003f3
...
...
@@ -98,7 +98,7 @@ export function readFile(path: string, encoding?: string): TPromise<Buffer | str
const
writeFilePathQueue
:
{
[
path
:
string
]:
Queue
<
void
>
}
=
Object
.
create
(
null
);
export
function
writeFile
(
path
:
string
,
data
:
string
,
options
?:
extfs
.
IWriteFileOptions
):
TPromise
<
void
>
;
export
function
writeFile
(
path
:
string
,
data
:
Node
Buffer
,
options
?:
extfs
.
IWriteFileOptions
):
TPromise
<
void
>
;
export
function
writeFile
(
path
:
string
,
data
:
Buffer
,
options
?:
extfs
.
IWriteFileOptions
):
TPromise
<
void
>
;
export
function
writeFile
(
path
:
string
,
data
:
Uint8Array
,
options
?:
extfs
.
IWriteFileOptions
):
TPromise
<
void
>
;
export
function
writeFile
(
path
:
string
,
data
:
NodeJS
.
ReadableStream
,
options
?:
extfs
.
IWriteFileOptions
):
TPromise
<
void
>
;
export
function
writeFile
(
path
:
string
,
data
:
any
,
options
?:
extfs
.
IWriteFileOptions
):
TPromise
<
void
>
{
...
...
src/vs/base/node/stream.ts
浏览文件 @
b57003f3
...
...
@@ -10,7 +10,7 @@ import * as fs from 'fs';
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
export
interface
ReadResult
{
buffer
:
Node
Buffer
;
buffer
:
Buffer
;
bytesRead
:
number
;
}
...
...
@@ -24,7 +24,7 @@ export function readExactlyByFile(file: string, totalBytes: number): TPromise<Re
return
error
(
err
);
}
function
end
(
err
:
Error
,
resultBuffer
:
Node
Buffer
,
bytesRead
:
number
):
void
{
function
end
(
err
:
Error
,
resultBuffer
:
Buffer
,
bytesRead
:
number
):
void
{
fs
.
close
(
fd
,
closeError
=>
{
if
(
closeError
)
{
return
error
(
closeError
);
...
...
src/vs/workbench/services/files/node/watcher/win32/csharpWatcherService.ts
浏览文件 @
b57003f3
...
...
@@ -46,7 +46,7 @@ export class OutOfProcessWin32FolderWatcher {
const
stdoutLineDecoder
=
new
decoder
.
LineDecoder
();
// Events over stdout
this
.
handle
.
stdout
.
on
(
'
data
'
,
(
data
:
Node
Buffer
)
=>
{
this
.
handle
.
stdout
.
on
(
'
data
'
,
(
data
:
Buffer
)
=>
{
// Collect raw events from output
const
rawEvents
:
IRawFileChange
[]
=
[];
...
...
@@ -86,13 +86,13 @@ export class OutOfProcessWin32FolderWatcher {
// Errors
this
.
handle
.
on
(
'
error
'
,
(
error
:
Error
)
=>
this
.
onError
(
error
));
this
.
handle
.
stderr
.
on
(
'
data
'
,
(
data
:
Node
Buffer
)
=>
this
.
onError
(
data
));
this
.
handle
.
stderr
.
on
(
'
data
'
,
(
data
:
Buffer
)
=>
this
.
onError
(
data
));
// Exit
this
.
handle
.
on
(
'
exit
'
,
(
code
:
number
,
signal
:
string
)
=>
this
.
onExit
(
code
,
signal
));
}
private
onError
(
error
:
Error
|
Node
Buffer
):
void
{
private
onError
(
error
:
Error
|
Buffer
):
void
{
this
.
errorCallback
(
'
[FileWatcher] process error:
'
+
error
.
toString
());
}
...
...
src/vs/workbench/services/search/node/worker/searchWorker.ts
浏览文件 @
b57003f3
...
...
@@ -177,8 +177,8 @@ export class SearchWorkerEngine {
return
clb
(
null
);
// return early if canceled or limit reached
}
fs
.
read
(
fd
,
buffer
,
0
,
buffer
.
length
,
null
,
(
error
:
Error
,
bytesRead
:
number
,
buffer
:
Node
Buffer
)
=>
{
const
decodeBuffer
=
(
buffer
:
Node
Buffer
,
start
:
number
,
end
:
number
):
string
=>
{
fs
.
read
(
fd
,
buffer
,
0
,
buffer
.
length
,
null
,
(
error
:
Error
,
bytesRead
:
number
,
buffer
:
Buffer
)
=>
{
const
decodeBuffer
=
(
buffer
:
Buffer
,
start
:
number
,
end
:
number
):
string
=>
{
if
(
options
.
encoding
===
UTF8
||
options
.
encoding
===
UTF8_with_bom
)
{
return
buffer
.
toString
(
undefined
,
start
,
end
);
// much faster to use built in toString() when encoding is default
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录