Skip to content

Commit f387815

Browse files
Fix tag parse language status item UI (#11354)
1 parent c873aa1 commit f387815

File tree

3 files changed

+305
-322
lines changed

3 files changed

+305
-322
lines changed

Extension/src/LanguageServer/client.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,6 @@ interface InitializationOptions {
552552

553553
interface TagParseStatus {
554554
localizeStringParams: LocalizeStringParams;
555-
isPausable: boolean;
556555
isPaused: boolean;
557556
}
558557

@@ -636,7 +635,6 @@ class ClientModel {
636635
public isInitializingWorkspace: DataBinding<boolean>;
637636
public isIndexingWorkspace: DataBinding<boolean>;
638637
public isParsingWorkspace: DataBinding<boolean>;
639-
public isParsingWorkspacePausable: DataBinding<boolean>;
640638
public isParsingWorkspacePaused: DataBinding<boolean>;
641639
public isParsingFiles: DataBinding<boolean>;
642640
public isUpdatingIntelliSense: DataBinding<boolean>;
@@ -652,7 +650,6 @@ class ClientModel {
652650
this.isInitializingWorkspace = new DataBinding<boolean>(false);
653651
this.isIndexingWorkspace = new DataBinding<boolean>(false);
654652
this.isParsingWorkspace = new DataBinding<boolean>(false);
655-
this.isParsingWorkspacePausable = new DataBinding<boolean>(false);
656653
this.isParsingWorkspacePaused = new DataBinding<boolean>(false);
657654
this.isParsingFiles = new DataBinding<boolean>(false);
658655
this.isUpdatingIntelliSense = new DataBinding<boolean>(false);
@@ -669,7 +666,6 @@ class ClientModel {
669666
this.isInitializingWorkspace.activate();
670667
this.isIndexingWorkspace.activate();
671668
this.isParsingWorkspace.activate();
672-
this.isParsingWorkspacePausable.activate();
673669
this.isParsingWorkspacePaused.activate();
674670
this.isParsingFiles.activate();
675671
this.isUpdatingIntelliSense.activate();
@@ -686,7 +682,6 @@ class ClientModel {
686682
this.isInitializingWorkspace.deactivate();
687683
this.isIndexingWorkspace.deactivate();
688684
this.isParsingWorkspace.deactivate();
689-
this.isParsingWorkspacePausable.deactivate();
690685
this.isParsingWorkspacePaused.deactivate();
691686
this.isParsingFiles.deactivate();
692687
this.isUpdatingIntelliSense.deactivate();
@@ -703,7 +698,6 @@ class ClientModel {
703698
this.isInitializingWorkspace.dispose();
704699
this.isIndexingWorkspace.dispose();
705700
this.isParsingWorkspace.dispose();
706-
this.isParsingWorkspacePausable.dispose();
707701
this.isParsingWorkspacePaused.dispose();
708702
this.isParsingFiles.dispose();
709703
this.isUpdatingIntelliSense.dispose();
@@ -723,7 +717,6 @@ export interface Client {
723717
InitializingWorkspaceChanged: vscode.Event<boolean>;
724718
IndexingWorkspaceChanged: vscode.Event<boolean>;
725719
ParsingWorkspaceChanged: vscode.Event<boolean>;
726-
ParsingWorkspacePausableChanged: vscode.Event<boolean>;
727720
ParsingWorkspacePausedChanged: vscode.Event<boolean>;
728721
ParsingFilesChanged: vscode.Event<boolean>;
729722
IntelliSenseParsingChanged: vscode.Event<boolean>;
@@ -778,7 +771,6 @@ export interface Client {
778771
CancelCodeAnalysis(): void;
779772
handleConfigurationSelectCommand(): Promise<void>;
780773
handleConfigurationProviderSelectCommand(): Promise<void>;
781-
handleShowParsingCommands(): Promise<void>;
782774
handleShowActiveCodeAnalysisCommands(): Promise<void>;
783775
handleShowIdleCodeAnalysisCommands(): Promise<void>;
784776
handleReferencesIcon(): void;
@@ -865,7 +857,6 @@ export class DefaultClient implements Client {
865857
public get InitializingWorkspaceChanged(): vscode.Event<boolean> { return this.model.isInitializingWorkspace.ValueChanged; }
866858
public get IndexingWorkspaceChanged(): vscode.Event<boolean> { return this.model.isIndexingWorkspace.ValueChanged; }
867859
public get ParsingWorkspaceChanged(): vscode.Event<boolean> { return this.model.isParsingWorkspace.ValueChanged; }
868-
public get ParsingWorkspacePausableChanged(): vscode.Event<boolean> { return this.model.isParsingWorkspacePausable.ValueChanged; }
869860
public get ParsingWorkspacePausedChanged(): vscode.Event<boolean> { return this.model.isParsingWorkspacePaused.ValueChanged; }
870861
public get ParsingFilesChanged(): vscode.Event<boolean> { return this.model.isParsingFiles.ValueChanged; }
871862
public get IntelliSenseParsingChanged(): vscode.Event<boolean> { return this.model.isUpdatingIntelliSense.ValueChanged; }
@@ -2536,7 +2527,6 @@ export class DefaultClient implements Client {
25362527
this.model.isParsingWorkspace.Value = true;
25372528
this.model.isInitializingWorkspace.Value = false;
25382529
this.model.isIndexingWorkspace.Value = false;
2539-
this.model.isParsingWorkspacePausable.Value = false;
25402530
const status: IntelliSenseStatus = { status: Status.TagParsingBegun };
25412531
testHook.updateStatus(status);
25422532
} else if (message.endsWith("Initializing")) {
@@ -2632,7 +2622,6 @@ export class DefaultClient implements Client {
26322622

26332623
private updateTagParseStatus(tagParseStatus: TagParseStatus): void {
26342624
this.model.parsingWorkspaceStatus.Value = getLocalizedString(tagParseStatus.localizeStringParams);
2635-
this.model.isParsingWorkspacePausable.Value = tagParseStatus.isPausable;
26362625
this.model.isParsingWorkspacePaused.Value = tagParseStatus.isPaused;
26372626
}
26382627

@@ -3313,16 +3302,6 @@ export class DefaultClient implements Client {
33133302
}
33143303
}
33153304

3316-
public async handleShowParsingCommands(): Promise<void> {
3317-
await this.ready;
3318-
const index: number = await ui.showParsingCommands();
3319-
if (index === 0) {
3320-
return this.pauseParsing();
3321-
} else if (index === 1) {
3322-
return this.resumeParsing();
3323-
}
3324-
}
3325-
33263305
public async handleShowActiveCodeAnalysisCommands(): Promise<void> {
33273306
await this.ready;
33283307
const index: number = await ui.showActiveCodeAnalysisCommands();
@@ -3781,7 +3760,6 @@ class NullClient implements Client {
37813760
public get InitializingWorkspaceChanged(): vscode.Event<boolean> { return this.booleanEvent.event; }
37823761
public get IndexingWorkspaceChanged(): vscode.Event<boolean> { return this.booleanEvent.event; }
37833762
public get ParsingWorkspaceChanged(): vscode.Event<boolean> { return this.booleanEvent.event; }
3784-
public get ParsingWorkspacePausableChanged(): vscode.Event<boolean> { return this.booleanEvent.event; }
37853763
public get ParsingWorkspacePausedChanged(): vscode.Event<boolean> { return this.booleanEvent.event; }
37863764
public get ParsingFilesChanged(): vscode.Event<boolean> { return this.booleanEvent.event; }
37873765
public get IntelliSenseParsingChanged(): vscode.Event<boolean> { return this.booleanEvent.event; }
@@ -3835,7 +3813,6 @@ class NullClient implements Client {
38353813
CancelCodeAnalysis(): void { }
38363814
handleConfigurationSelectCommand(): Promise<void> { return Promise.resolve(); }
38373815
handleConfigurationProviderSelectCommand(): Promise<void> { return Promise.resolve(); }
3838-
handleShowParsingCommands(): Promise<void> { return Promise.resolve(); }
38393816
handleShowActiveCodeAnalysisCommands(): Promise<void> { return Promise.resolve(); }
38403817
handleShowIdleCodeAnalysisCommands(): Promise<void> { return Promise.resolve(); }
38413818
handleReferencesIcon(): void { }

Extension/src/LanguageServer/extension.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,6 @@ export function registerCommands(enabled: boolean): void {
403403
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.PauseCodeAnalysis', enabled ? onPauseCodeAnalysis : onDisabledCommand));
404404
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ResumeCodeAnalysis', enabled ? onResumeCodeAnalysis : onDisabledCommand));
405405
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.CancelCodeAnalysis', enabled ? onCancelCodeAnalysis : onDisabledCommand));
406-
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ShowParsingCommands', enabled ? onShowParsingCommands : onDisabledCommand));
407406
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ShowActiveCodeAnalysisCommands', enabled ? onShowActiveCodeAnalysisCommands : onDisabledCommand));
408407
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ShowIdleCodeAnalysisCommands', enabled ? onShowIdleCodeAnalysisCommands : onDisabledCommand));
409408
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ShowReferencesProgress', enabled ? onShowReferencesProgress : onDisabledCommand));
@@ -743,10 +742,6 @@ function onCancelCodeAnalysis(): void {
743742
clients.ActiveClient.CancelCodeAnalysis();
744743
}
745744

746-
function onShowParsingCommands(): Promise<void> {
747-
return clients.ActiveClient.handleShowParsingCommands();
748-
}
749-
750745
function onShowActiveCodeAnalysisCommands(): Promise<void> {
751746
return clients.ActiveClient.handleShowActiveCodeAnalysisCommands();
752747
}

0 commit comments

Comments
 (0)