Skip to content

Commit dcbda16

Browse files
add tabular.data.createTableViewConfig setting support (#28)
1 parent cc41775 commit dcbda16

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,11 @@
190190
"type": "boolean",
191191
"default": true,
192192
"description": "Create table *.schema.json configuration file when parsing CSV data."
193+
},
194+
"tabular.data.createTableViewConfig": {
195+
"type": "boolean",
196+
"default": true,
197+
"description": "Create *.table.json configuration file to save and restore customized Table View 🀄 columns and sort settings."
193198
}
194199
}
195200
}

src/configuration/settings.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
export enum Settings {
55
dataPageSize = 'pageSize',
66
dynamicDataTyping = 'parser.dynamicTyping',
7-
createTableSchemaConfig = 'createTableSchemaConfig'
7+
createTableSchemaConfig = 'createTableSchemaConfig',
8+
createTableViewConfig = 'createTableViewConfig',
89
}

src/views/tableView.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -451,9 +451,10 @@ export class TableView {
451451
private async updateTableConfig(tableConfig: any): Promise<void> {
452452
if (tableConfig) {
453453
this._tableConfig = tableConfig;
454-
// TODO: add tabular.data.saveTableConfig boolean setting check
455-
// save updated table config for restoring table view after tab close
456-
fileUtils.createJsonFile(this._fileInfo.tableConfigFilePath, tableConfig);
454+
if (this.createTableViewConfig) {
455+
// save updated table config for restoring table view after tab close
456+
fileUtils.createJsonFile(this._fileInfo.tableConfigFilePath, tableConfig);
457+
}
457458
}
458459
}
459460

@@ -584,6 +585,13 @@ export class TableView {
584585
return <boolean>config.get(Settings.createTableSchemaConfig);
585586
}
586587

588+
/**
589+
* Gets create table schema configuration setting for CSV data parsing.
590+
*/
591+
get createTableViewConfig(): boolean {
592+
return <boolean>config.get(Settings.createTableViewConfig);
593+
}
594+
587595
/**
588596
* Creates webview html content for the webview panel display.
589597
*

0 commit comments

Comments
 (0)