Skip to content

Commit

Permalink
changed setting name from cmake.status to cmake.options and updated n…
Browse files Browse the repository at this point in the history
…otification
  • Loading branch information
snehara99 committed Nov 1, 2023
1 parent fb8727e commit 7f35a4a
Show file tree
Hide file tree
Showing 10 changed files with 206 additions and 206 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Improvements:
- If the "configure" button of CMakeLists.txt node in the Project Outline is clicked, only the corresponding project is configured. [PR #3372](https://github.com/microsoft/vscode-cmake-tools/pull/3372) [@vlavati](https://github.com/vlavati)
- Added a command to directly open the extension settings (`CMake: Open CMake Tools Extension Settings`) and a gear icon button in the Project Status View title bar that calls it. [PR #3403](https://github.com/microsoft/vscode-cmake-tools/pull/3403)
- Added an icon button in the Project Status View title bar that calls the `CMake: Delete Cache and Reconfigure` command. [PR #3403](https://github.com/microsoft/vscode-cmake-tools/pull/3403)
- By default, all of the status bar options are hidden except `build`, `debug`, and `launch`. All of the previous status bar options are now, by default, visible in the Project Status View. These visibility settings can be customized in the `cmake.status.advanced` setting. This setting can also be accessed via the Project Status View. The `cmake.useProjectStatusView` setting is now removed. [PR #3407](https://github.com/microsoft/vscode-cmake-tools/pull/3407)
- By default, all of the status bar options are hidden except `build`, `debug`, and `launch`. All of the previous status bar options are now, by default, visible in the Project Status View. These visibility settings can be customized in the `cmake.options.advanced` setting. This setting can also be accessed via the Project Status View. The `cmake.useProjectStatusView` setting is now removed. [PR #3407](https://github.com/microsoft/vscode-cmake-tools/pull/3407) & [PR #3417](https://github.com/microsoft/vscode-cmake-tools/pull/3417)

Bug Fixes:
- Fix Unhandled Exception if no args are specified in `cmake.getLaunchTargetFilename` inside an input context of a task. [PR #3348](https://github.com/microsoft/vscode-cmake-tools/issues/3348) [@vlavati](https://github.com/vlavati)
Expand Down
174 changes: 87 additions & 87 deletions package.json

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,34 +165,34 @@
"cmake-tools.configuration.cmake.touchbar.visibility.default.description": "Show Touch Bar buttons on supported systems.",
"cmake-tools.configuration.cmake.touchbar.visibility.hidden.description": "Do not show Touch Bar buttons.",
"cmake-tools.configuration.cmake.showOptionsMovedNotification": "Enables the notification regarding the status bar options moving to the Project Status View to show when the extension starts.",
"cmake-tools.configuration.cmake.status.advanced.statusBarVisibility.visible.description": "Show the status bar item at full size.",
"cmake-tools.configuration.cmake.status.advanced.statusBarVisibility.icon.description": "Show the status bar item's icon only.",
"cmake-tools.configuration.cmake.status.advanced.statusBarVisibility.compact.markdownDescription": "Show the status bar item with the text truncated to the length specified in `#cmake.status.advanced.statusBarLength#` (default is 20).",
"cmake-tools.configuration.cmake.status.advanced.statusBarVisibility.variantStatus.compact.description": "Show the status bar item with the status message removed.",
"cmake-tools.configuration.cmake.status.advanced.statusBarVisibility.hidden.description": "Hides the status bar item.",
"cmake-tools.configuration.cmake.status.advanced.projectStatusVisibility.visible.description": "Show the node in the Project Status View.",
"cmake-tools.configuration.cmake.status.advanced.projectStatusVisibility.hidden.description": "Hide the node and its children in the Project Status View.",
"cmake-tools.configuration.cmake.status.statusBarVisibility.markdownDescription": {
"message": "Configures how the extension displays the items in the Status Bar. These settings may be overwritten by the more specific `#cmake.status.advanced.statusBarVisibility#` setting. [More info](https://aka.ms/cmaketoolsoptionsconfiguration).",
"cmake-tools.configuration.cmake.options.advanced.statusBarVisibility.visible.description": "Show the status bar option at full size.",
"cmake-tools.configuration.cmake.options.advanced.statusBarVisibility.icon.description": "Show the status bar option's icon only.",
"cmake-tools.configuration.cmake.options.advanced.statusBarVisibility.compact.markdownDescription": "Show the status bar option with the text truncated to the length specified in `#cmake.status.advanced.statusBarLength#` (default is 20).",
"cmake-tools.configuration.cmake.options.advanced.statusBarVisibility.variantStatus.compact.description": "Show the status bar option with the status message removed.",
"cmake-tools.configuration.cmake.options.advanced.statusBarVisibility.hidden.description": "Hides the status bar option.",
"cmake-tools.configuration.cmake.options.advanced.projectStatusVisibility.visible.description": "Show the node in the Project Status View.",
"cmake-tools.configuration.cmake.options.advanced.projectStatusVisibility.hidden.description": "Hide the node and its children in the Project Status View.",
"cmake-tools.configuration.cmake.options.statusBarVisibility.markdownDescription": {
"message": "Configures how the extension displays the options in the Status Bar. These settings may be overwritten by the more specific `#cmake.options.advanced.statusBarVisibility#` setting. [More info](https://aka.ms/cmaketoolsoptionsconfiguration).",
"comment": [
"Markdown text between `` and () should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered."
]
},
"cmake-tools.configuration.cmake.status.advanced.statusBarVisibility.markdownDescription": {
"message": "Configures the settings for individual Status Bar items. These settings overwrite the more general `#cmake.status.statusBarVisibility#` setting.",
"cmake-tools.configuration.cmake.options.advanced.statusBarVisibility.markdownDescription": {
"message": "Configures the settings for individual status bar options. These settings overwrite the more general `#cmake.options.statusBarVisibility#` setting.",
"comment": [
"Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered."
]
},
"cmake-tools.configuration.cmake.status.advanced.markdownDescription": {
"message": "Configures the settings for individual Project Status View and Status Bar items. These settings may overwrite the more general `#cmake.status.statusBarVisibility#` setting. [More info](https://aka.ms/cmaketoolsoptionsconfiguration).",
"cmake-tools.configuration.cmake.options.advanced.markdownDescription": {
"message": "Configures the settings for individual Project Status View and status bar options. These settings may overwrite the more general `#cmake.options.statusBarVisibility#` setting. [More info](https://aka.ms/cmaketoolsoptionsconfiguration).",
"comment": [
"Markdown text between `` and () should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered."
]
},
"cmake-tools.configuration.cmake.status.advanced.projectStatusVisibility.description": "Configures how the extension displays this item the Project Status View.",
"cmake-tools.configuration.cmake.status.advanced.ctest.color.description": "Enables a change in color for this item depending on test results.",
"cmake-tools.configuration.cmake.status.advanced.statusBarLength.description": "Configures the maximum length of visible text in the Status Bar when set to 'compact' mode.",
"cmake-tools.configuration.cmake.options.advanced.projectStatusVisibility.description": "Configures how the extension displays this option the Project Status View.",
"cmake-tools.configuration.cmake.options.advanced.ctest.color.description": "Enables a change in color for this option depending on test results.",
"cmake-tools.configuration.cmake.options.advanced.statusBarLength.description": "Configures the maximum length of visible text in the Status Bar when set to 'compact' mode.",
"cmake-tools.configuration.views.cmake.folders.description": "Folders",
"cmake-tools.configuration.views.cmake.projectStatus.description": "Project Status",
"cmake-tools.configuration.views.cmake.outline.description": "Project Outline",
Expand Down
12 changes: 6 additions & 6 deletions src/cmakeProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import { VariantManager } from './variant';
import * as nls from 'vscode-nls';
import { ConfigurationWebview } from './cacheView';
import { enableFullFeatureSet, updateFullFeatureSet } from './extension';
import { CMakeCommunicationMode, ConfigurationReader, StatusConfig, UseCMakePresets } from './config';
import { CMakeCommunicationMode, ConfigurationReader, OptionConfig, UseCMakePresets } from './config';
import * as preset from '@cmt/preset';
import * as util from '@cmt/util';
import { Environment, EnvironmentUtils } from './environmentVariables';
Expand Down Expand Up @@ -914,7 +914,7 @@ export class CMakeProject {
private async init(sourceDirectory: string) {
log.debug(localize('second.phase.init', 'Starting CMake Tools second-phase init'));
await this.setSourceDir(await util.normalizeAndVerifySourceDir(sourceDirectory, CMakeDriver.sourceDirExpansionOptions(this.workspaceContext.folder.uri.fsPath)));
this.doStatusChange(this.workspaceContext.config.status);
this.doStatusChange(this.workspaceContext.config.options);
// Start up the variant manager
await this.variantManager.initialize(this.folderName);
// Set the status bar message
Expand Down Expand Up @@ -2825,10 +2825,10 @@ export class CMakeProject {
public hideDebugButton: boolean = false;
public hideLaunchButton: boolean = false;

doStatusChange(status: StatusConfig) {
this.hideBuildButton = (status?.advanced?.build?.statusBarVisibility === "hidden" && status?.advanced?.build?.projectStatusVisibility === "hidden") ? true : false;
this.hideDebugButton = (status?.advanced?.debug?.statusBarVisibility === "hidden" && status?.advanced?.debug?.projectStatusVisibility === "hidden") ? true : false;
this.hideLaunchButton = (status?.advanced?.launch?.statusBarVisibility === "hidden" && status?.advanced?.launch?.projectStatusVisibility === "hidden") ? true : false;
doStatusChange(options: OptionConfig) {
this.hideBuildButton = (options?.advanced?.build?.statusBarVisibility === "hidden" && options?.advanced?.build?.projectStatusVisibility === "hidden") ? true : false;
this.hideDebugButton = (options?.advanced?.debug?.statusBarVisibility === "hidden" && options?.advanced?.debug?.projectStatusVisibility === "hidden") ? true : false;
this.hideLaunchButton = (options?.advanced?.launch?.statusBarVisibility === "hidden" && options?.advanced?.launch?.projectStatusVisibility === "hidden") ? true : false;
}
}

Expand Down
90 changes: 45 additions & 45 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,92 +23,92 @@ const log = logging.createLogger('config');

export type LogLevelKey = 'trace' | 'debug' | 'info' | 'note' | 'warning' | 'error' | 'fatal';
export type CMakeCommunicationMode = 'legacy' | 'serverApi' | 'fileApi' | 'automatic';
export type StatusBarButtonVisibility = "visible" | "compact" | "icon" | "hidden";
export type StatusBarStaticButtonVisibility = "visible" | "icon" | "hidden";
export type StatusBarTextButtonVisibility = "visible" | "compact" | "hidden";
export type StatusBarIconButtonVisibility = "visible" | "hidden";
export type ProjectStatusButtonVisibility = "visible" | "hidden";
export type TouchBarButtonVisibility = "default" | "hidden";
export type StatusBarOptionVisibility = "visible" | "compact" | "icon" | "hidden";
export type StatusBarStaticOptionVisibility = "visible" | "icon" | "hidden";
export type StatusBarTextOptionVisibility = "visible" | "compact" | "hidden";
export type StatusBarIconOptionVisibility = "visible" | "hidden";
export type ProjectStatusOptionVisibility = "visible" | "hidden";
export type TouchBarOptionVisibility = "default" | "hidden";
export type UseCMakePresets = 'always' | 'never' | 'auto';

export interface AdvancedTouchBarConfig {
configure?: TouchBarButtonVisibility;
build?: TouchBarButtonVisibility;
debug?: TouchBarButtonVisibility;
launch?: TouchBarButtonVisibility;
configure?: TouchBarOptionVisibility;
build?: TouchBarOptionVisibility;
debug?: TouchBarOptionVisibility;
launch?: TouchBarOptionVisibility;
}

export interface TouchBarConfig {
advanced?: AdvancedTouchBarConfig;
visibility: TouchBarButtonVisibility;
visibility: TouchBarOptionVisibility;
}

export interface AdvancedStatusConfig {
export interface AdvancedOptionConfig {
configure?: {
projectStatusVisibility?: ProjectStatusButtonVisibility;
projectStatusVisibility?: ProjectStatusOptionVisibility;
};
configurePreset?: {
projectStatusVisibility?: ProjectStatusButtonVisibility;
statusBarVisibility?: StatusBarButtonVisibility;
projectStatusVisibility?: ProjectStatusOptionVisibility;
statusBarVisibility?: StatusBarOptionVisibility;
statusBarLength?: number;
};
buildPreset?: {
projectStatusVisibility?: ProjectStatusButtonVisibility;
statusBarVisibility?: StatusBarButtonVisibility;
projectStatusVisibility?: ProjectStatusOptionVisibility;
statusBarVisibility?: StatusBarOptionVisibility;
statusBarLength?: number;
};
testPreset?: {
projectStatusVisibility?: ProjectStatusButtonVisibility;
statusBarVisibility?: StatusBarButtonVisibility;
projectStatusVisibility?: ProjectStatusOptionVisibility;
statusBarVisibility?: StatusBarOptionVisibility;
statusBarLength?: number;
};
kit?: {
projectStatusVisibility?: ProjectStatusButtonVisibility;
statusBarVisibility?: StatusBarButtonVisibility;
projectStatusVisibility?: ProjectStatusOptionVisibility;
statusBarVisibility?: StatusBarOptionVisibility;
statusBarLength?: number;
};
variantStatus?: {
projectStatusVisibility?: ProjectStatusButtonVisibility;
statusBarVisibility?: StatusBarButtonVisibility;
variant?: {
projectStatusVisibility?: ProjectStatusOptionVisibility;
statusBarVisibility?: StatusBarOptionVisibility;
};
folder?: {
projectStatusVisibility?: ProjectStatusButtonVisibility;
statusBarVisibility?: StatusBarButtonVisibility;
projectStatusVisibility?: ProjectStatusOptionVisibility;
statusBarVisibility?: StatusBarOptionVisibility;
statusBarLength?: number;
};
buildTarget?: {
projectStatusVisibility?: ProjectStatusButtonVisibility;
statusBarVisibility?: StatusBarTextButtonVisibility;
projectStatusVisibility?: ProjectStatusOptionVisibility;
statusBarVisibility?: StatusBarTextOptionVisibility;
statusBarLength?: number;
};
build?: {
projectStatusVisibility?: ProjectStatusButtonVisibility;
statusBarVisibility?: StatusBarStaticButtonVisibility;
projectStatusVisibility?: ProjectStatusOptionVisibility;
statusBarVisibility?: StatusBarStaticOptionVisibility;
};
launchTarget?: {
projectStatusVisibility?: ProjectStatusButtonVisibility;
statusBarVisibility?: StatusBarTextButtonVisibility;
projectStatusVisibility?: ProjectStatusOptionVisibility;
statusBarVisibility?: StatusBarTextOptionVisibility;
statusBarLength?: number;
};
debug?: {
projectStatusVisibility?: ProjectStatusButtonVisibility;
statusBarVisibility?: StatusBarIconButtonVisibility;
projectStatusVisibility?: ProjectStatusOptionVisibility;
statusBarVisibility?: StatusBarIconOptionVisibility;
};
launch?: {
projectStatusVisibility?: ProjectStatusButtonVisibility;
statusBarVisibility?: StatusBarIconButtonVisibility;
projectStatusVisibility?: ProjectStatusOptionVisibility;
statusBarVisibility?: StatusBarIconOptionVisibility;
};
ctest?: {
projectStatusVisibility?: ProjectStatusButtonVisibility;
projectStatusVisibility?: ProjectStatusOptionVisibility;
color?: boolean;
statusBarVisibility?: StatusBarButtonVisibility;
statusBarVisibility?: StatusBarOptionVisibility;
statusBarLength?: number;
};
}

export interface StatusConfig {
advanced?: AdvancedStatusConfig;
statusBarVisibility: StatusBarButtonVisibility;
export interface OptionConfig {
advanced?: AdvancedOptionConfig;
statusBarVisibility: StatusBarOptionVisibility;
}

export interface ExtensionConfigurationSettings {
Expand Down Expand Up @@ -162,7 +162,7 @@ export interface ExtensionConfigurationSettings {
additionalKits: string[];
touchbar: TouchBarConfig;
showOptionsMovedNotification: boolean;
status: StatusConfig;
options: OptionConfig;
useCMakePresets: UseCMakePresets;
allowCommentsInPresetsFile: boolean;
allowUnsupportedPresetsVersions: boolean;
Expand Down Expand Up @@ -474,8 +474,8 @@ export class ConfigurationReader implements vscode.Disposable {
return this.configData.touchbar;
}

get status() {
return this.configData.status;
get options() {
return this.configData.options;
}

get launchBehavior(): string {
Expand Down Expand Up @@ -537,7 +537,7 @@ export class ConfigurationReader implements vscode.Disposable {
additionalKits: new vscode.EventEmitter<string[]>(),
touchbar: new vscode.EventEmitter<TouchBarConfig>(),
showOptionsMovedNotification: new vscode.EventEmitter<boolean>(),
status: new vscode.EventEmitter<StatusConfig>(),
options: new vscode.EventEmitter<OptionConfig>(),
useCMakePresets: new vscode.EventEmitter<UseCMakePresets>(),
allowCommentsInPresetsFile: new vscode.EventEmitter<boolean>(),
allowUnsupportedPresetsVersions: new vscode.EventEmitter<boolean>(),
Expand Down
Loading

0 comments on commit 7f35a4a

Please sign in to comment.