diff options
author | Sahandevs <[email protected]> | 2021-02-07 17:45:13 +0000 |
---|---|---|
committer | Sahandevs <[email protected]> | 2021-02-07 17:45:13 +0000 |
commit | 06c02021a3d4a4d27d7c58bf54757588a28653cc (patch) | |
tree | 1c3950ceee8a81814d44729d0e333f757ed5d106 /editors/code/src | |
parent | 336909b63a14b801520c6627d90d750babcfe280 (diff) |
remove unnecessary
Diffstat (limited to 'editors/code/src')
-rw-r--r-- | editors/code/src/client.ts | 2 | ||||
-rw-r--r-- | editors/code/src/debug.ts | 6 | ||||
-rw-r--r-- | editors/code/src/run.ts | 2 | ||||
-rw-r--r-- | editors/code/src/snippets.ts | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts index 539e487ec..e436eefb9 100644 --- a/editors/code/src/client.ts +++ b/editors/code/src/client.ts | |||
@@ -11,7 +11,7 @@ export interface Env { | |||
11 | } | 11 | } |
12 | 12 | ||
13 | function renderCommand(cmd: ra.CommandLink) { | 13 | function renderCommand(cmd: ra.CommandLink) { |
14 | return `[${cmd.title}](command:${cmd.command}?${encodeURIComponent(JSON.stringify(cmd.arguments))} '${cmd.tooltip!}')`; | 14 | return `[${cmd.title}](command:${cmd.command}?${encodeURIComponent(JSON.stringify(cmd.arguments))} '${cmd.tooltip}')`; |
15 | } | 15 | } |
16 | 16 | ||
17 | function renderHoverActions(actions: ra.CommandLinkGroup[]): vscode.MarkdownString { | 17 | function renderHoverActions(actions: ra.CommandLinkGroup[]): vscode.MarkdownString { |
diff --git a/editors/code/src/debug.ts b/editors/code/src/debug.ts index 925126a16..874b858d9 100644 --- a/editors/code/src/debug.ts +++ b/editors/code/src/debug.ts | |||
@@ -87,11 +87,11 @@ async function getDebugConfiguration(ctx: Ctx, runnable: ra.Runnable): Promise<v | |||
87 | debugOutput.show(true); | 87 | debugOutput.show(true); |
88 | } | 88 | } |
89 | 89 | ||
90 | const isMultiFolderWorkspace = vscode.workspace.workspaceFolders!.length > 1; | 90 | const isMultiFolderWorkspace = vscode.workspace.workspaceFolders.length > 1; |
91 | const firstWorkspace = vscode.workspace.workspaceFolders![0]; // folder exists or RA is not active. | 91 | const firstWorkspace = vscode.workspace.workspaceFolders[0]; // folder exists or RA is not active. |
92 | const workspace = !isMultiFolderWorkspace || !runnable.args.workspaceRoot ? | 92 | const workspace = !isMultiFolderWorkspace || !runnable.args.workspaceRoot ? |
93 | firstWorkspace : | 93 | firstWorkspace : |
94 | vscode.workspace.workspaceFolders!.find(w => runnable.args.workspaceRoot?.includes(w.uri.fsPath)) || firstWorkspace; | 94 | vscode.workspace.workspaceFolders.find(w => runnable.args.workspaceRoot?.includes(w.uri.fsPath)) || firstWorkspace; |
95 | 95 | ||
96 | const wsFolder = path.normalize(workspace.uri.fsPath); | 96 | const wsFolder = path.normalize(workspace.uri.fsPath); |
97 | const workspaceQualifier = isMultiFolderWorkspace ? `:${workspace.name}` : ''; | 97 | const workspaceQualifier = isMultiFolderWorkspace ? `:${workspace.name}` : ''; |
diff --git a/editors/code/src/run.ts b/editors/code/src/run.ts index 17573cd82..77f9a0991 100644 --- a/editors/code/src/run.ts +++ b/editors/code/src/run.ts | |||
@@ -145,7 +145,7 @@ export async function createTask(runnable: ra.Runnable, config: Config): Promise | |||
145 | overrideCargo: runnable.args.overrideCargo, | 145 | overrideCargo: runnable.args.overrideCargo, |
146 | }; | 146 | }; |
147 | 147 | ||
148 | const target = vscode.workspace.workspaceFolders![0]; // safe, see main activate() | 148 | const target = vscode.workspace.workspaceFolders[0]; // safe, see main activate() |
149 | const cargoTask = await tasks.buildCargoTask(target, definition, runnable.label, args, config.cargoRunner, true); | 149 | const cargoTask = await tasks.buildCargoTask(target, definition, runnable.label, args, config.cargoRunner, true); |
150 | cargoTask.presentationOptions.clear = true; | 150 | cargoTask.presentationOptions.clear = true; |
151 | 151 | ||
diff --git a/editors/code/src/snippets.ts b/editors/code/src/snippets.ts index fee736e7d..7b7e528f6 100644 --- a/editors/code/src/snippets.ts +++ b/editors/code/src/snippets.ts | |||
@@ -62,7 +62,7 @@ function parseSnippet(snip: string): [string, [number, number]] | undefined { | |||
62 | const m = snip.match(/\$(0|\{0:([^}]*)\})/); | 62 | const m = snip.match(/\$(0|\{0:([^}]*)\})/); |
63 | if (!m) return undefined; | 63 | if (!m) return undefined; |
64 | const placeholder = m[2] ?? ""; | 64 | const placeholder = m[2] ?? ""; |
65 | const range: [number, number] = [m.index!!, placeholder.length]; | 65 | const range: [number, number] = [m.index, placeholder.length]; |
66 | const insert = snip.replace(m[0], placeholder); | 66 | const insert = snip.replace(m[0], placeholder); |
67 | return [insert, range]; | 67 | return [insert, range]; |
68 | } | 68 | } |