diff --git a/build/lib/tslint/noUnexternalizedStringsRule.ts b/build/lib/tslint/noUnexternalizedStringsRule.ts index d7a2d8ca10015..cbe457c5be5ca 100644 --- a/build/lib/tslint/noUnexternalizedStringsRule.ts +++ b/build/lib/tslint/noUnexternalizedStringsRule.ts @@ -82,10 +82,10 @@ class NoUnexternalizedStringsRuleWalker extends Lint.RuleWalker { protected visitSourceFile(node: ts.SourceFile): void { super.visitSourceFile(node); Object.keys(this.usedKeys).forEach(key => { - let occurences = this.usedKeys[key]; - if (occurences.length > 1) { - occurences.forEach(occurence => { - this.addFailure((this.createFailure(occurence.key.getStart(), occurence.key.getWidth(), `Duplicate key ${occurence.key.getText()} with different message value.`))); + let occurrences = this.usedKeys[key]; + if (occurrences.length > 1) { + occurrences.forEach(occurrence => { + this.addFailure((this.createFailure(occurrence.key.getStart(), occurrence.key.getWidth(), `Duplicate key ${occurrence.key.getText()} with different message value.`))); }); } }); @@ -157,17 +157,17 @@ class NoUnexternalizedStringsRuleWalker extends Lint.RuleWalker { private recordKey(keyNode: ts.StringLiteral, messageNode: ts.Node) { let text = keyNode.getText(); - let occurences: KeyMessagePair[] = this.usedKeys[text]; - if (!occurences) { - occurences = []; - this.usedKeys[text] = occurences; + let occurrences: KeyMessagePair[] = this.usedKeys[text]; + if (!occurrences) { + occurrences = []; + this.usedKeys[text] = occurrences; } if (messageNode) { - if (occurences.some(pair => pair.message ? pair.message.getText() === messageNode.getText() : false)) { + if (occurrences.some(pair => pair.message ? pair.message.getText() === messageNode.getText() : false)) { return; } } - occurences.push({ key: keyNode, message: messageNode }); + occurrences.push({ key: keyNode, message: messageNode }); } private findDescribingParent(node: ts.Node): { callInfo?: { callExpression: ts.CallExpression, argIndex: number }, ignoreUsage?: boolean; } { diff --git a/src/vs/base/common/errorMessage.ts b/src/vs/base/common/errorMessage.ts index 9f5ed7fda90d0..3c882cba2299c 100644 --- a/src/vs/base/common/errorMessage.ts +++ b/src/vs/base/common/errorMessage.ts @@ -165,7 +165,7 @@ function detectSystemErrorMessage(exception: any): string { // See https://nodejs.org/api/errors.html#errors_class_system_error if (typeof exception.code === 'string' && typeof exception.errno === 'number' && typeof exception.syscall === 'string') { - return nls.localize('nodeExceptionMessage', "A system error occured ({0})", exception.message); + return nls.localize('nodeExceptionMessage', "A system error occurred ({0})", exception.message); } return exception.message; diff --git a/src/vs/base/common/marked/raw.marked.js b/src/vs/base/common/marked/raw.marked.js index ce02369727acb..589c066b34e8d 100644 --- a/src/vs/base/common/marked/raw.marked.js +++ b/src/vs/base/common/marked/raw.marked.js @@ -1213,7 +1213,7 @@ function marked(src, opt, callback) { } catch (e) { e.message += '\nPlease report this to https://github.com/chjj/marked.'; if ((opt || marked.defaults).silent) { - return '
An error occured:
' + return 'An error occurred:
' + escape(e.message + '', true) + ''; } diff --git a/src/vs/editor/browser/controller/mouseHandler.ts b/src/vs/editor/browser/controller/mouseHandler.ts index cc44acdd62d3f..60ff6e4d650c5 100644 --- a/src/vs/editor/browser/controller/mouseHandler.ts +++ b/src/vs/editor/browser/controller/mouseHandler.ts @@ -185,7 +185,7 @@ export class MouseHandler extends ViewEventHandler { } let actualMouseMoveTime = e.timestamp; if (actualMouseMoveTime < this.lastMouseLeaveTime) { - // Due to throttling, this event occured before the mouse left the editor, therefore ignore it. + // Due to throttling, this event occurred before the mouse left the editor, therefore ignore it. return; } diff --git a/src/vs/editor/browser/standalone/standaloneLanguages.ts b/src/vs/editor/browser/standalone/standaloneLanguages.ts index 0750a1db0a9db..654a43b5f0e0c 100644 --- a/src/vs/editor/browser/standalone/standaloneLanguages.ts +++ b/src/vs/editor/browser/standalone/standaloneLanguages.ts @@ -290,7 +290,7 @@ export function registerDocumentSymbolProvider(languageId: string, provider: mod } /** - * Register a document highlight provider (used by e.g. highlight occurences). + * Register a document highlight provider (used by e.g. highlight occurrences). */ export function registerDocumentHighlightProvider(languageId: string, provider: modes.DocumentHighlightProvider): IDisposable { return modes.DocumentHighlightProviderRegistry.register(languageId, provider); diff --git a/src/vs/editor/common/controller/cursorTypeOperations.ts b/src/vs/editor/common/controller/cursorTypeOperations.ts index 6abac0a543e8a..7793fe670ce2c 100644 --- a/src/vs/editor/common/controller/cursorTypeOperations.ts +++ b/src/vs/editor/common/controller/cursorTypeOperations.ts @@ -239,7 +239,7 @@ export class TypeOperations { const selection = selections[i]; if (!selection.isEmpty()) { // looks like https://github.com/Microsoft/vscode/issues/2773 - // where a cursor operation occured before a canceled composition + // where a cursor operation occurred before a canceled composition // => ignore composition commands[i] = null; continue; diff --git a/src/vs/editor/contrib/find/common/findController.ts b/src/vs/editor/contrib/find/common/findController.ts index a5dae70a8dcdf..b1195ab30f407 100644 --- a/src/vs/editor/contrib/find/common/findController.ts +++ b/src/vs/editor/contrib/find/common/findController.ts @@ -862,7 +862,7 @@ export class SelectHighlightsAction extends AbstractSelectHighlightsAction { constructor() { super({ id: 'editor.action.selectHighlights', - label: nls.localize('selectAllOccurencesOfFindMatch', "Select All Occurrences of Find Match"), + label: nls.localize('selectAllOccurrencesOfFindMatch', "Select All Occurrences of Find Match"), alias: 'Select All Occurrences of Find Match', precondition: null, kbOpts: { @@ -1005,10 +1005,10 @@ export class SelectionHighlighter extends Disposable implements editorCommon.IEd return null; } - const hasFindOccurences = DocumentHighlightProviderRegistry.has(model); + const hasFindOccurrences = DocumentHighlightProviderRegistry.has(model); if (r.currentMatch) { // This is an empty selection - if (hasFindOccurences) { + if (hasFindOccurrences) { // Do not interfere with semantic word highlighting in the no selection case return null; } @@ -1070,7 +1070,7 @@ export class SelectionHighlighter extends Disposable implements editorCommon.IEd } const model = this.editor.getModel(); - const hasFindOccurences = DocumentHighlightProviderRegistry.has(model); + const hasFindOccurrences = DocumentHighlightProviderRegistry.has(model); let allMatches = model.findMatches(this.state.searchText, true, false, this.state.matchCase, this.state.wordSeparators, false).map(m => m.range); allMatches.sort(Range.compareRangesUsingStarts); @@ -1108,7 +1108,7 @@ export class SelectionHighlighter extends Disposable implements editorCommon.IEd return { range: r, // Show in overviewRuler only if model has no semantic highlighting - options: (hasFindOccurences ? SelectionHighlighter._SELECTION_HIGHLIGHT : SelectionHighlighter._SELECTION_HIGHLIGHT_OVERVIEW) + options: (hasFindOccurrences ? SelectionHighlighter._SELECTION_HIGHLIGHT : SelectionHighlighter._SELECTION_HIGHLIGHT_OVERVIEW) }; }); diff --git a/src/vs/editor/contrib/find/test/common/findController.test.ts b/src/vs/editor/contrib/find/test/common/findController.test.ts index aa2fb4de23db8..20559f5713bb1 100644 --- a/src/vs/editor/contrib/find/test/common/findController.test.ts +++ b/src/vs/editor/contrib/find/test/common/findController.test.ts @@ -215,7 +215,7 @@ suite('FindController', () => { }); }); - test('issue #5400: "Select All Occurences of Find Match" does not select all if find uses regex', () => { + test('issue #5400: "Select All Occurrences of Find Match" does not select all if find uses regex', () => { withMockCodeEditor([ 'something', 'someething', diff --git a/src/vs/editor/contrib/links/browser/links.ts b/src/vs/editor/contrib/links/browser/links.ts index c50fc2e0c4318..0e82f55cca308 100644 --- a/src/vs/editor/contrib/links/browser/links.ts +++ b/src/vs/editor/contrib/links/browser/links.ts @@ -58,7 +58,7 @@ const decoration = { }), }; -class LinkOccurence { +class LinkOccurrence { public static decoration(link: Link, useMetaKey: boolean): editorCommon.IModelDeltaDecoration { return { @@ -68,7 +68,7 @@ class LinkOccurence { endLineNumber: link.range.endLineNumber, endColumn: link.range.endColumn }, - options: LinkOccurence._getOptions(useMetaKey, false) + options: LinkOccurrence._getOptions(useMetaKey, false) }; } @@ -88,11 +88,11 @@ class LinkOccurence { } public activate(changeAccessor: editorCommon.IModelDecorationsChangeAccessor, useMetaKey: boolean): void { - changeAccessor.changeDecorationOptions(this.decorationId, LinkOccurence._getOptions(useMetaKey, true)); + changeAccessor.changeDecorationOptions(this.decorationId, LinkOccurrence._getOptions(useMetaKey, true)); } public deactivate(changeAccessor: editorCommon.IModelDecorationsChangeAccessor, useMetaKey: boolean): void { - changeAccessor.changeDecorationOptions(this.decorationId, LinkOccurence._getOptions(useMetaKey, false)); + changeAccessor.changeDecorationOptions(this.decorationId, LinkOccurrence._getOptions(useMetaKey, false)); } } @@ -115,7 +115,7 @@ class LinkDetector implements editorCommon.IEditorContribution { private openerService: IOpenerService; private messageService: IMessageService; private editorWorkerService: IEditorWorkerService; - private currentOccurences: { [decorationId: string]: LinkOccurence; }; + private currentOccurrences: { [decorationId: string]: LinkOccurrence; }; constructor( editor: ICodeEditor, @@ -148,7 +148,7 @@ class LinkDetector implements editorCommon.IEditorContribution { this.timeoutPromise = null; this.computePromise = null; - this.currentOccurences = {}; + this.currentOccurrences = {}; this.activeLinkDecorationId = null; this.beginCompute(); } @@ -162,7 +162,7 @@ class LinkDetector implements editorCommon.IEditorContribution { } private onModelChanged(): void { - this.currentOccurences = {}; + this.currentOccurrences = {}; this.activeLinkDecorationId = null; this.stop(); this.beginCompute(); @@ -202,10 +202,10 @@ class LinkDetector implements editorCommon.IEditorContribution { const useMetaKey = (this.editor.getConfiguration().multiCursorModifier === 'altKey'); this.editor.changeDecorations((changeAccessor: editorCommon.IModelDecorationsChangeAccessor) => { var oldDecorations: string[] = []; - let keys = Object.keys(this.currentOccurences); + let keys = Object.keys(this.currentOccurrences); for (let i = 0, len = keys.length; i < len; i++) { let decorationId = keys[i]; - let occurance = this.currentOccurences[decorationId]; + let occurance = this.currentOccurrences[decorationId]; oldDecorations.push(occurance.decorationId); } @@ -213,17 +213,17 @@ class LinkDetector implements editorCommon.IEditorContribution { if (links) { // Not sure why this is sometimes null for (var i = 0; i < links.length; i++) { - newDecorations.push(LinkOccurence.decoration(links[i], useMetaKey)); + newDecorations.push(LinkOccurrence.decoration(links[i], useMetaKey)); } } var decorations = changeAccessor.deltaDecorations(oldDecorations, newDecorations); - this.currentOccurences = {}; + this.currentOccurrences = {}; this.activeLinkDecorationId = null; for (let i = 0, len = decorations.length; i < len; i++) { - var occurance = new LinkOccurence(links[i], decorations[i]); - this.currentOccurences[occurance.decorationId] = occurance; + var occurance = new LinkOccurrence(links[i], decorations[i]); + this.currentOccurrences[occurance.decorationId] = occurance; } }); } @@ -232,11 +232,11 @@ class LinkDetector implements editorCommon.IEditorContribution { const useMetaKey = (this.editor.getConfiguration().multiCursorModifier === 'altKey'); if (this.isEnabled(mouseEvent, withKey)) { this.cleanUpActiveLinkDecoration(); // always remove previous link decoration as their can only be one - var occurence = this.getLinkOccurence(mouseEvent.target.position); - if (occurence) { + var occurrence = this.getLinkOccurrence(mouseEvent.target.position); + if (occurrence) { this.editor.changeDecorations((changeAccessor) => { - occurence.activate(changeAccessor, useMetaKey); - this.activeLinkDecorationId = occurence.decorationId; + occurrence.activate(changeAccessor, useMetaKey); + this.activeLinkDecorationId = occurrence.decorationId; }); } } else { @@ -247,10 +247,10 @@ class LinkDetector implements editorCommon.IEditorContribution { private cleanUpActiveLinkDecoration(): void { const useMetaKey = (this.editor.getConfiguration().multiCursorModifier === 'altKey'); if (this.activeLinkDecorationId) { - var occurence = this.currentOccurences[this.activeLinkDecorationId]; - if (occurence) { + var occurrence = this.currentOccurrences[this.activeLinkDecorationId]; + if (occurrence) { this.editor.changeDecorations((changeAccessor) => { - occurence.deactivate(changeAccessor, useMetaKey); + occurrence.deactivate(changeAccessor, useMetaKey); }); } @@ -262,20 +262,20 @@ class LinkDetector implements editorCommon.IEditorContribution { if (!this.isEnabled(mouseEvent)) { return; } - var occurence = this.getLinkOccurence(mouseEvent.target.position); - if (!occurence) { + var occurrence = this.getLinkOccurrence(mouseEvent.target.position); + if (!occurrence) { return; } - this.openLinkOccurence(occurence, mouseEvent.hasSideBySideModifier); + this.openLinkOccurrence(occurrence, mouseEvent.hasSideBySideModifier); } - public openLinkOccurence(occurence: LinkOccurence, openToSide: boolean): void { + public openLinkOccurrence(occurrence: LinkOccurrence, openToSide: boolean): void { if (!this.openerService) { return; } - const { link } = occurence; + const { link } = occurrence; link.resolve().then(uri => { // open the uri @@ -293,7 +293,7 @@ class LinkDetector implements editorCommon.IEditorContribution { }).done(null, onUnexpectedError); } - public getLinkOccurence(position: Position): LinkOccurence { + public getLinkOccurrence(position: Position): LinkOccurrence { var decorations = this.editor.getModel().getDecorationsInRange({ startLineNumber: position.lineNumber, startColumn: position.column, @@ -303,9 +303,9 @@ class LinkDetector implements editorCommon.IEditorContribution { for (var i = 0; i < decorations.length; i++) { var decoration = decorations[i]; - var currentOccurence = this.currentOccurences[decoration.id]; - if (currentOccurence) { - return currentOccurence; + var currentOccurrence = this.currentOccurrences[decoration.id]; + if (currentOccurrence) { + return currentOccurrence; } } @@ -354,9 +354,9 @@ class OpenLinkAction extends EditorAction { return; } - let link = linkDetector.getLinkOccurence(editor.getPosition()); + let link = linkDetector.getLinkOccurrence(editor.getPosition()); if (link) { - linkDetector.openLinkOccurence(link, false); + linkDetector.openLinkOccurrence(link, false); } } } diff --git a/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts b/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts index 0aa87cb728251..52b6d50d1511c 100644 --- a/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts +++ b/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts @@ -188,8 +188,8 @@ class WordHighlighter { } // All the effort below is trying to achieve this: - // - when cursor is moved to a word, trigger immediately a findOccurences request - // - 250ms later after the last cursor move event, render the occurences + // - when cursor is moved to a word, trigger immediately a findOccurrences request + // - 250ms later after the last cursor move event, render the occurrences // - no flickering! var currentWordRange = new Range(lineNumber, word.startColumn, lineNumber, word.endColumn); diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index cdb3e52fee3d4..1f0ec636fd9a5 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -3954,7 +3954,7 @@ declare module monaco.languages { export function registerDocumentSymbolProvider(languageId: string, provider: DocumentSymbolProvider): IDisposable; /** - * Register a document highlight provider (used by e.g. highlight occurences). + * Register a document highlight provider (used by e.g. highlight occurrences). */ export function registerDocumentHighlightProvider(languageId: string, provider: DocumentHighlightProvider): IDisposable; diff --git a/src/vs/platform/files/common/files.ts b/src/vs/platform/files/common/files.ts index 94d4d0295ddf9..099b40f2dbf25 100644 --- a/src/vs/platform/files/common/files.ts +++ b/src/vs/platform/files/common/files.ts @@ -191,7 +191,7 @@ export enum FileChangeType { export interface IFileChange { /** - * The type of change that occured to the file. + * The type of change that occurred to the file. */ type: FileChangeType; diff --git a/src/vs/platform/search/common/replace.ts b/src/vs/platform/search/common/replace.ts index e57e23c103435..647b5d51a0d11 100644 --- a/src/vs/platform/search/common/replace.ts +++ b/src/vs/platform/search/common/replace.ts @@ -175,7 +175,7 @@ export class ReplacePattern { } if (substrFrom === 0) { - // no replacement occured + // no replacement occurred return; } diff --git a/src/vs/workbench/api/node/extHost.api.impl.ts b/src/vs/workbench/api/node/extHost.api.impl.ts index b450e6538e630..0066f0146f619 100644 --- a/src/vs/workbench/api/node/extHost.api.impl.ts +++ b/src/vs/workbench/api/node/extHost.api.impl.ts @@ -145,7 +145,7 @@ export function createApiFactory( console.warn('Edits from command ' + id + ' were not applied.'); } }, (err) => { - console.warn('An error occured while running command ' + id, err); + console.warn('An error occurred while running command ' + id, err); }); }); }, diff --git a/src/vs/workbench/services/configurationResolver/node/configurationResolverService.ts b/src/vs/workbench/services/configurationResolver/node/configurationResolverService.ts index 3caa6312379fd..7dcd63979b092 100644 --- a/src/vs/workbench/services/configurationResolver/node/configurationResolverService.ts +++ b/src/vs/workbench/services/configurationResolver/node/configurationResolverService.ts @@ -214,7 +214,7 @@ export class ConfigurationResolverService implements IConfigurationResolverServi } // We need a map from interactive variables to keys because we only want to trigger an command once per key - - // even though it might occure multiple times in configuration #7026. + // even though it might occur multiple times in configuration #7026. const interactiveVariablesToSubstitutes: { [interactiveVariable: string]: { object: any, key: string }[] } = {}; const findInteractiveVariables = (object: any) => { Object.keys(object).forEach(key => {