diff --git a/extensions/mssql/config.json b/extensions/mssql/config.json index 5850bdf43d..33531560f1 100644 --- a/extensions/mssql/config.json +++ b/extensions/mssql/config.json @@ -1,6 +1,6 @@ { "downloadUrl": "https://github.com/Microsoft/sqltoolsservice/releases/download/{#version#}/microsoft.sqltools.servicelayer-{#fileName#}", - "version": "4.7.0.15", + "version": "4.7.0.17", "downloadFileNames": { "Windows_86": "win-x86-net7.0.zip", "Windows_64": "win-x64-net7.0.zip", diff --git a/extensions/mssql/src/contracts.ts b/extensions/mssql/src/contracts.ts index 6f3a582d31..060774a9ea 100644 --- a/extensions/mssql/src/contracts.ts +++ b/extensions/mssql/src/contracts.ts @@ -666,6 +666,16 @@ export namespace GetSqlObjectScriptsRequest { export const type = new RequestType('sqlProjects/getSqlObjectScripts'); } + +export namespace ExcludeFolderRequest { + export const type = new RequestType('sqlProjects/excludeFolder'); +} + +export namespace MoveFolderRequest { + export const type = new RequestType('sqlProjects/moveFolder'); +} + + //#endregion //#endregion @@ -910,6 +920,13 @@ export interface FolderParams extends SqlProjectParams { path: string; } +export interface MoveFolderParams extends FolderParams { + /** + * Path of the folder, typically relative to the .sqlproj file + */ + destinationPath: string; +} + export interface CreateSqlProjectParams extends SqlProjectParams { /** * Type of SQL Project: SDK-style or Legacy diff --git a/extensions/mssql/src/mssql.d.ts b/extensions/mssql/src/mssql.d.ts index e15e71a344..5e90658bfa 100644 --- a/extensions/mssql/src/mssql.d.ts +++ b/extensions/mssql/src/mssql.d.ts @@ -386,6 +386,21 @@ declare module 'mssql' { */ deleteFolder(projectUri: string, path: string): Promise; + /** + * Exclude a folder and its contents from a project + * @param projectUri Absolute path of the project, including .sqlproj + * @param path Path of the folder, typically relative to the .sqlproj file + */ + excludeFolder(projectUri: string, path: string): Promise; + + /** + * Move a folder and its contents within a project + * @param projectUri Absolute path of the project, including .sqlproj + * @param destinationPath Path of the folder, typically relative to the .sqlproj file + * @param path Path of the folder, typically relative to the .sqlproj file + */ + moveFolder(projectUri: string, destinationPath: string, path: string): Promise; + /** * Add a post-deployment script to a project * @param projectUri Absolute path of the project, including .sqlproj diff --git a/extensions/mssql/src/sqlProjects/sqlProjectsService.ts b/extensions/mssql/src/sqlProjects/sqlProjectsService.ts index 8a1d1223d9..04daf91c23 100644 --- a/extensions/mssql/src/sqlProjects/sqlProjectsService.ts +++ b/extensions/mssql/src/sqlProjects/sqlProjectsService.ts @@ -461,4 +461,25 @@ export class SqlProjectsService extends BaseService implements mssql.ISqlProject const params: contracts.MoveItemParams = { projectUri: projectUri, destinationPath: destinationPath, path: path }; return await this.runWithErrorHandling(contracts.MoveNoneItemRequest.type, params); } + + /** + * Exclude a folder and its contents from a project + * @param projectUri Absolute path of the project, including .sqlproj + * @param path Path of the folder, typically relative to the .sqlproj file + */ + public async excludeFolder(projectUri: string, path: string): Promise { + const params: contracts.FolderParams = { projectUri: projectUri, path: path }; + return await this.runWithErrorHandling(contracts.ExcludeFolderRequest.type, params); + } + + /** + * Move a folder and its contents within a project + * @param projectUri Absolute path of the project, including .sqlproj + * @param destinationPath Path of the folder, typically relative to the .sqlproj file + * @param path Path of the folder, typically relative to the .sqlproj file + */ + public async moveFolder(projectUri: string, destinationPath: string, path: string): Promise { + const params: contracts.MoveFolderParams = { projectUri: projectUri, destinationPath: destinationPath, path: path }; + return await this.runWithErrorHandling(contracts.MoveFolderRequest.type, params); + } } diff --git a/extensions/types/vscode-mssql.d.ts b/extensions/types/vscode-mssql.d.ts index fe5816d81c..d8c9c966ab 100644 --- a/extensions/types/vscode-mssql.d.ts +++ b/extensions/types/vscode-mssql.d.ts @@ -493,6 +493,21 @@ declare module 'vscode-mssql' { */ deleteFolder(projectUri: string, path: string): Promise; + /** + * Exclude a folder and its contents from a project + * @param projectUri Absolute path of the project, including .sqlproj + * @param path Path of the folder, typically relative to the .sqlproj file + */ + excludeFolder(projectUri: string, path: string): Promise; + + /** + * Move a folder and its contents within a project + * @param projectUri Absolute path of the project, including .sqlproj + * @param destinationPath Path of the folder, typically relative to the .sqlproj file + * @param path Path of the folder, typically relative to the .sqlproj file + */ + moveFolder(projectUri: string, destinationPath: string, path: string): Promise; + /** * Add a post-deployment script to a project * @param projectUri Absolute path of the project, including .sqlproj