Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
1f63cd83
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,发现更多精彩内容 >>
提交
1f63cd83
编写于
10月 15, 2018
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix a few more strict null errors
上级
f3eb7ada
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
27 addition
and
20 deletion
+27
-20
src/tsconfig.strictNullChecks.json
src/tsconfig.strictNullChecks.json
+11
-4
src/vs/editor/common/services/getIconClasses.ts
src/vs/editor/common/services/getIconClasses.ts
+3
-3
src/vs/editor/contrib/referenceSearch/referencesModel.ts
src/vs/editor/contrib/referenceSearch/referencesModel.ts
+6
-6
src/vs/platform/environment/node/argv.ts
src/vs/platform/environment/node/argv.ts
+4
-4
src/vs/platform/extensionManagement/node/extensionLifecycle.ts
...s/platform/extensionManagement/node/extensionLifecycle.ts
+3
-3
未找到文件。
src/tsconfig.strictNullChecks.json
浏览文件 @
1f63cd83
...
...
@@ -36,6 +36,7 @@
"./vs/base/browser/ui/scrollbar/verticalScrollbar.ts"
,
"./vs/base/browser/ui/tree/tree.ts"
,
"./vs/base/browser/ui/widget.ts"
,
"./vs/base/common/actions.ts"
,
"./vs/base/common/amd.ts"
,
"./vs/base/common/arrays.ts"
,
"./vs/base/common/assert.ts"
,
...
...
@@ -105,6 +106,7 @@
"./vs/base/parts/contextmenu/common/contextmenu.ts"
,
"./vs/base/parts/contextmenu/electron-main/contextmenu.ts"
,
"./vs/base/parts/ipc/node/ipc.ts"
,
"./vs/base/parts/ipc/test/node/testService.ts"
,
"./vs/base/parts/quickopen/common/quickOpen.ts"
,
"./vs/base/test/common/utils.ts"
,
"./vs/base/test/node/uri.test.perf.ts"
,
...
...
@@ -239,6 +241,7 @@
"./vs/editor/common/services/editorSimpleWorker.ts"
,
"./vs/editor/common/services/editorWorkerService.ts"
,
"./vs/editor/common/services/editorWorkerServiceImpl.ts"
,
"./vs/editor/common/services/getIconClasses.ts"
,
"./vs/editor/common/services/languagesRegistry.ts"
,
"./vs/editor/common/services/modeService.ts"
,
"./vs/editor/common/services/modeServiceImpl.ts"
,
...
...
@@ -319,11 +322,12 @@
"./vs/editor/contrib/message/messageController.ts"
,
"./vs/editor/contrib/parameterHints/provideSignatureHelp.ts"
,
"./vs/editor/contrib/quickOpen/quickOpen.ts"
,
"./vs/editor/contrib/referenceSearch/referencesModel.ts"
,
"./vs/editor/contrib/smartSelect/tokenTree.ts"
,
"./vs/editor/contrib/snippet/snippetParser.ts"
,
"./vs/editor/contrib/suggest/suggest.ts"
,
"./vs/editor/contrib/suggest/wordDistance.ts"
,
"./vs/editor/contrib/suggest/wordContextKey.ts"
,
"./vs/editor/contrib/suggest/wordDistance.ts"
,
"./vs/editor/contrib/toggleTabFocusMode/toggleTabFocusMode.ts"
,
"./vs/editor/contrib/wordHighlighter/wordHighlighter.ts"
,
"./vs/editor/contrib/wordOperations/wordOperations.ts"
,
...
...
@@ -358,7 +362,6 @@
"./vs/nls.d.ts"
,
"./vs/nls.mock.ts"
,
"./vs/platform/actions/common/actions.ts"
,
"./vs/platform/label/common/label.ts"
,
"./vs/platform/backup/common/backup.ts"
,
"./vs/platform/broadcast/electron-browser/broadcastService.ts"
,
"./vs/platform/clipboard/common/clipboardService.ts"
,
...
...
@@ -371,8 +374,10 @@
"./vs/platform/download/common/download.ts"
,
"./vs/platform/editor/common/editor.ts"
,
"./vs/platform/environment/common/environment.ts"
,
"./vs/platform/environment/node/argv.ts"
,
"./vs/platform/extensionManagement/common/extensionManagement.ts"
,
"./vs/platform/extensionManagement/common/extensionNls.ts"
,
"./vs/platform/extensionManagement/node/extensionLifecycle.ts"
,
"./vs/platform/extensionManagement/node/extensionManagementIpc.ts"
,
"./vs/platform/extensions/common/extensionHost.ts"
,
"./vs/platform/extensions/common/extensions.ts"
,
...
...
@@ -395,6 +400,8 @@
"./vs/platform/keybinding/common/resolvedKeybindingItem.ts"
,
"./vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts"
,
"./vs/platform/keybinding/test/common/mockKeybindingService.ts"
,
"./vs/platform/label/common/label.ts"
,
"./vs/platform/label/electron-browser/label.contribution.ts"
,
"./vs/platform/lifecycle/common/lifecycle.ts"
,
"./vs/platform/localizations/common/localizations.ts"
,
"./vs/platform/log/common/bufferLog.ts"
,
...
...
@@ -511,13 +518,13 @@
"./vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts"
,
"./vs/workbench/services/keybinding/common/windowsKeyboardMapper.ts"
,
"./vs/workbench/services/mode/common/workbenchModeService.ts"
,
"./vs/workbench/services/panel/common/panelService.ts"
,
"./vs/workbench/services/progress/common/progress.ts"
,
"./vs/workbench/services/scm/common/scm.ts"
,
"./vs/workbench/services/scm/common/scmService.ts"
,
"./vs/workbench/services/search/node/search.ts"
,
"./vs/workbench/services/search/node/searchHistoryService.ts"
,
"./vs/workbench/services/search/node/searchIpc.ts"
,
"./vs/workbench/services/textMate/electron-browser/TMGrammars.ts"
,
"./vs/workbench/services/textMate/electron-browser/TMHelper.ts"
,
"./vs/workbench/services/textMate/electron-browser/textMateService.ts"
,
...
...
@@ -533,4 +540,4 @@
"exclude"
:
[
"./typings/require-monaco.d.ts"
]
}
}
\ No newline at end of file
src/vs/editor/common/services/getIconClasses.ts
浏览文件 @
1f63cd83
...
...
@@ -45,7 +45,7 @@ export function getIconClasses(modelService: IModelService, modeService: IModeSe
classes
.
push
(
`ext-file-icon`
);
// extra segment to increase file-ext score
}
// Configured Language
let
configuredLangId
=
getConfiguredLangId
(
modelService
,
resource
);
let
configuredLangId
:
string
|
null
=
getConfiguredLangId
(
modelService
,
resource
);
configuredLangId
=
configuredLangId
||
modeService
.
getModeIdByFilepathOrFirstLine
(
path
);
if
(
configuredLangId
)
{
classes
.
push
(
`
${
cssEscape
(
configuredLangId
)}
-lang-file-icon`
);
...
...
@@ -55,8 +55,8 @@ export function getIconClasses(modelService: IModelService, modeService: IModeSe
return
classes
;
}
export
function
getConfiguredLangId
(
modelService
:
IModelService
,
resource
:
uri
):
string
{
let
configuredLangId
:
string
;
export
function
getConfiguredLangId
(
modelService
:
IModelService
,
resource
:
uri
):
string
|
null
{
let
configuredLangId
:
string
|
null
=
null
;
if
(
resource
)
{
const
model
=
modelService
.
getModel
(
resource
);
if
(
model
)
{
...
...
src/vs/editor/contrib/referenceSearch/referencesModel.ts
浏览文件 @
1f63cd83
...
...
@@ -60,7 +60,7 @@ export class FilePreview implements IDisposable {
dispose
(
this
.
_modelReference
);
}
preview
(
range
:
IRange
,
n
:
number
=
8
):
{
before
:
string
;
inside
:
string
;
after
:
string
}
{
preview
(
range
:
IRange
,
n
:
number
=
8
):
{
before
:
string
;
inside
:
string
;
after
:
string
}
|
undefined
{
const
model
=
this
.
_modelReference
.
object
.
textEditorModel
;
if
(
!
model
)
{
...
...
@@ -85,7 +85,7 @@ export class FilePreview implements IDisposable {
export
class
FileReferences
implements
IDisposable
{
private
_children
:
OneReference
[];
private
_preview
:
FilePreview
;
private
_preview
?
:
FilePreview
;
private
_resolved
:
boolean
;
private
_loadFailure
:
any
;
...
...
@@ -109,7 +109,7 @@ export class FileReferences implements IDisposable {
return
this
.
_uri
;
}
get
preview
():
FilePreview
{
get
preview
():
FilePreview
|
undefined
{
return
this
.
_preview
;
}
...
...
@@ -156,7 +156,7 @@ export class FileReferences implements IDisposable {
dispose
():
void
{
if
(
this
.
_preview
)
{
this
.
_preview
.
dispose
();
this
.
_preview
=
null
;
this
.
_preview
=
undefined
;
}
}
}
...
...
@@ -175,7 +175,7 @@ export class ReferencesModel implements IDisposable {
// grouping and sorting
references
.
sort
(
ReferencesModel
.
_compareReferences
);
let
current
:
FileReferences
;
let
current
:
FileReferences
|
undefined
;
for
(
let
ref
of
references
)
{
if
(
!
current
||
current
.
uri
.
toString
()
!==
ref
.
uri
.
toString
())
{
// new group
...
...
@@ -239,7 +239,7 @@ export class ReferencesModel implements IDisposable {
}
}
nearestReference
(
resource
:
URI
,
position
:
Position
):
OneReference
{
nearestReference
(
resource
:
URI
,
position
:
Position
):
OneReference
|
undefined
{
const
nearest
=
this
.
references
.
map
((
ref
,
idx
)
=>
{
return
{
...
...
src/vs/platform/environment/node/argv.ts
浏览文件 @
1f63cd83
...
...
@@ -106,7 +106,7 @@ function validate(args: ParsedArgs): ParsedArgs {
return
args
;
}
function
stripAppPath
(
argv
:
string
[]):
string
[]
{
function
stripAppPath
(
argv
:
string
[]):
string
[]
|
undefined
{
const
index
=
firstIndex
(
argv
,
a
=>
!
/^-/
.
test
(
a
));
if
(
index
>
-
1
)
{
...
...
@@ -123,7 +123,7 @@ export function parseMainProcessArgv(processArgv: string[]): ParsedArgs {
// If dev, remove the first non-option argument: it's the app location
if
(
process
.
env
[
'
VSCODE_DEV
'
])
{
args
=
stripAppPath
(
args
);
args
=
stripAppPath
(
args
)
||
[]
;
}
return
validate
(
parseArgs
(
args
));
...
...
@@ -136,7 +136,7 @@ export function parseCLIProcessArgv(processArgv: string[]): ParsedArgs {
let
[,
,
...
args
]
=
processArgv
;
if
(
process
.
env
[
'
VSCODE_DEV
'
])
{
args
=
stripAppPath
(
args
);
args
=
stripAppPath
(
args
)
||
[]
;
}
return
validate
(
parseArgs
(
args
));
...
...
@@ -191,7 +191,7 @@ export function formatOptions(options: { [name: string]: string; }, columns: num
let
argLength
=
Math
.
max
.
apply
(
null
,
keys
.
map
(
k
=>
k
.
length
))
+
2
/*left padding*/
+
1
/*right padding*/
;
if
(
columns
-
argLength
<
25
)
{
// Use a condensed version on narrow terminals
return
keys
.
reduce
((
r
,
key
)
=>
r
.
concat
([
`
${
key
}
`
,
`
${
options
[
key
]}
`
]),
[]).
join
(
'
\n
'
);
return
keys
.
reduce
((
r
,
key
)
=>
r
.
concat
([
`
${
key
}
`
,
`
${
options
[
key
]}
`
]),
[]
as
string
[]
).
join
(
'
\n
'
);
}
let
descriptionColumns
=
columns
-
argLength
-
1
;
let
result
=
''
;
...
...
src/vs/platform/extensionManagement/node/extensionLifecycle.ts
浏览文件 @
1f63cd83
...
...
@@ -33,7 +33,7 @@ export class ExtensionsLifecycle extends Disposable {
}
}
private
parseUninstallScript
(
extension
:
ILocalExtension
):
{
uninstallHook
:
string
,
args
:
string
[]
}
{
private
parseUninstallScript
(
extension
:
ILocalExtension
):
{
uninstallHook
:
string
,
args
:
string
[]
}
|
null
{
if
(
extension
.
location
.
scheme
===
Schemas
.
file
&&
extension
.
manifest
&&
extension
.
manifest
[
'
scripts
'
]
&&
typeof
extension
.
manifest
[
'
scripts
'
][
'
vscode:uninstall
'
]
===
'
string
'
)
{
const
uninstallScript
=
(
<
string
>
extension
.
manifest
[
'
scripts
'
][
'
vscode:uninstall
'
]).
split
(
'
'
);
if
(
uninstallScript
.
length
<
2
||
uninstallScript
[
0
]
!==
'
node
'
||
!
uninstallScript
[
1
])
{
...
...
@@ -57,7 +57,7 @@ export class ExtensionsLifecycle extends Disposable {
if
(
error
)
{
e
(
error
);
}
else
{
c
(
null
);
c
(
void
0
);
}
};
...
...
@@ -87,7 +87,7 @@ export class ExtensionsLifecycle extends Disposable {
private
start
(
uninstallHook
:
string
,
args
:
string
[],
extension
:
ILocalExtension
):
ChildProcess
{
const
opts
=
{
silent
:
true
,
execArgv
:
<
string
[]
>
undefined
execArgv
:
undefined
};
const
extensionUninstallProcess
=
fork
(
uninstallHook
,
[
'
--type=extensionUninstall
'
,
...
args
],
opts
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录