()
| 323 | } |
| 324 | |
| 325 | private getFormatterSetting(): string { |
| 326 | try { |
| 327 | // If there are multiple formatters for Dart, the user can select one, so check |
| 328 | // that first so we don't record their formatter being enabled as ours. |
| 329 | const otherDefaultFormatter = config.resolved.getAppliedConfig<string | undefined>("editor", "defaultFormatter", false); |
| 330 | if (otherDefaultFormatter && otherDefaultFormatter !== dartCodeExtensionIdentifier) |
| 331 | return otherDefaultFormatter; |
| 332 | |
| 333 | // If the user has explicitly disabled ours (without having another selected |
| 334 | // then record that). |
| 335 | if (!config.enableSdkFormatter) |
| 336 | return "Disabled"; |
| 337 | |
| 338 | // Otherwise record as enabled (and whether on-save). |
| 339 | return config.resolved.getAppliedConfig("editor", "formatOnSave") |
| 340 | ? "Enabled on Save" |
| 341 | : "Enabled"; |
| 342 | } catch { |
| 343 | return "Unknown"; |
| 344 | } |
| 345 | } |
| 346 | |
| 347 | private handleError(e: unknown) { |
| 348 | this.disableAnalyticsForSession = true; |
no test coverage detected