Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
98f23687
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
98f23687
编写于
12月 07, 2018
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use undefined instead of null
上级
3fc69f20
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
12 addition
and
12 deletion
+12
-12
extensions/typescript-language-features/src/features/task.ts
extensions/typescript-language-features/src/features/task.ts
+2
-2
extensions/typescript-language-features/src/typescriptService.ts
...ons/typescript-language-features/src/typescriptService.ts
+2
-2
extensions/typescript-language-features/src/typescriptServiceClient.ts
...pescript-language-features/src/typescriptServiceClient.ts
+4
-4
extensions/typescript-language-features/src/utils/managedFileContext.ts
...escript-language-features/src/utils/managedFileContext.ts
+1
-1
extensions/typescript-language-features/src/utils/resourceMap.ts
...ons/typescript-language-features/src/utils/resourceMap.ts
+2
-2
extensions/typescript-language-features/src/utils/versionStatus.ts
...s/typescript-language-features/src/utils/versionStatus.ts
+1
-1
未找到文件。
extensions/typescript-language-features/src/features/task.ts
浏览文件 @
98f23687
...
...
@@ -158,7 +158,7 @@ class TscTaskProvider implements vscode.TaskProvider {
return
undefined
;
}
private
getActiveTypeScriptFile
():
string
|
null
{
private
getActiveTypeScriptFile
():
string
|
undefined
{
const
editor
=
vscode
.
window
.
activeTextEditor
;
if
(
editor
)
{
const
document
=
editor
.
document
;
...
...
@@ -166,7 +166,7 @@ class TscTaskProvider implements vscode.TaskProvider {
return
this
.
client
.
value
.
toPath
(
document
.
uri
);
}
}
return
null
;
return
undefined
;
}
private
async
getTasksForProject
(
project
:
TSConfig
):
Promise
<
vscode
.
Task
[]
>
{
...
...
extensions/typescript-language-features/src/typescriptService.ts
浏览文件 @
98f23687
...
...
@@ -63,14 +63,14 @@ export interface ITypeScriptServiceClient {
*
* Does not try handling case insensitivity.
*/
normalizedPath
(
resource
:
vscode
.
Uri
):
string
|
null
;
normalizedPath
(
resource
:
vscode
.
Uri
):
string
|
undefined
;
/**
* Map a resource to a normalized path
*
* This will attempt to handle case insensitivity.
*/
toPath
(
resource
:
vscode
.
Uri
):
string
|
null
;
toPath
(
resource
:
vscode
.
Uri
):
string
|
undefined
;
/**
* Convert a path to a resource.
...
...
extensions/typescript-language-features/src/typescriptServiceClient.ts
浏览文件 @
98f23687
...
...
@@ -488,7 +488,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
}
}
public
normalizedPath
(
resource
:
vscode
.
Uri
):
string
|
null
{
public
normalizedPath
(
resource
:
vscode
.
Uri
):
string
|
undefined
{
if
(
this
.
_apiVersion
.
gte
(
API
.
v213
))
{
if
(
resource
.
scheme
===
fileSchemes
.
walkThroughSnippet
||
resource
.
scheme
===
fileSchemes
.
untitled
)
{
const
dirName
=
path
.
dirname
(
resource
.
path
);
...
...
@@ -498,19 +498,19 @@ export default class TypeScriptServiceClient extends Disposable implements IType
}
if
(
resource
.
scheme
!==
fileSchemes
.
file
)
{
return
null
;
return
undefined
;
}
const
result
=
resource
.
fsPath
;
if
(
!
result
)
{
return
null
;
return
undefined
;
}
// Both \ and / must be escaped in regular expressions
return
result
.
replace
(
new
RegExp
(
'
\\
'
+
this
.
pathSeparator
,
'
g
'
),
'
/
'
);
}
public
toPath
(
resource
:
vscode
.
Uri
):
string
|
null
{
public
toPath
(
resource
:
vscode
.
Uri
):
string
|
undefined
{
return
this
.
normalizedPath
(
resource
);
}
...
...
extensions/typescript-language-features/src/utils/managedFileContext.ts
浏览文件 @
98f23687
...
...
@@ -17,7 +17,7 @@ export default class ManagedFileContextManager {
private
readonly
onDidChangeActiveTextEditorSub
:
vscode
.
Disposable
;
public
constructor
(
private
readonly
normalizePath
:
(
resource
:
vscode
.
Uri
)
=>
string
|
null
private
readonly
normalizePath
:
(
resource
:
vscode
.
Uri
)
=>
string
|
undefined
)
{
this
.
onDidChangeActiveTextEditorSub
=
vscode
.
window
.
onDidChangeActiveTextEditor
(
this
.
onDidChangeActiveTextEditor
,
this
);
...
...
extensions/typescript-language-features/src/utils/resourceMap.ts
浏览文件 @
98f23687
...
...
@@ -18,7 +18,7 @@ export class ResourceMap<T> {
private
readonly
_map
=
new
Map
<
string
,
{
resource
:
vscode
.
Uri
,
value
:
T
}
>
();
constructor
(
private
readonly
_normalizePath
:
(
resource
:
vscode
.
Uri
)
=>
string
|
null
=
(
resource
)
=>
resource
.
fsPath
private
readonly
_normalizePath
:
(
resource
:
vscode
.
Uri
)
=>
string
|
undefined
=
(
resource
)
=>
resource
.
fsPath
)
{
}
public
get
size
()
{
...
...
@@ -71,7 +71,7 @@ export class ResourceMap<T> {
return
this
.
_map
.
values
();
}
private
toKey
(
resource
:
vscode
.
Uri
):
string
|
null
{
private
toKey
(
resource
:
vscode
.
Uri
):
string
|
undefined
{
const
key
=
this
.
_normalizePath
(
resource
);
if
(
!
key
)
{
return
key
;
...
...
extensions/typescript-language-features/src/utils/versionStatus.ts
浏览文件 @
98f23687
...
...
@@ -12,7 +12,7 @@ export default class VersionStatus {
private
readonly
_versionBarEntry
:
vscode
.
StatusBarItem
;
constructor
(
private
readonly
_normalizePath
:
(
resource
:
vscode
.
Uri
)
=>
string
|
null
private
readonly
_normalizePath
:
(
resource
:
vscode
.
Uri
)
=>
string
|
undefined
)
{
this
.
_versionBarEntry
=
vscode
.
window
.
createStatusBarItem
(
vscode
.
StatusBarAlignment
.
Right
,
99
/* to the right of editor status (100) */
);
this
.
_onChangeEditorSub
=
vscode
.
window
.
onDidChangeActiveTextEditor
(
this
.
showHideStatus
,
this
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录