Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support property Text in DocumentDropOrPasteEditKind #14605

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/plugin-ext/src/plugin/types-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1647,6 +1647,7 @@ export class DocumentLink {
@es5ClassCompat
export class DocumentDropOrPasteEditKind {
static readonly Empty: DocumentDropOrPasteEditKind = new DocumentDropOrPasteEditKind('');
static readonly Text: DocumentDropOrPasteEditKind = new DocumentDropOrPasteEditKind('text');

private static sep = '.';

Expand Down
14 changes: 14 additions & 0 deletions packages/plugin/src/theia.proposed.documentPaste.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,20 @@ export module '@theia/plugin' {
class DocumentDropOrPasteEditKind {
static readonly Empty: DocumentDropOrPasteEditKind;

/**
* The root kind for basic text edits.
*
* This kind should be used for edits that insert basic text into the document. A good example of this is
* an edit that pastes the clipboard text while also updating imports in the file based on the pasted text.
* For this we could use a kind such as `text.updateImports.someLanguageId`.
*
* Even though most drop/paste edits ultimately insert text, you should not use {@linkcode Text} as the base kind
* for every edit as this is redundant. Instead a more specific kind that describes the type of content being
* inserted should be used instead For example, if the edit adds a Markdown link, use `markdown.link` since even
* though the content being inserted is text, it's more important to know that the edit inserts Markdown syntax.
*/
static readonly Text: DocumentDropOrPasteEditKind;

private constructor(value: string);

/**
Expand Down
Loading