-
Notifications
You must be signed in to change notification settings - Fork 29.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add intellisense for paste/drop preference and keybindings (#233730)
- Loading branch information
Showing
11 changed files
with
253 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/vs/workbench/contrib/dropOrPasteInto/browser/commands.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import { toAction } from '../../../../base/common/actions.js'; | ||
import { CopyPasteController, pasteAsPreferenceConfig } from '../../../../editor/contrib/dropOrPasteInto/browser/copyPasteController.js'; | ||
import { DropIntoEditorController, dropAsPreferenceConfig } from '../../../../editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js'; | ||
import { localize } from '../../../../nls.js'; | ||
import { IWorkbenchContribution } from '../../../common/contributions.js'; | ||
import { IPreferencesService } from '../../../services/preferences/common/preferences.js'; | ||
|
||
export class DropOrPasteIntoCommands implements IWorkbenchContribution { | ||
public static ID = 'workbench.contrib.dropOrPasteInto'; | ||
|
||
constructor( | ||
@IPreferencesService private readonly _preferencesService: IPreferencesService | ||
) { | ||
CopyPasteController.setConfigureDefaultAction(toAction({ | ||
id: 'workbench.action.configurePreferredPasteAction', | ||
label: localize('configureDefaultPaste.label', 'Configure preferred paste action...'), | ||
run: () => this.configurePreferredPasteAction() | ||
})); | ||
|
||
DropIntoEditorController.setConfigureDefaultAction(toAction({ | ||
id: 'workbench.action.configurePreferredDropAction', | ||
label: localize('configureDefaultDrop.label', 'Configure preferred drop action...'), | ||
run: () => this.configurePreferredDropAction() | ||
})); | ||
} | ||
|
||
private configurePreferredPasteAction() { | ||
return this._preferencesService.openUserSettings({ | ||
jsonEditor: true, | ||
revealSetting: { key: pasteAsPreferenceConfig, edit: true } | ||
}); | ||
} | ||
|
||
private configurePreferredDropAction() { | ||
return this._preferencesService.openUserSettings({ | ||
jsonEditor: true, | ||
revealSetting: { key: dropAsPreferenceConfig, edit: true } | ||
}); | ||
} | ||
} |
Oops, something went wrong.