Skip to content

Commit

Permalink
Support property Text in DocumentDropOrPasteEditKind
Browse files Browse the repository at this point in the history
fixes eclipse-theia#14603

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <[email protected]>
  • Loading branch information
rschnekenbu committed Dec 10, 2024
1 parent fb09901 commit 5781eae
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
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

0 comments on commit 5781eae

Please sign in to comment.