mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-26 01:25:38 -05:00
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:
@@ -8,6 +8,7 @@ import { IExtension, IProjectType } from 'dataworkspace';
|
||||
import { WorkspaceService } from '../services/workspaceService';
|
||||
import { defaultProjectSaveLocation } from './projectLocationHelper';
|
||||
import { openSpecificProjectNewProjectDialog } from '../dialogs/newProjectDialog';
|
||||
import { isValidBasename, isValidBasenameErrorMessage, isValidFilenameCharacter, sanitizeStringForFilename } from './pathUtilsHelper';
|
||||
|
||||
export class DataWorkspaceExtension implements IExtension {
|
||||
constructor(private workspaceService: WorkspaceService) {
|
||||
@@ -41,4 +42,20 @@ export class DataWorkspaceExtension implements IExtension {
|
||||
return openSpecificProjectNewProjectDialog(projectType, this.workspaceService);
|
||||
}
|
||||
|
||||
isValidFilenameCharacter(c: string): boolean {
|
||||
return isValidFilenameCharacter(c);
|
||||
}
|
||||
|
||||
sanitizeStringForFilename(s: string): string {
|
||||
return sanitizeStringForFilename(s);
|
||||
}
|
||||
|
||||
isValidBasename(name?: string): boolean {
|
||||
return isValidBasename(name);
|
||||
}
|
||||
|
||||
isValidBasenameErrorMessage(name?: string): string {
|
||||
return isValidBasenameErrorMessage(name);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user