(silent = false)
| 173 | } |
| 174 | |
| 175 | public async start(silent = false): Promise<string | undefined> { |
| 176 | |
| 177 | if (!this.devtoolsUrl) { |
| 178 | this.setNotStartedStatusBar(); |
| 179 | |
| 180 | // Ignore silent flag if we're using a custom DevTools, because it could |
| 181 | // take much longer to start and won't be obvious why launching isn't working. |
| 182 | const isCustomDevTools = !!config.customDevTools?.path; |
| 183 | const startingTitle = isCustomDevTools ? "Starting Custom Dart DevTools…" : "Starting Dart DevTools…"; |
| 184 | if (silent && !isCustomDevTools) { |
| 185 | this.devtoolsUrl = this.startServer(); |
| 186 | } else { |
| 187 | this.devtoolsUrl = Promise.resolve(vs.window.withProgress({ |
| 188 | location: vs.ProgressLocation.Notification, |
| 189 | title: startingTitle, |
| 190 | }, async () => this.startServer())); |
| 191 | } |
| 192 | |
| 193 | // Allow us to override the URL for DevTools as a simple hack for running from a |
| 194 | // dev version without having to have the SDK set up. |
| 195 | if (config.customDevToolsUri) |
| 196 | this.devtoolsUrl = Promise.resolve(config.customDevToolsUri); |
| 197 | |
| 198 | // Trigger a reload of any existing embedded windows. |
| 199 | this.reloadEmbeddedViews(); |
| 200 | } |
| 201 | |
| 202 | const url = await this.devtoolsUrl; |
| 203 | |
| 204 | this.setStartedStatusBar(url); |
| 205 | |
| 206 | return url; |
| 207 | } |
| 208 | |
| 209 | public getDevToolsLocation(pageId: string | undefined | null): DevToolsLocation { |
| 210 | if (pageId === null) |
no test coverage detected