Add validation for new file names for sql projects (#21601)

* Add validation for new file names for sql projects

* Addres comments and add validation for new project dialog

* Address comments

* Address comments on test

* Fix tests

* Remove extra error messages and rename file

* Address comments

* Fix tests

* Add test file back
This commit is contained in:
Sakshi Sharma
2023-02-02 07:25:26 -08:00
committed by GitHub
parent 1071c6dfff
commit 972312b3f5
12 changed files with 438 additions and 29 deletions

View File

@@ -54,6 +54,32 @@ declare module 'dataworkspace' {
* @returns the uri of the created the project or undefined if no project was created
*/
openSpecificProjectNewProjectDialog(projectType: IProjectType): Promise<vscode.Uri | undefined>;
/**
* Determines if a given character is a valid filename character
* @param c Character to validate
*/
isValidFilenameCharacter(c: string): boolean;
/**
* Replaces invalid filename characters in a string with underscores
* @param s The string to be sanitized for a filename
*/
sanitizeStringForFilename(s: string): string;
/**
* Returns true if the string is a valid filename
* Logic is copied from src\vs\base\common\extpath.ts
* @param name filename to check
*/
isValidBasename(name: string | null | undefined): boolean;
/**
* Returns specific error message if file name is invalid
* Logic is copied from src\vs\base\common\extpath.ts
* @param name filename to check
*/
isValidBasenameErrorMessage(name: string | null | undefined): string;
}
/**
@@ -94,7 +120,7 @@ declare module 'dataworkspace' {
/**
* Gets the project image to be used as background in dashboard container
*/
readonly image?: azdata.ThemedIconPath;
readonly image?: azdata.ThemedIconPath;
}
/**
@@ -233,4 +259,5 @@ declare module 'dataworkspace' {
* Union type representing data types in dashboard table
*/
export type IDashboardColumnType = 'string' | 'icon';
}