Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
fec1775a
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,发现更多精彩内容 >>
提交
fec1775a
编写于
11月 05, 2018
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Strict null checks
上级
10b95a0b
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
34 addition
and
25 deletion
+34
-25
src/tsconfig.strictNullChecks.json
src/tsconfig.strictNullChecks.json
+10
-0
src/vs/code/electron-browser/sharedProcess/contrib/languagePackCachedDataCleaner.ts
...er/sharedProcess/contrib/languagePackCachedDataCleaner.ts
+1
-1
src/vs/code/electron-browser/sharedProcess/contrib/nodeCachedDataCleaner.ts
...on-browser/sharedProcess/contrib/nodeCachedDataCleaner.ts
+1
-1
src/vs/code/node/windowsFinder.ts
src/vs/code/node/windowsFinder.ts
+3
-3
src/vs/editor/contrib/smartSelect/tokenSelectionSupport.ts
src/vs/editor/contrib/smartSelect/tokenSelectionSupport.ts
+4
-5
src/vs/platform/driver/node/driver.ts
src/vs/platform/driver/node/driver.ts
+3
-3
src/vs/platform/workspaces/common/workspaces.ts
src/vs/platform/workspaces/common/workspaces.ts
+2
-2
src/vs/platform/workspaces/electron-main/workspacesMainService.ts
...latform/workspaces/electron-main/workspacesMainService.ts
+3
-3
src/vs/workbench/parts/cli/electron-browser/cli.contribution.ts
.../workbench/parts/cli/electron-browser/cli.contribution.ts
+3
-3
src/vs/workbench/parts/execution/electron-browser/terminal.ts
...vs/workbench/parts/execution/electron-browser/terminal.ts
+1
-1
src/vs/workbench/parts/terminal/node/terminalProcess.ts
src/vs/workbench/parts/terminal/node/terminalProcess.ts
+2
-2
src/vs/workbench/services/search/node/legacy/worker/searchWorkerIpc.ts
...nch/services/search/node/legacy/worker/searchWorkerIpc.ts
+1
-1
未找到文件。
src/tsconfig.strictNullChecks.json
浏览文件 @
fec1775a
...
...
@@ -108,12 +108,16 @@
"./vs/code/electron-browser/issue/issueReporterModel.ts"
,
"./vs/code/electron-browser/issue/issueReporterPage.ts"
,
"./vs/code/electron-browser/issue/issueReporterUtil.ts"
,
"./vs/code/electron-browser/sharedProcess/contrib/contributions.ts"
,
"./vs/code/electron-browser/sharedProcess/contrib/languagePackCachedDataCleaner.ts"
,
"./vs/code/electron-browser/sharedProcess/contrib/nodeCachedDataCleaner.ts"
,
"./vs/code/electron-main/auth.ts"
,
"./vs/code/electron-main/keyboard.ts"
,
"./vs/code/electron-main/sharedProcess.ts"
,
"./vs/code/electron-main/theme.ts"
,
"./vs/code/node/shellEnv.ts"
,
"./vs/code/node/wait.ts"
,
"./vs/code/node/windowsFinder.ts"
,
"./vs/editor/browser/config/charWidthReader.ts"
,
"./vs/editor/browser/config/configuration.ts"
,
"./vs/editor/browser/config/elementSizeObserver.ts"
,
...
...
@@ -331,6 +335,7 @@
"./vs/editor/contrib/referenceSearch/referencesModel.ts"
,
"./vs/editor/contrib/rename/rename.ts"
,
"./vs/editor/contrib/rename/renameInputField.ts"
,
"./vs/editor/contrib/smartSelect/tokenSelectionSupport.ts"
,
"./vs/editor/contrib/smartSelect/tokenTree.ts"
,
"./vs/editor/contrib/snippet/snippetParser.ts"
,
"./vs/editor/contrib/suggest/suggest.ts"
,
...
...
@@ -395,6 +400,7 @@
"./vs/platform/dialogs/node/dialogService.ts"
,
"./vs/platform/download/common/download.ts"
,
"./vs/platform/download/node/downloadService.ts"
,
"./vs/platform/driver/node/driver.ts"
,
"./vs/platform/editor/common/editor.ts"
,
"./vs/platform/environment/common/environment.ts"
,
"./vs/platform/environment/node/argv.ts"
,
...
...
@@ -497,6 +503,7 @@
"./vs/platform/workspace/common/workspace.ts"
,
"./vs/platform/workspace/test/common/testWorkspace.ts"
,
"./vs/platform/workspaces/common/workspaces.ts"
,
"./vs/platform/workspaces/electron-main/workspacesMainService.ts"
,
"./vs/platform/workspaces/node/workspaces.ts"
,
"./vs/platform/workspaces/node/workspacesIpc.ts"
,
"./vs/vscode.d.ts"
,
...
...
@@ -529,6 +536,7 @@
"./vs/workbench/common/theme.ts"
,
"./vs/workbench/common/viewlet.ts"
,
"./vs/workbench/common/views.ts"
,
"./vs/workbench/parts/cli/electron-browser/cli.contribution.ts"
,
"./vs/workbench/parts/codeEditor/browser/menuPreventer.ts"
,
"./vs/workbench/parts/codeEditor/browser/simpleEditorOptions.ts"
,
"./vs/workbench/parts/codeEditor/electron-browser/accessibility.ts"
,
...
...
@@ -549,6 +557,7 @@
"./vs/workbench/parts/emmet/electron-browser/emmetActions.ts"
,
"./vs/workbench/parts/emmet/test/electron-browser/emmetAction.test.ts"
,
"./vs/workbench/parts/execution/common/execution.ts"
,
"./vs/workbench/parts/execution/electron-browser/terminal.ts"
,
"./vs/workbench/parts/extensions/common/extensionQuery.ts"
,
"./vs/workbench/parts/extensions/common/extensions.ts"
,
"./vs/workbench/parts/extensions/common/extensionsFileTemplate.ts"
,
...
...
@@ -593,6 +602,7 @@
"./vs/workbench/parts/terminal/node/terminal.ts"
,
"./vs/workbench/parts/terminal/node/terminalCommandTracker.ts"
,
"./vs/workbench/parts/terminal/node/terminalEnvironment.ts"
,
"./vs/workbench/parts/terminal/node/terminalProcess.ts"
,
"./vs/workbench/parts/terminal/node/terminalProcessExtHostProxy.ts"
,
"./vs/workbench/parts/url/electron-browser/url.contribution.ts"
,
"./vs/workbench/parts/webview/electron-browser/webviewProtocols.ts"
,
...
...
src/vs/code/electron-browser/sharedProcess/contrib/languagePackCachedDataCleaner.ts
浏览文件 @
fec1775a
...
...
@@ -50,7 +50,7 @@ export class LanguagePackCachedDataCleaner {
}
private
_manageCachedDataSoon
():
void
{
let
handle
=
setTimeout
(
async
()
=>
{
let
handle
:
any
=
setTimeout
(
async
()
=>
{
handle
=
undefined
;
this
.
_logService
.
info
(
'
Starting to clean up unused language packs.
'
);
const
maxAge
=
product
.
nameLong
.
indexOf
(
'
Insiders
'
)
>=
0
...
...
src/vs/code/electron-browser/sharedProcess/contrib/nodeCachedDataCleaner.ts
浏览文件 @
fec1775a
...
...
@@ -41,7 +41,7 @@ export class NodeCachedDataCleaner {
const
nodeCachedDataRootDir
=
dirname
(
this
.
_environmentService
.
nodeCachedDataDir
);
const
nodeCachedDataCurrent
=
basename
(
this
.
_environmentService
.
nodeCachedDataDir
);
let
handle
=
setTimeout
(()
=>
{
let
handle
:
any
=
setTimeout
(()
=>
{
handle
=
undefined
;
readdir
(
nodeCachedDataRootDir
).
then
(
entries
=>
{
...
...
src/vs/code/node/windowsFinder.ts
浏览文件 @
fec1775a
...
...
@@ -45,7 +45,7 @@ function findWindowOnFilePath<W extends ISimpleWindow>(windows: W[], fileUri: UR
const
workspaceWindows
=
windows
.
filter
(
window
=>
!!
window
.
openedWorkspace
);
for
(
let
i
=
0
;
i
<
workspaceWindows
.
length
;
i
++
)
{
const
window
=
workspaceWindows
[
i
];
const
resolvedWorkspace
=
workspaceResolver
(
window
.
openedWorkspace
);
const
resolvedWorkspace
=
workspaceResolver
(
window
.
openedWorkspace
!
);
if
(
resolvedWorkspace
&&
resolvedWorkspace
.
folders
.
some
(
folder
=>
isEqualOrParent
(
fileUri
,
folder
.
uri
)))
{
return
window
;
}
...
...
@@ -54,7 +54,7 @@ function findWindowOnFilePath<W extends ISimpleWindow>(windows: W[], fileUri: UR
// Then go with single folder windows that are parent of the provided file path
const
singleFolderWindowsOnFilePath
=
windows
.
filter
(
window
=>
window
.
openedFolderUri
&&
isEqualOrParent
(
fileUri
,
window
.
openedFolderUri
));
if
(
singleFolderWindowsOnFilePath
.
length
)
{
return
singleFolderWindowsOnFilePath
.
sort
((
a
,
b
)
=>
-
(
a
.
openedFolderUri
.
path
.
length
-
b
.
openedFolderUri
.
path
.
length
))[
0
];
return
singleFolderWindowsOnFilePath
.
sort
((
a
,
b
)
=>
-
(
a
.
openedFolderUri
!
.
path
.
length
-
b
.
openedFolderUri
!
.
path
.
length
))[
0
];
}
return
null
;
...
...
@@ -90,7 +90,7 @@ export function findWindowOnWorkspace<W extends ISimpleWindow>(windows: W[], wor
export
function
findWindowOnExtensionDevelopmentPath
<
W
extends
ISimpleWindow
>
(
windows
:
W
[],
extensionDevelopmentPath
:
string
):
W
|
null
{
for
(
const
window
of
windows
)
{
// match on extension development path. The path can be a path or uri string, using paths.isEqual is not 100% correct but good enough
if
(
paths
.
isEqual
(
window
.
extensionDevelopmentPath
,
extensionDevelopmentPath
,
!
platform
.
isLinux
/* ignorecase */
))
{
if
(
window
.
extensionDevelopmentPath
&&
paths
.
isEqual
(
window
.
extensionDevelopmentPath
,
extensionDevelopmentPath
,
!
platform
.
isLinux
/* ignorecase */
))
{
return
window
;
}
}
...
...
src/vs/editor/contrib/smartSelect/tokenSelectionSupport.ts
浏览文件 @
fec1775a
...
...
@@ -7,14 +7,14 @@ import { URI } from 'vs/base/common/uri';
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
ITextModel
}
from
'
vs/editor/common/model
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
Node
,
build
,
find
}
from
'
./tokenTree
'
;
import
{
build
,
find
}
from
'
./tokenTree
'
;
import
{
Position
}
from
'
vs/editor/common/core/position
'
;
/**
* Interface used to compute a hierachry of logical ranges.
*/
export
interface
ILogicalSelectionEntry
{
type
:
string
;
type
?
:
string
;
range
:
Range
;
}
...
...
@@ -45,10 +45,9 @@ export class TokenSelectionSupport {
private
_doGetRangesToPosition
(
model
:
ITextModel
,
position
:
Position
):
Range
[]
{
let
tree
=
build
(
model
);
let
node
:
Node
;
let
lastRange
:
Range
;
let
lastRange
:
Range
|
undefined
;
node
=
find
(
tree
,
position
);
let
node
=
find
(
tree
,
position
);
let
ranges
:
Range
[]
=
[];
while
(
node
)
{
if
(
!
lastRange
||
!
Range
.
equalsRange
(
lastRange
,
node
.
range
))
{
...
...
src/vs/platform/driver/node/driver.ts
浏览文件 @
fec1775a
...
...
@@ -86,7 +86,7 @@ export class DriverChannel implements IDriverChannel {
case
'
writeInTerminal
'
:
return
this
.
driver
.
writeInTerminal
(
arg
[
0
],
arg
[
1
],
arg
[
2
]);
}
return
undefined
;
throw
new
Error
(
`Call not found:
${
command
}
`
)
;
}
}
...
...
@@ -178,7 +178,7 @@ export class WindowDriverRegistryChannel implements IWindowDriverRegistryChannel
case
'
reloadWindowDriver
'
:
return
this
.
registry
.
reloadWindowDriver
(
arg
);
}
return
undefined
;
throw
new
Error
(
`Call not found:
${
command
}
`
)
;
}
}
...
...
@@ -243,7 +243,7 @@ export class WindowDriverChannel implements IWindowDriverChannel {
case
'
writeInTerminal
'
:
return
this
.
driver
.
writeInTerminal
(
arg
[
0
],
arg
[
1
]);
}
return
undefined
;
throw
new
Error
(
`Call not found:
${
command
}
`
)
;
}
}
...
...
src/vs/platform/workspaces/common/workspaces.ts
浏览文件 @
fec1775a
...
...
@@ -85,9 +85,9 @@ export interface IWorkspacesMainService extends IWorkspacesService {
createWorkspaceSync
(
folders
?:
IWorkspaceFolderCreationData
[]):
IWorkspaceIdentifier
;
resolveWorkspace
(
path
:
string
):
TPromise
<
IResolvedWorkspace
>
;
resolveWorkspace
(
path
:
string
):
TPromise
<
IResolvedWorkspace
|
null
>
;
resolveWorkspaceSync
(
path
:
string
):
IResolvedWorkspace
;
resolveWorkspaceSync
(
path
:
string
):
IResolvedWorkspace
|
null
;
isUntitledWorkspace
(
workspace
:
IWorkspaceIdentifier
):
boolean
;
...
...
src/vs/platform/workspaces/electron-main/workspacesMainService.ts
浏览文件 @
fec1775a
...
...
@@ -50,7 +50,7 @@ export class WorkspacesMainService extends Disposable implements IWorkspacesMain
this
.
workspacesHome
=
environmentService
.
workspacesHome
;
}
resolveWorkspace
(
path
:
string
):
TPromise
<
IResolvedWorkspace
>
{
resolveWorkspace
(
path
:
string
):
TPromise
<
IResolvedWorkspace
|
null
>
{
if
(
!
this
.
isWorkspacePath
(
path
))
{
return
TPromise
.
as
(
null
);
// does not look like a valid workspace config file
}
...
...
@@ -58,7 +58,7 @@ export class WorkspacesMainService extends Disposable implements IWorkspacesMain
return
readFile
(
path
,
'
utf8
'
).
then
(
contents
=>
this
.
doResolveWorkspace
(
path
,
contents
));
}
resolveWorkspaceSync
(
path
:
string
):
IResolvedWorkspace
{
resolveWorkspaceSync
(
path
:
string
):
IResolvedWorkspace
|
null
{
if
(
!
this
.
isWorkspacePath
(
path
))
{
return
null
;
// does not look like a valid workspace config file
}
...
...
@@ -77,7 +77,7 @@ export class WorkspacesMainService extends Disposable implements IWorkspacesMain
return
this
.
isInsideWorkspacesHome
(
path
)
||
extname
(
path
)
===
`.
${
WORKSPACE_EXTENSION
}
`
;
}
private
doResolveWorkspace
(
path
:
string
,
contents
:
string
):
IResolvedWorkspace
{
private
doResolveWorkspace
(
path
:
string
,
contents
:
string
):
IResolvedWorkspace
|
null
{
try
{
const
workspace
=
this
.
doParseStoredWorkspace
(
path
,
contents
);
...
...
src/vs/workbench/parts/cli/electron-browser/cli.contribution.ts
浏览文件 @
fec1775a
...
...
@@ -20,7 +20,7 @@ import Severity from 'vs/base/common/severity';
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
getPathFromAmdModule
}
from
'
vs/base/common/amd
'
;
function
ignore
<
T
>
(
code
:
string
,
value
:
T
|
null
=
null
):
(
err
:
any
)
=>
Promise
<
T
>
{
function
ignore
<
T
>
(
code
:
string
,
value
:
T
):
(
err
:
any
)
=>
Promise
<
T
>
{
return
err
=>
err
.
code
===
code
?
Promise
.
resolve
<
T
>
(
value
)
:
Promise
.
reject
<
T
>
(
err
);
}
...
...
@@ -70,7 +70,7 @@ class InstallAction extends Action {
return
Promise
.
resolve
(
null
);
}
else
{
return
pfs
.
unlink
(
this
.
target
)
.
then
(
null
,
ignore
(
'
ENOENT
'
))
.
then
(
null
,
ignore
(
'
ENOENT
'
,
null
))
.
then
(()
=>
pfs
.
symlink
(
getSource
(),
this
.
target
))
.
then
(
null
,
err
=>
{
if
(
err
.
code
===
'
EACCES
'
||
err
.
code
===
'
ENOENT
'
)
{
...
...
@@ -147,7 +147,7 @@ class UninstallAction extends Action {
const
uninstall
=
()
=>
{
return
pfs
.
unlink
(
this
.
target
)
.
then
(
null
,
ignore
(
'
ENOENT
'
));
.
then
(
null
,
ignore
(
'
ENOENT
'
,
null
));
};
return
uninstall
().
then
(
null
,
err
=>
{
...
...
src/vs/workbench/parts/execution/electron-browser/terminal.ts
浏览文件 @
fec1775a
...
...
@@ -11,7 +11,7 @@ export function getDefaultTerminalLinuxReady(): Promise<string> {
if
(
!
_DEFAULT_TERMINAL_LINUX_READY
)
{
_DEFAULT_TERMINAL_LINUX_READY
=
new
Promise
<
string
>
(
c
=>
{
if
(
env
.
isLinux
)
{
Promise
.
all
([
pfs
.
exists
(
'
/etc/debian_version
'
),
process
.
lazyEnv
]).
then
(([
isDebian
])
=>
{
Promise
.
all
([
pfs
.
exists
(
'
/etc/debian_version
'
),
process
.
lazyEnv
||
Promise
.
resolve
(
void
0
)
]).
then
(([
isDebian
])
=>
{
if
(
isDebian
)
{
c
(
'
x-terminal-emulator
'
);
}
else
if
(
process
.
env
.
DESKTOP_SESSION
===
'
gnome
'
||
process
.
env
.
DESKTOP_SESSION
===
'
gnome-classic
'
)
{
...
...
src/vs/workbench/parts/terminal/node/terminalProcess.ts
浏览文件 @
fec1775a
...
...
@@ -37,7 +37,7 @@ export class TerminalProcess implements ITerminalChildProcess, IDisposable {
)
{
let
shellName
:
string
;
if
(
os
.
platform
()
===
'
win32
'
)
{
shellName
=
path
.
basename
(
shellLaunchConfig
.
executable
);
shellName
=
path
.
basename
(
shellLaunchConfig
.
executable
||
''
);
}
else
{
// Using 'xterm-256color' here helps ensure that the majority of Linux distributions will use a
// color prompt as defined in the default ~/.bashrc file.
...
...
@@ -53,7 +53,7 @@ export class TerminalProcess implements ITerminalChildProcess, IDisposable {
};
try
{
this
.
_ptyProcess
=
pty
.
spawn
(
shellLaunchConfig
.
executable
,
shellLaunchConfig
.
args
,
options
);
this
.
_ptyProcess
=
pty
.
spawn
(
shellLaunchConfig
.
executable
!
,
shellLaunchConfig
.
args
||
[]
,
options
);
this
.
_processStartupComplete
=
new
Promise
<
void
>
(
c
=>
{
this
.
onProcessIdReady
((
pid
)
=>
{
c
();
...
...
src/vs/workbench/services/search/node/legacy/worker/searchWorkerIpc.ts
浏览文件 @
fec1775a
...
...
@@ -51,7 +51,7 @@ export class SearchWorkerChannel implements ISearchWorkerChannel {
case
'
search
'
:
return
this
.
worker
.
search
(
arg
);
case
'
cancel
'
:
return
this
.
worker
.
cancel
();
}
return
undefined
;
throw
new
Error
(
`Call not found:
${
command
}
`
)
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录