提交 3c52b5ae 编写于 作者: B Beatriz Magalhães

fixed misspelled occurrences and occurred

上级 b46e2e0b
......@@ -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; } {
......
......@@ -584,7 +584,7 @@ declare namespace Electron {
/**
* ok - Nothing went wrong.
* error - One or more errors occured, enable runtime logging to figure out the likely cause.
* error - One or more errors occurred, enable runtime logging to figure out the likely cause.
* invalidSeparatorError - An attempt was made to add a separator to a custom category in the Jump List.
* Separators are only allowed in the standard Tasks category.
* fileTypeRegistrationError - An attempt was made to add a file link to the Jump List
......
......@@ -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;
......
......@@ -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 '<p>An error occured:</p><pre>'
return '<p>An error occurred:</p><pre>'
+ escape(e.message + '', true)
+ '</pre>';
}
......
......@@ -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;
}
......
......@@ -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);
......
......@@ -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;
......
......@@ -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)
};
});
......
......@@ -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',
......
......@@ -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);
}
}
}
......
......@@ -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);
......
......@@ -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;
......
......@@ -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;
......
......@@ -175,7 +175,7 @@ export class ReplacePattern {
}
if (substrFrom === 0) {
// no replacement occured
// no replacement occurred
return;
}
......
......@@ -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);
});
});
},
......
......@@ -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 => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册