mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 18:19:12 +01:00
Annotate more usage before assign strict null errors
This commit is contained in:
@@ -233,7 +233,7 @@ function convertFromCommentThread(commentThread: modes.CommentThread): vscode.Co
|
||||
}
|
||||
|
||||
function convertFromComment(comment: modes.Comment): vscode.Comment {
|
||||
let userIconPath: URI;
|
||||
let userIconPath: URI | undefined;
|
||||
if (comment.userIconPath) {
|
||||
try {
|
||||
userIconPath = URI.parse(comment.userIconPath);
|
||||
|
||||
@@ -363,7 +363,7 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
|
||||
if (!this._variableResolver) {
|
||||
this._variableResolver = new ExtHostVariableResolverService(workspaceProvider, this._editorsService, configProvider);
|
||||
}
|
||||
let ws: IWorkspaceFolder;
|
||||
let ws: IWorkspaceFolder | undefined;
|
||||
const folder = this.getFolder(folderUri, workspaceProvider);
|
||||
if (folder) {
|
||||
ws = {
|
||||
|
||||
@@ -120,7 +120,7 @@ export class DiagnosticCollection implements vscode.DiagnosticCollection {
|
||||
// compute change and send to main side
|
||||
const entries: [URI, IMarkerData[]][] = [];
|
||||
for (let uri of toSync) {
|
||||
let marker: IMarkerData[];
|
||||
let marker: IMarkerData[] | undefined;
|
||||
let diagnostics = this._data.get(uri.toString());
|
||||
if (diagnostics) {
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import * as typeConverter from 'vs/workbench/api/node/extHostTypeConverters';
|
||||
import { ExtHostLanguageFeatures } from 'vs/workbench/api/node/extHostLanguageFeatures';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
import { ResourceLabelFormatter } from 'vs/platform/label/common/label';
|
||||
import { State, StateMachine, LinkComputer } from 'vs/editor/common/modes/linkComputer';
|
||||
import { State, StateMachine, LinkComputer, Edge } from 'vs/editor/common/modes/linkComputer';
|
||||
import { commonPrefixLength } from 'vs/base/common/strings';
|
||||
import { CharCode } from 'vs/base/common/charCode';
|
||||
|
||||
@@ -41,8 +41,8 @@ class FsLinkProvider {
|
||||
// sort and compute common prefix with previous scheme
|
||||
// then build state transitions based on the data
|
||||
const schemes = this._schemes.sort();
|
||||
const edges = [];
|
||||
let prevScheme: string;
|
||||
const edges: Edge[] = [];
|
||||
let prevScheme: string | undefined;
|
||||
let prevState: State;
|
||||
let nextState = State.LastKnownState;
|
||||
for (const scheme of schemes) {
|
||||
@@ -178,7 +178,7 @@ export class ExtHostFileSystem implements ExtHostFileSystemShape {
|
||||
// dropping events for wrong scheme
|
||||
continue;
|
||||
}
|
||||
let newType: files.FileChangeType;
|
||||
let newType: files.FileChangeType | undefined;
|
||||
switch (type) {
|
||||
case FileChangeType.Changed:
|
||||
newType = files.FileChangeType.UPDATED;
|
||||
|
||||
@@ -150,7 +150,7 @@ namespace ShellExecutionDTO {
|
||||
|
||||
namespace TaskHandleDTO {
|
||||
export function from(value: types.Task): TaskHandleDTO {
|
||||
let folder: UriComponents;
|
||||
let folder: UriComponents | undefined;
|
||||
if (value.scope !== undefined && typeof value.scope !== 'number') {
|
||||
folder = value.scope.uri;
|
||||
}
|
||||
@@ -181,7 +181,7 @@ namespace TaskDTO {
|
||||
if (value === undefined || value === null) {
|
||||
return undefined;
|
||||
}
|
||||
let execution: ShellExecutionDTO | ProcessExecutionDTO;
|
||||
let execution: ShellExecutionDTO | ProcessExecutionDTO | undefined;
|
||||
if (value.execution instanceof types.ProcessExecution) {
|
||||
execution = ProcessExecutionDTO.from(value.execution);
|
||||
} else if (value.execution instanceof types.ShellExecution) {
|
||||
@@ -226,14 +226,14 @@ namespace TaskDTO {
|
||||
if (value === undefined || value === null) {
|
||||
return undefined;
|
||||
}
|
||||
let execution: types.ShellExecution | types.ProcessExecution;
|
||||
let execution: types.ShellExecution | types.ProcessExecution | undefined;
|
||||
if (ProcessExecutionDTO.is(value.execution)) {
|
||||
execution = ProcessExecutionDTO.to(value.execution);
|
||||
} else if (ShellExecutionDTO.is(value.execution)) {
|
||||
execution = ShellExecutionDTO.to(value.execution);
|
||||
}
|
||||
let definition: vscode.TaskDefinition = TaskDefinitionDTO.to(value.definition);
|
||||
let scope: vscode.TaskScope.Global | vscode.TaskScope.Workspace | vscode.WorkspaceFolder;
|
||||
let scope: vscode.TaskScope.Global | vscode.TaskScope.Workspace | vscode.WorkspaceFolder | undefined;
|
||||
if (value.source) {
|
||||
if (value.source.scope !== undefined) {
|
||||
if (typeof value.source.scope === 'number') {
|
||||
|
||||
Reference in New Issue
Block a user