mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-23 13:20:30 -04:00
Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463 (#7206)
* Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463 * fix config changes * fix strictnull checks
This commit is contained in:
@@ -26,6 +26,7 @@ import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegis
|
||||
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { EditorOption } from 'vs/editor/common/config/editorOptions';
|
||||
|
||||
const SEARCH_STRING_MAX_LENGTH = 524288;
|
||||
|
||||
@@ -120,7 +121,7 @@ export class CommonFindController extends Disposable implements editorCommon.IEd
|
||||
if (shouldRestartFind) {
|
||||
this._start({
|
||||
forceRevealReplace: false,
|
||||
seedSearchStringFromSelection: false && this._editor.getConfiguration().contribInfo.find.seedSearchStringFromSelection,
|
||||
seedSearchStringFromSelection: false && this._editor.getOption(EditorOption.find).seedSearchStringFromSelection,
|
||||
seedSearchStringFromGlobalClipboard: false,
|
||||
shouldFocus: FindStartFocusAction.NoFocusChange,
|
||||
shouldAnimate: false,
|
||||
@@ -352,7 +353,7 @@ export class CommonFindController extends Disposable implements editorCommon.IEd
|
||||
}
|
||||
|
||||
public getGlobalBufferTerm(): string {
|
||||
if (this._editor.getConfiguration().contribInfo.find.globalFindClipboard
|
||||
if (this._editor.getOption(EditorOption.find).globalFindClipboard
|
||||
&& this._clipboardService
|
||||
&& this._editor.hasModel()
|
||||
&& !this._editor.getModel().isTooLargeForSyncing()
|
||||
@@ -363,7 +364,7 @@ export class CommonFindController extends Disposable implements editorCommon.IEd
|
||||
}
|
||||
|
||||
public setGlobalBufferTerm(text: string) {
|
||||
if (this._editor.getConfiguration().contribInfo.find.globalFindClipboard
|
||||
if (this._editor.getOption(EditorOption.find).globalFindClipboard
|
||||
&& this._clipboardService
|
||||
&& this._editor.hasModel()
|
||||
&& !this._editor.getModel().isTooLargeForSyncing()
|
||||
@@ -398,7 +399,7 @@ export class FindController extends CommonFindController implements IFindControl
|
||||
this._createFindWidget();
|
||||
}
|
||||
|
||||
if (!this._widget!.getPosition() && this._editor.getConfiguration().contribInfo.find.autoFindInSelection) {
|
||||
if (!this._widget!.getPosition() && this._editor.getOption(EditorOption.find).autoFindInSelection) {
|
||||
// not visible yet so we need to set search scope if `editor.find.autoFindInSelection` is `true`
|
||||
opts.updateSearchScope = true;
|
||||
}
|
||||
@@ -456,8 +457,8 @@ export class StartFindAction extends EditorAction {
|
||||
if (controller) {
|
||||
controller.start({
|
||||
forceRevealReplace: false,
|
||||
seedSearchStringFromSelection: editor.getConfiguration().contribInfo.find.seedSearchStringFromSelection,
|
||||
seedSearchStringFromGlobalClipboard: editor.getConfiguration().contribInfo.find.globalFindClipboard,
|
||||
seedSearchStringFromSelection: editor.getOption(EditorOption.find).seedSearchStringFromSelection,
|
||||
seedSearchStringFromGlobalClipboard: editor.getOption(EditorOption.find).globalFindClipboard,
|
||||
shouldFocus: FindStartFocusAction.FocusFindInput,
|
||||
shouldAnimate: true,
|
||||
updateSearchScope: false
|
||||
@@ -507,7 +508,7 @@ export abstract class MatchFindAction extends EditorAction {
|
||||
if (controller && !this._run(controller)) {
|
||||
controller.start({
|
||||
forceRevealReplace: false,
|
||||
seedSearchStringFromSelection: (controller.getState().searchString.length === 0) && editor.getConfiguration().contribInfo.find.seedSearchStringFromSelection,
|
||||
seedSearchStringFromSelection: (controller.getState().searchString.length === 0) && editor.getOption(EditorOption.find).seedSearchStringFromSelection,
|
||||
seedSearchStringFromGlobalClipboard: true,
|
||||
shouldFocus: FindStartFocusAction.NoFocusChange,
|
||||
shouldAnimate: true,
|
||||
@@ -619,7 +620,7 @@ export abstract class SelectionMatchFindAction extends EditorAction {
|
||||
if (!this._run(controller)) {
|
||||
controller.start({
|
||||
forceRevealReplace: false,
|
||||
seedSearchStringFromSelection: editor.getConfiguration().contribInfo.find.seedSearchStringFromSelection,
|
||||
seedSearchStringFromSelection: editor.getOption(EditorOption.find).seedSearchStringFromSelection,
|
||||
seedSearchStringFromGlobalClipboard: false,
|
||||
shouldFocus: FindStartFocusAction.NoFocusChange,
|
||||
shouldAnimate: true,
|
||||
@@ -698,7 +699,7 @@ export class StartFindReplaceAction extends EditorAction {
|
||||
}
|
||||
|
||||
public run(accessor: ServicesAccessor | null, editor: ICodeEditor): void {
|
||||
if (!editor.hasModel() || editor.getConfiguration().readOnly) {
|
||||
if (!editor.hasModel() || editor.getOption(EditorOption.readOnly)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -708,7 +709,7 @@ export class StartFindReplaceAction extends EditorAction {
|
||||
// we only seed search string from selection when the current selection is single line and not empty,
|
||||
// + the find input is not focused
|
||||
let seedSearchStringFromSelection = !currentSelection.isEmpty()
|
||||
&& currentSelection.startLineNumber === currentSelection.endLineNumber && editor.getConfiguration().contribInfo.find.seedSearchStringFromSelection
|
||||
&& currentSelection.startLineNumber === currentSelection.endLineNumber && editor.getOption(EditorOption.find).seedSearchStringFromSelection
|
||||
&& !findInputFocused;
|
||||
/*
|
||||
* if the existing search string in find widget is empty and we don't seed search string from selection, it means the Find Input is still empty, so we should focus the Find Input instead of Replace Input.
|
||||
@@ -725,7 +726,7 @@ export class StartFindReplaceAction extends EditorAction {
|
||||
controller.start({
|
||||
forceRevealReplace: true,
|
||||
seedSearchStringFromSelection: seedSearchStringFromSelection,
|
||||
seedSearchStringFromGlobalClipboard: editor.getConfiguration().contribInfo.find.seedSearchStringFromSelection,
|
||||
seedSearchStringFromGlobalClipboard: editor.getOption(EditorOption.find).seedSearchStringFromSelection,
|
||||
shouldFocus: shouldFocus,
|
||||
shouldAnimate: true,
|
||||
updateSearchScope: false
|
||||
|
||||
Reference in New Issue
Block a user