mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-15 01:25:36 -05:00
Surfacing better error messages about SQLCMD var names (#22509)
* Surfacing better error messages about SQLCMD var names * correcting docstring * adding space to join char
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
import path = require('path');
|
||||
import * as vscode from 'vscode';
|
||||
import * as constants from '../common/constants';
|
||||
import { getSqlProjectsInWorkspace, isValidSqlCmdVariableName } from '../common/utils';
|
||||
import { getSqlProjectsInWorkspace, validateSqlCmdVariableName } from '../common/utils';
|
||||
import { DbServerValues, populateResultWithVars } from './utils';
|
||||
import { AddDatabaseReferenceSettings } from '../controllers/projectController';
|
||||
import { IDacpacReferenceSettings, IProjectReferenceSettings, ISystemDatabaseReferenceSettings } from '../models/IDatabaseReferenceSettings';
|
||||
@@ -211,7 +211,7 @@ async function promptDbVar(defaultValue: string): Promise<string> {
|
||||
title: constants.databaseVariable,
|
||||
value: defaultValue,
|
||||
validateInput: (value: string) => {
|
||||
return isValidSqlCmdVariableName(value) ? '' : constants.notValidVariableName(value);
|
||||
return validateSqlCmdVariableName(value) ?? '';
|
||||
},
|
||||
ignoreFocusOut: true
|
||||
}) ?? '';
|
||||
@@ -235,7 +235,7 @@ async function promptServerVar(): Promise<string> {
|
||||
title: constants.serverVariable,
|
||||
value: constants.otherSeverVariable,
|
||||
validateInput: (value: string) => {
|
||||
return isValidSqlCmdVariableName(value) ? '' : constants.notValidVariableName(value);
|
||||
return validateSqlCmdVariableName(value) ?? '';
|
||||
},
|
||||
ignoreFocusOut: true
|
||||
}) ?? '';
|
||||
|
||||
Reference in New Issue
Block a user