mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-04-03 02:20:30 -04:00
Merge from vscode e1d3dd53d17fb1529a002e4d6fb066db0a0bd385 (#6460)
* Merge from vscode e1d3dd53d17fb1529a002e4d6fb066db0a0bd385 * fix servers icon * fix tests
This commit is contained in:
@@ -31,6 +31,7 @@ import { contrastBorder, editorFindMatch, editorFindMatchBorder, editorFindMatch
|
||||
import { ITheme, IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
|
||||
import { ContextScopedFindInput, ContextScopedHistoryInputBox } from 'vs/platform/browser/contextScopedHistoryWidget';
|
||||
import { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility';
|
||||
import { alert as alertFn } from 'vs/base/browser/ui/aria/aria';
|
||||
|
||||
export interface IFindController {
|
||||
replace(): void;
|
||||
@@ -372,13 +373,26 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
|
||||
} else {
|
||||
label = NLS_NO_RESULTS;
|
||||
}
|
||||
|
||||
this._matchesCount.appendChild(document.createTextNode(label));
|
||||
|
||||
alertFn(this._getAriaLabel(label, this._state.currentMatch, this._state.searchString), true);
|
||||
MAX_MATCHES_COUNT_WIDTH = Math.max(MAX_MATCHES_COUNT_WIDTH, this._matchesCount.clientWidth);
|
||||
}
|
||||
|
||||
// ----- actions
|
||||
|
||||
private _getAriaLabel(label: string, currentMatch: Range | null, searchString: string): string {
|
||||
if (label === NLS_NO_RESULTS) {
|
||||
return searchString === ''
|
||||
? nls.localize('ariaSearchNoResultEmpty', "{0} found", label)
|
||||
: nls.localize('ariaSearchNoResult', "{0} found for {1}", label, searchString);
|
||||
}
|
||||
return currentMatch
|
||||
? nls.localize('ariaSearchNoResultWithLineNum', "{0} found for {1} at {2}", label, searchString, currentMatch.startLineNumber + ':' + currentMatch.startColumn)
|
||||
: nls.localize('ariaSearchNoResultWithLineNumNoCurrentMatch', "{0} found for {1}", label, searchString);
|
||||
}
|
||||
|
||||
/**
|
||||
* If 'selection find' is ON we should not disable the button (its function is to cancel 'selection find').
|
||||
* If 'selection find' is OFF we enable the button only if there is a selection.
|
||||
|
||||
Reference in New Issue
Block a user