Skip to content

Commit fafca55

Browse files
authored
Fix loc issue with handling of ReportTagParseStatus (#10438)
1 parent 2605cac commit fafca55

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

Extension/src/LanguageServer/client.ts

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,12 @@ interface InitializationOptions {
532532
settings: SettingsParams;
533533
};
534534

535+
interface TagParseStatus {
536+
localizeStringParams: LocalizeStringParams;
537+
isPausable: boolean;
538+
isPaused: boolean;
539+
}
540+
535541
// Requests
536542
const QueryCompilerDefaultsRequest: RequestType<QueryDefaultCompilerParams, configs.CompilerDefaults, void> = new RequestType<QueryDefaultCompilerParams, configs.CompilerDefaults, void>('cpptools/queryCompilerDefaults');
537543
const QueryTranslationUnitSourceRequest: RequestType<QueryTranslationUnitSourceParams, QueryTranslationUnitSourceResult, void> = new RequestType<QueryTranslationUnitSourceParams, QueryTranslationUnitSourceResult, void>('cpptools/queryTranslationUnitSource');
@@ -586,7 +592,7 @@ const RemoveCodeAnalysisProblemsNotification: NotificationType<RemoveCodeAnalysi
586592
const ReloadWindowNotification: NotificationType<void> = new NotificationType<void>('cpptools/reloadWindow');
587593
const UpdateTrustedCompilersNotification: NotificationType<UpdateTrustedCompilerPathsResult> = new NotificationType<UpdateTrustedCompilerPathsResult>('cpptools/updateTrustedCompilersList');
588594
const LogTelemetryNotification: NotificationType<TelemetryPayload> = new NotificationType<TelemetryPayload>('cpptools/logTelemetry');
589-
const ReportTagParseStatusNotification: NotificationType<LocalizeStringParams> = new NotificationType<LocalizeStringParams>('cpptools/reportTagParseStatus');
595+
const ReportTagParseStatusNotification: NotificationType<TagParseStatus> = new NotificationType<TagParseStatus>('cpptools/reportTagParseStatus');
590596
const ReportStatusNotification: NotificationType<ReportStatusNotificationBody> = new NotificationType<ReportStatusNotificationBody>('cpptools/reportStatus');
591597
const DebugProtocolNotification: NotificationType<DebugProtocolParams> = new NotificationType<DebugProtocolParams>('cpptools/debugProtocol');
592598
const DebugLogNotification: NotificationType<LocalizeStringParams> = new NotificationType<LocalizeStringParams>('cpptools/debugLog');
@@ -2317,18 +2323,10 @@ export class DefaultClient implements Client {
23172323
}
23182324
}
23192325

2320-
private updateTagParseStatus(notificationBody: LocalizeStringParams): void {
2321-
this.model.parsingWorkspaceStatus.Value = getLocalizedString(notificationBody);
2322-
if (notificationBody.text.startsWith("Workspace parsing paused")) {
2323-
this.model.isParsingWorkspacePaused.Value = true;
2324-
this.model.isParsingWorkspacePausable.Value = true;
2325-
} else if (notificationBody.text.startsWith("Parsing workspace")) {
2326-
this.model.isParsingWorkspacePaused.Value = false;
2327-
this.model.isParsingWorkspacePausable.Value = true;
2328-
} else {
2329-
this.model.isParsingWorkspacePaused.Value = false;
2330-
this.model.isParsingWorkspacePausable.Value = false;
2331-
}
2326+
private updateTagParseStatus(tagParseStatus: TagParseStatus): void {
2327+
this.model.parsingWorkspaceStatus.Value = getLocalizedString(tagParseStatus.localizeStringParams);
2328+
this.model.isParsingWorkspacePausable.Value = tagParseStatus.isPausable;
2329+
this.model.isParsingWorkspacePaused.Value = tagParseStatus.isPaused;
23322330
}
23332331

23342332
private updateInactiveRegions(params: InactiveRegionParams): void {

0 commit comments

Comments
 (0)