* Adding group by schema

* Adding group by schema

* Adding strings

* removing local config

* Fixing formatting

* Adding enable and disable group by schema menu item

* Fixing node refresh logic

* Fixing lint

* changing default

* Adding error message

* Fixing stuff

* Fixing error message

* fixing error message

* Update localization/xliff/enu/constants/localizedConstants.enu.xlf

Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>

* Pushing new sts version

---------

Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>
This commit is contained in:
Aasim Khan 2023-02-21 10:08:15 -08:00 коммит произвёл GitHub
Родитель 5b76c231ed
Коммит bcdec95951
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
9 изменённых файлов: 135 добавлений и 39 удалений

Просмотреть файл

@ -587,6 +587,12 @@
<trans-unit id="columnWidthMustBePositiveError">
<source xml:lang="en">Width cannot be 0 or negative</source>
</trans-unit>
<trans-unit id="objectExplorerNodeRefreshError">
<source xml:lang="en">An error occurred refreshing nodes. See the MSSQL output channel for more details.</source>
</trans-unit>
<trans-unit id="showOutputChannelActionButtonText">
<source xml:lang="en">Show MSSQL output</source>
</trans-unit>
</body>
</file>
</xliff>

Просмотреть файл

@ -392,6 +392,15 @@
<trans-unit id="mssql.deviceCode.description">
<source xml:lang="en">Allows users to sign in to input-constrained devices.</source>
</trans-unit>
<trans-unit id="mssql.objectExplorer.groupBySchema">
<source xml:lang="en">When enabled, the database objects in Object Explorer will be categorized by schema.</source>
</trans-unit>
<trans-unit id="mssql.objectExplorer.enableGroupBySchema">
<source xml:lang="en">Enable Group By Schema</source>
</trans-unit>
<trans-unit id="mssql.objectExplorer.disableGroupBySchema">
<source xml:lang="en">Disable Group By Schema</source>
</trans-unit>
</body>
</file>
</xliff>

Просмотреть файл

@ -247,6 +247,18 @@
"when": "view == queryHistory",
"title": "%mssql.clearAllQueryHistory%",
"group": "secondary"
},
{
"command": "mssql.objectExplorer.enableGroupBySchema",
"when": "view == objectExplorer && !config.mssql.objectExplorer.groupBySchema",
"title": "%mssql.objectExplorer.enableGroupBySchema%",
"group": "secondary"
},
{
"command": "mssql.objectExplorer.disableGroupBySchema",
"when": "view == objectExplorer && config.mssql.objectExplorer.groupBySchema",
"title": "%mssql.objectExplorer.disableGroupBySchema%",
"group": "secondary"
}
],
"view/item/context": [
@ -439,6 +451,16 @@
"category": "MS SQL",
"icon": "$(add)"
},
{
"command": "mssql.objectExplorer.enableGroupBySchema",
"title": "%mssql.objectExplorer.enableGroupBySchema%",
"category": "MS SQL"
},
{
"command": "mssql.objectExplorer.disableGroupBySchema",
"title": "%mssql.objectExplorer.disableGroupBySchema%",
"category": "MS SQL"
},
{
"command": "mssql.objectExplorerNewQuery",
"title": "%mssql.objectExplorerNewQuery%",
@ -1137,6 +1159,11 @@
"type": "boolean",
"description": "%mssql.ignorePlatformWarning%",
"default": false
},
"mssql.objectExplorer.groupBySchema": {
"type": "boolean",
"description": "%mssql.objectExplorer.groupBySchema%",
"default": false
}
}
}

Просмотреть файл

@ -128,5 +128,8 @@
"mssql.Configuration":"MSSQL configuration",
"mssql.chooseAuthMethod":"Chooses which Authentication method to use",
"mssql.authCodeGrant.description":"Prompts users to sign in using their browser.",
"mssql.deviceCode.description":"Allows users to sign in to input-constrained devices."
"mssql.deviceCode.description":"Allows users to sign in to input-constrained devices.",
"mssql.objectExplorer.groupBySchema":"When enabled, the database objects in Object Explorer will be categorized by schema.",
"mssql.objectExplorer.enableGroupBySchema":"Enable Group By Schema",
"mssql.objectExplorer.disableGroupBySchema":"Disable Group By Schema"
}

Просмотреть файл

@ -1,19 +1,19 @@
{
"service": {
"downloadUrl": "https://github.com/Microsoft/sqltoolsservice/releases/download/{#version#}/microsoft.sqltools.servicelayer-{#fileName#}",
"version": "4.5.0.8",
"version": "4.5.0.26",
"downloadFileNames": {
"Windows_86": "win-x86-net6.0.zip",
"Windows_64": "win-x64-net6.0.zip",
"OSX_10_11_64": "osx-x64-net6.0.tar.gz",
"CentOS_7": "rhel-x64-net6.0.tar.gz",
"Debian_8": "rhel-x64-net6.0.tar.gz",
"Fedora_23": "rhel-x64-net6.0.tar.gz",
"OpenSUSE_13_2": "rhel-x64-net6.0.tar.gz",
"SLES_12_2": "rhel-x64-net6.0.tar.gz",
"RHEL_7": "rhel-x64-net6.0.tar.gz",
"Ubuntu_14": "rhel-x64-net6.0.tar.gz",
"Ubuntu_16": "rhel-x64-net6.0.tar.gz"
"Windows_86": "win-x86-net7.0.zip",
"Windows_64": "win-x64-net7.0.zip",
"OSX_10_11_64": "osx-x64-net7.0.tar.gz",
"CentOS_7": "rhel-x64-net7.0.tar.gz",
"Debian_8": "rhel-x64-net7.0.tar.gz",
"Fedora_23": "rhel-x64-net7.0.tar.gz",
"OpenSUSE_13_2": "rhel-x64-net7.0.tar.gz",
"SLES_12_2": "rhel-x64-net7.0.tar.gz",
"RHEL_7": "rhel-x64-net7.0.tar.gz",
"Ubuntu_14": "rhel-x64-net7.0.tar.gz",
"Ubuntu_16": "rhel-x64-net7.0.tar.gz"
},
"installDir": "../sqltoolsservice/{#version#}/{#platform#}",
"executableFiles": [

Просмотреть файл

@ -47,6 +47,9 @@ export const cmdObjectExplorerNodeSignIn = 'mssql.objectExplorerNodeSignIn';
export const cmdConnectObjectExplorerNode = 'mssql.connectObjectExplorerNode';
export const cmdConnectObjectExplorerProfile = 'mssql.connectObjectExplorerProfile';
export const cmdOpenObjectExplorerCommand = 'workbench.view.extension.objectExplorer';
export const cmdObjectExplorerGroupBySchemaFlagName = 'mssql.objectExplorer.groupBySchema';
export const cmdObjectExplorerEnableGroupBySchemaCommand = 'mssql.objectExplorer.enableGroupBySchema';
export const cmdObjectExplorerDisableGroupBySchemaCommand = 'mssql.objectExplorer.disableGroupBySchema';
export const cmdScriptSelect = 'mssql.scriptSelect';
export const cmdScriptCreate = 'mssql.scriptCreate';
export const cmdScriptDelete = 'mssql.scriptDelete';

Просмотреть файл

@ -163,6 +163,15 @@ export default class MainController implements vscode.Disposable {
});
});
this.registerCommand(Constants.cmdObjectExplorerEnableGroupBySchemaCommand);
this._event.on(Constants.cmdObjectExplorerEnableGroupBySchemaCommand, () => {
vscode.workspace.getConfiguration().update(Constants.cmdObjectExplorerGroupBySchemaFlagName, true, true);
});
this.registerCommand(Constants.cmdObjectExplorerDisableGroupBySchemaCommand);
this._event.on(Constants.cmdObjectExplorerDisableGroupBySchemaCommand, () => {
vscode.workspace.getConfiguration().update(Constants.cmdObjectExplorerGroupBySchemaFlagName, false, true);
});
this.initializeQueryHistory();
this.sqlTasksService = new SqlTasksService(SqlToolsServerClient.instance, this._untitledSqlDocumentService);
@ -1178,6 +1187,21 @@ export default class MainController implements vscode.Disposable {
await this.sanitizeConnectionProfiles();
if (e.affectsConfiguration(Constants.cmdObjectExplorerGroupBySchemaFlagName)) {
let errorFoundWhileRefreshing = false;
(await this._objectExplorerProvider.getChildren()).forEach((n: TreeNodeInfo) => {
try {
this._objectExplorerProvider.refreshNode(n);
} catch (e) {
errorFoundWhileRefreshing = true;
Utils.logToOutputChannel(e.toString());
}
});
if (errorFoundWhileRefreshing) {
Utils.showErrorMsg(LocalizedConstants.objectExplorerNodeRefreshError);
}
}
if (needsRefresh) {
this._objectExplorerProvider.refresh(undefined);
}

Просмотреть файл

@ -25,6 +25,8 @@ const configTracingLevel = 'tracingLevel';
const configLogRetentionMinutes = 'logRetentionMinutes';
const configLogFilesRemovalLimit = 'logFilesRemovalLimit';
const outputChannel = vscode.window.createOutputChannel(Constants.outputChannelName);
// INTERFACES /////////////////////////////////////////////////////////////////////////////////////
// Interface for package.json information
@ -110,8 +112,6 @@ export function getActiveTextEditorUri(): string {
// Helper to log messages to "MSSQL" output channel
export function logToOutputChannel(msg: any): void {
let outputChannel = vscode.window.createOutputChannel(Constants.outputChannelName);
outputChannel.show();
if (msg instanceof Array) {
msg.forEach(element => {
outputChannel.appendLine(element.toString());
@ -121,6 +121,10 @@ export function logToOutputChannel(msg: any): void {
}
}
export function openOutputChannel(): void {
outputChannel.show();
}
// Helper to log debug messages
export function logDebug(msg: any): void {
let config = vscode.workspace.getConfiguration(Constants.extensionConfigSectionName);
@ -147,6 +151,15 @@ export function showErrorMsg(msg: string): void {
vscode.window.showErrorMessage(Constants.extensionName + ': ' + msg);
}
// Helper to show an error message with an option to open the output channel
export function showOutputChannelErrorMsg(msg: string): void {
vscode.window.showErrorMessage(msg, LocalizedConstants.showOutputChannelActionButtonText).then((result) => {
if (result === LocalizedConstants.showOutputChannelActionButtonText) {
openOutputChannel();
}
});
}
export function isEmpty(str: any): boolean {
return (!str || '' === str);
}

Просмотреть файл

@ -1,25 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">
<style type="text/css">
.st0{opacity:0;fill:#F6F6F6;}
.st1{fill:#F6F6F6;}
.st2{fill:#424242;}
.st3{fill:#F0EFF1;}
</style>
<g id="outline">
<rect class="st0" width="16" height="16"/>
<path class="st1" d="M16,16H1V0h15V16z"/>
</g>
<g id="icon_x5F_bg">
<path class="st2" d="M2,1v14h13V1H2z M14,14H3V3h11V14z"/>
<path class="st2" d="M12.5,10H11L9.5,7h1L11,6.5v-2L10.5,4h-4L6,4.5v2L6.5,7h1L6,10H4.5L4,10.5v2L4.5,13h3L8,12.5v-2L7.5,10H7
l1.5-3l1.5,3H9.5L9,10.5v2L9.5,13h3l0.5-0.5v-2L12.5,10z M7,12H5v-1h2V12z M8,6H7V5h3v1H9H8z M12,12h-2v-1h2V12z"/>
</g>
<g id="icon_x5F_fg">
<path class="st3" d="M5,11h2v1H5V11z M10,12h2v-1h-2V12z M10,5H7v1h3V5z M14,3v11H3V3H14z M13,10.5L12.5,10H11L9.5,7h1L11,6.5v-2
L10.5,4h-4L6,4.5v2L6.5,7h1L6,10H4.5L4,10.5v2L4.5,13h3L8,12.5v-2L7.5,10H7l1.5-3l1.5,3H9.5L9,10.5v2L9.5,13h3l0.5-0.5V10.5z"/>
</g>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
<style>
.icon-canvas-transparent {
opacity: 0;
fill: #000000
}
.icon-vs-out {
fill: #f6f6f6
}
.icon-vs-bg {
fill: #424242
}
.icon-vs-fg {
fill: #f0eff1
}
.icon-vs-blue {
fill: #1ba1e2
}
</style>
<path class="icon-canvas-transparent" d="M16 0v16H0V0h16z" id="canvas" />
<path class="icon-vs-out"
d="M16 3v6c0 1.711-2.149 3-5 3-.345 0-.678-.021-1-.057V12h1v4H6v-4H5v4H0v-4h1V9h2V5h3V3c0-1.711 2.149-3 5-3s5 1.289 5 3z"
id="outline" />
<path class="icon-vs-fg"
d="M14.325 3c0 .527-1.326 1.325-3.325 1.325S7.675 3.527 7.675 3 9.001 1.675 11 1.675s3.325.798 3.325 1.325z"
id="iconFg" />
<g id="iconBg">
<path class="icon-vs-blue"
d="M11 1c-2.209 0-4 .896-4 2v2h1v4h2v1.93c.321.041.652.07 1 .07 2.209 0 4-.896 4-2V3c0-1.104-1.791-2-4-2zm0 3.325c-1.999 0-3.325-.798-3.325-1.325S9.001 1.675 11 1.675s3.325.798 3.325 1.325S12.999 4.325 11 4.325z" />
<path class="icon-vs-bg" d="M10 13v2H7v-2h1v-2H3v2h1v2H1v-2h1v-3h3V8H4V6h3v2H6v2h3v3h1z" />
</g>
</svg>

До

Ширина:  |  Высота:  |  Размер: 1.2 KiB

После

Ширина:  |  Высота:  |  Размер: 1.0 KiB