Change double-quote hygiene rule to tslint rule (#6514)

This commit is contained in:
Charles Gagnon
2019-08-05 09:46:22 -07:00
committed by GitHub
parent a5a37c97a9
commit 8a6dc02e5b
23 changed files with 228 additions and 53 deletions

View File

@@ -45,7 +45,7 @@ export class ExtHostModelViewTreeViews implements ExtHostModelViewTreeViewsShape
const treeView = this.treeViews.get(treeViewId);
if (!treeView) {
return Promise.reject(new Error(localize('treeView.notRegistered', 'No tree view with id \'{0}\' registered.', treeViewId)));
return Promise.reject(new Error(localize('treeView.notRegistered', "No tree view with id \'{0}\' registered.", treeViewId)));
}
return treeView.getChildren(treeItemHandle);
}

View File

@@ -289,7 +289,7 @@ export class ExtHostNotebook implements ExtHostNotebookShape {
return this._withNotebookManager(handle, (notebookManager) => {
let serverManager = notebookManager.serverManager;
if (!serverManager) {
return Promise.reject(new Error(localize('noServerManager', 'Notebook Manager for notebook {0} does not have a server manager. Cannot perform operations on it', notebookManager.uriString)));
return Promise.reject(new Error(localize('noServerManager', "Notebook Manager for notebook {0} does not have a server manager. Cannot perform operations on it", notebookManager.uriString)));
}
return callback(serverManager);
});
@@ -299,7 +299,7 @@ export class ExtHostNotebook implements ExtHostNotebookShape {
return this._withNotebookManager(handle, (notebookManager) => {
let contentManager = notebookManager.contentManager;
if (!contentManager) {
return Promise.reject(new Error(localize('noContentManager', 'Notebook Manager for notebook {0} does not have a content manager. Cannot perform operations on it', notebookManager.uriString)));
return Promise.reject(new Error(localize('noContentManager', "Notebook Manager for notebook {0} does not have a content manager. Cannot perform operations on it", notebookManager.uriString)));
}
return callback(contentManager);
});
@@ -309,7 +309,7 @@ export class ExtHostNotebook implements ExtHostNotebookShape {
return this._withNotebookManager(handle, (notebookManager) => {
let sessionManager = notebookManager.sessionManager;
if (!sessionManager) {
return Promise.reject(new Error(localize('noSessionManager', 'Notebook Manager for notebook {0} does not have a session manager. Cannot perform operations on it', notebookManager.uriString)));
return Promise.reject(new Error(localize('noSessionManager', "Notebook Manager for notebook {0} does not have a session manager. Cannot perform operations on it", notebookManager.uriString)));
}
return callback(sessionManager);
});

View File

@@ -164,7 +164,7 @@ export function script(connectionProfile: IConnectionProfile, metadata: azdata.O
reject(editorError);
});
} else {
let scriptNotFoundMsg = nls.localize('scriptNotFoundForObject', 'No script was returned when scripting as {0} on object {1}',
let scriptNotFoundMsg = nls.localize('scriptNotFoundForObject', "No script was returned when scripting as {0} on object {1}",
GetScriptOperationName(operation), metadata.metadataTypeName);
let messageDetail = '';
let operationResult = scriptingService.getOperationFailedResult(result.operationId);
@@ -179,7 +179,7 @@ export function script(connectionProfile: IConnectionProfile, metadata: azdata.O
reject(scriptNotFoundMsg);
}
} else {
reject(nls.localize('scriptNotFound', 'No script was returned when scripting as {0}', GetScriptOperationName(operation)));
reject(nls.localize('scriptNotFound', "No script was returned when scripting as {0}", GetScriptOperationName(operation)));
}
}, scriptingError => {
reject(scriptingError);

View File

@@ -169,7 +169,7 @@ export class SaveImageAction extends Action {
this.windowsService.openExternal(filePath.toString());
this.notificationService.notify({
severity: Severity.Error,
message: localize('chartSaved', 'Saved Chart to path: {0}', filePath.toString())
message: localize('chartSaved', "Saved Chart to path: {0}", filePath.toString())
});
}
}

View File

@@ -128,7 +128,7 @@ export class Graph implements IInsight {
chartData = data.rows.map((row, i) => {
return {
data: row.map(item => Number(item)),
label: localize('series', 'Series {0}', i)
label: localize('series', "Series {0}", i)
};
});
}
@@ -144,7 +144,7 @@ export class Graph implements IInsight {
chartData = data.rows[0].slice(1).map((row, i) => {
return {
data: data.rows.map(row => Number(row[i + 1])),
label: localize('series', 'Series {0}', i + 1)
label: localize('series', "Series {0}", i + 1)
};
});
}

View File

@@ -92,7 +92,7 @@ export class CommandLineWorkbenchContribution implements IWorkbenchContribution
let connectedContext: azdata.ConnectedContext = undefined;
if (profile) {
if (this._notificationService) {
this._notificationService.status(localize('connectingLabel', 'Connecting: {0}', profile.serverName), { hideAfter: 2500 });
this._notificationService.status(localize('connectingLabel', "Connecting: {0}", profile.serverName), { hideAfter: 2500 });
}
try {
await this._connectionManagementService.connectIfNotConnected(profile, 'connection', true);
@@ -106,7 +106,7 @@ export class CommandLineWorkbenchContribution implements IWorkbenchContribution
}
if (commandName) {
if (this._notificationService) {
this._notificationService.status(localize('runningCommandLabel', 'Running command: {0}', commandName), { hideAfter: 2500 });
this._notificationService.status(localize('runningCommandLabel', "Running command: {0}", commandName), { hideAfter: 2500 });
}
await this._commandService.executeCommand(commandName, connectedContext);
} else if (profile) {
@@ -119,7 +119,7 @@ export class CommandLineWorkbenchContribution implements IWorkbenchContribution
else {
// Default to showing new query
if (this._notificationService) {
this._notificationService.status(localize('openingNewQueryLabel', 'Opening new query: {0}', profile.serverName), { hideAfter: 2500 });
this._notificationService.status(localize('openingNewQueryLabel', "Opening new query: {0}", profile.serverName), { hideAfter: 2500 });
}
try {
await TaskUtilities.newQuery(profile,

View File

@@ -40,7 +40,7 @@ export class DashboardErrorContainer extends DashboardTab implements AfterViewIn
ngAfterViewInit() {
const errorMessage = this._errorMessageContainer.nativeElement as HTMLElement;
errorMessage.innerText = nls.localize('dashboardNavSection_loadTabError', 'The "{0}" section has invalid content. Please contact extension owner.', this.tab.title);
errorMessage.innerText = nls.localize('dashboardNavSection_loadTabError', "The \"{0}\" section has invalid content. Please contact extension owner.", this.tab.title);
}
public get id(): string {

View File

@@ -179,7 +179,7 @@ export function getDashboardContainer(container: object, logService: ILogService
if (!containerTypeFound) {
const dashboardContainer = dashboardcontainerRegistry.getRegisteredContainer(key);
if (!dashboardContainer) {
const errorMessage = nls.localize('unknownDashboardContainerError', '{0} is an unknown container.', key);
const errorMessage = nls.localize('unknownDashboardContainerError', "{0} is an unknown container.", key);
logService.error(errorMessage);
return { result: false, message: errorMessage, container: undefined };
} else {

View File

@@ -143,7 +143,7 @@ export class PlotlyOutputComponent extends AngularDisposable implements IMimeCom
}
private displayError(error: Error | string): void {
this.errorText = localize('plotlyError', 'Error displaying Plotly graph: {0}', getErrorMessage(error));
this.errorText = localize('plotlyError', "Error displaying Plotly graph: {0}", getErrorMessage(error));
}
layout(): void {

View File

@@ -284,8 +284,8 @@ export class ProfilerTableEditor extends BaseEditor implements IProfilerControll
private _updateRowCountStatus(): void {
if (this._showStatusBarItem) {
let message = this._input.data.filterEnabled ?
localize('ProfilerTableEditor.eventCountFiltered', 'Events (Filtered): {0}/{1}', this._input.data.getLength(), this._input.data.getLengthNonFiltered())
: localize('ProfilerTableEditor.eventCount', 'Events: {0}', this._input.data.getLength());
localize('ProfilerTableEditor.eventCountFiltered', "Events (Filtered): {0}/{1}", this._input.data.getLength(), this._input.data.getLengthNonFiltered())
: localize('ProfilerTableEditor.eventCount', "Events: {0}", this._input.data.getLength());
this._disposeStatusbarItem();
this._statusbarItem = this._statusbarService.addEntry({ text: message }, 'status.eventCount', localize('status.eventCount', "Event Count"), StatusbarAlignment.RIGHT);

View File

@@ -506,7 +506,7 @@ for (let i = 0; i < 9; i++) {
'type': 'string',
'default': defaultVal,
'description': localize('queryShortcutDescription',
'Set keybinding workbench.action.query.shortcut{0} to run the shortcut text as a procedure call. Any selected text in the query editor will be passed as a parameter',
"Set keybinding workbench.action.query.shortcut{0} to run the shortcut text as a procedure call. Any selected text in the query editor will be passed as a parameter",
queryIndex)
};
}

View File

@@ -92,7 +92,7 @@ export class TaskHistoryView {
}, {
indentPixels: 10,
twistiePixels: 20,
ariaLabel: localize({ key: 'taskHistory.regTreeAriaLabel', comment: ['TaskHistory'] }, 'Task history')
ariaLabel: localize({ key: 'taskHistory.regTreeAriaLabel', comment: ['TaskHistory'] }, "Task history")
});
}

View File

@@ -193,9 +193,9 @@ export class ConnectionWidget {
validationOptions: {
validation: (value: string) => {
if (!value) {
return ({ type: MessageType.ERROR, content: localize('connectionWidget.missingRequireField', '{0} is required.', serverNameOption.displayName) });
return ({ type: MessageType.ERROR, content: localize('connectionWidget.missingRequireField', "{0} is required.", serverNameOption.displayName) });
} else if (startsWith(value, ' ') || endsWith(value, ' ')) {
return ({ type: MessageType.WARNING, content: localize('connectionWidget.fieldWillBeTrimmed', '{0} will be trimmed.', serverNameOption.displayName) });
return ({ type: MessageType.WARNING, content: localize('connectionWidget.fieldWillBeTrimmed', "{0} will be trimmed.", serverNameOption.displayName) });
}
return undefined;
}
@@ -211,7 +211,7 @@ export class ConnectionWidget {
let userName = DialogHelper.appendRow(this._tableContainer, userNameOption.displayName, 'connection-label', 'connection-input', 'username-password-row');
this._userNameInputBox = new InputBox(userName, this._contextViewService, {
validationOptions: {
validation: (value: string) => self.validateUsername(value, userNameOption.isRequired) ? ({ type: MessageType.ERROR, content: localize('connectionWidget.missingRequireField', '{0} is required.', userNameOption.displayName) }) : null
validation: (value: string) => self.validateUsername(value, userNameOption.isRequired) ? ({ type: MessageType.ERROR, content: localize('connectionWidget.missingRequireField', "{0} is required.", userNameOption.displayName) }) : null
},
ariaLabel: userNameOption.displayName
});

View File

@@ -78,7 +78,7 @@ export class FileBrowserTreeView implements IDisposable {
}, {
indentPixels: 10,
twistiePixels: 12,
ariaLabel: nls.localize({ key: 'fileBrowser.regTreeAriaLabel', comment: ['FileBrowserTree'] }, 'File browser tree')
ariaLabel: nls.localize({ key: 'fileBrowser.regTreeAriaLabel', comment: ['FileBrowserTree'] }, "File browser tree")
});
}

View File

@@ -38,7 +38,7 @@ export class LocalContentManager implements nb.ContentManager {
return v3.readNotebook(<any>contents);
}
if (contents.nbformat) {
throw new TypeError(localize('nbformatNotRecognized', 'nbformat v{0}.{1} not recognized', contents.nbformat as any, contents.nbformat_minor as any));
throw new TypeError(localize('nbformatNotRecognized', "nbformat v{0}.{1} not recognized", contents.nbformat as any, contents.nbformat_minor as any));
}
}
@@ -69,7 +69,7 @@ export class LocalContentManager implements nb.ContentManager {
return v3.readNotebook(<any>contents);
}
if (contents.nbformat) {
throw new TypeError(localize('nbformatNotRecognized', 'nbformat v{0}.{1} not recognized', contents.nbformat as any, contents.nbformat_minor as any));
throw new TypeError(localize('nbformatNotRecognized', "nbformat v{0}.{1} not recognized", contents.nbformat as any, contents.nbformat_minor as any));
}
}
@@ -131,7 +131,7 @@ namespace v4 {
case 'code':
return createCodeCell(cell);
default:
throw new TypeError(localize('unknownCellType', 'Cell type {0} unknown', cell.cell_type));
throw new TypeError(localize('unknownCellType', "Cell type {0} unknown", cell.cell_type));
}
}
@@ -190,7 +190,7 @@ namespace v4 {
};
default:
// Should never get here
throw new TypeError(localize('unrecognizedOutput', 'Output type {0} not recognized', (<any>output).output_type));
throw new TypeError(localize('unrecognizedOutput', "Output type {0} not recognized", (<any>output).output_type));
}
}
@@ -222,7 +222,7 @@ namespace v4 {
return demultiline(data);
}
throw new TypeError(localize('invalidMimeData', 'Data for {0} is expected to be a string or an Array of strings', key));
throw new TypeError(localize('invalidMimeData', "Data for {0} is expected to be a string or an Array of strings", key));
}
export function demultiline(value: nb.MultilineString): string {
@@ -314,7 +314,7 @@ namespace v3 {
traceback: output.traceback
};
default:
throw new TypeError(localize('unrecognizedOutputType', 'Output type {0} not recognized', output.output_type));
throw new TypeError(localize('unrecognizedOutputType', "Output type {0} not recognized", output.output_type));
}
};

View File

@@ -41,12 +41,12 @@ export class QueryEditorService implements IQueryEditorService {
private static CHANGE_UNSUPPORTED_ERROR_MESSAGE = nls.localize(
'queryEditorServiceChangeUnsupportedError',
'Change Language Mode is not supported for unsaved queries'
"Change Language Mode is not supported for unsaved queries"
);
private static CHANGE_ERROR_MESSAGE = nls.localize(
'queryEditorServiceChangeError',
'Please save or discard changes before switching to/from the SQL Language Mode'
"Please save or discard changes before switching to/from the SQL Language Mode"
);
// service references for static functions