Skip to content

Commit

Permalink
Name the compued TextEdit type in the protocol file
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist committed Feb 1, 2024
1 parent 046b4f6 commit a57cafd
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions new-packages/language-server/src/protocol.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
import type { ExtractorDigraphDef, Patch, TextEdit } from '@xstate/ts-project';
import type { ExtractorDigraphDef, Patch } from '@xstate/ts-project';
import * as vscode from 'vscode-languageserver-protocol';

type DistributiveOmit<T, K extends PropertyKey> = T extends unknown
? Omit<T, K>
: never;

type TextEdit = DistributiveOmit<
import('@xstate/ts-project').TextEdit,
'fileName'
> & {
uri: string;
};

export const getMachineAtIndex = new vscode.RequestType<
{
uri: string;
Expand All @@ -20,6 +27,6 @@ export const applyPatches = new vscode.RequestType<
machineIndex: number;
patches: Patch[];
},
(DistributiveOmit<TextEdit, 'fileName'> & { uri: string })[],
TextEdit[],
never
>('stately-xstate/apply-patches');

0 comments on commit a57cafd

Please sign in to comment.