@lvce-editor/test-worker 4.36.0 → 4.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/api.d.ts CHANGED
@@ -84,6 +84,8 @@ declare const getText: () => Promise<string>;
84
84
  declare const rename: () => Promise<void>;
85
85
  declare const showHover: () => Promise<void>;
86
86
  declare const openRename: () => Promise<void>;
87
+ declare const growSelection: () => Promise<void>;
88
+ declare const getSelections: () => Promise<Uint32Array>;
87
89
  declare const shouldHaveText: (expectedText: string) => Promise<void>;
88
90
  declare const selectIndex: (index: number) => Promise<void>;
89
91
  declare const selectCurrentIndex: () => Promise<void>;
@@ -138,15 +140,16 @@ declare const openRuntimeStatus: () => Promise<void>;
138
140
  declare const openJsonValidation: () => Promise<void>;
139
141
  declare const openSettings: () => Promise<void>;
140
142
  declare const handleScroll: (scrollTop: number) => Promise<void>;
141
- declare const writeFile: (path: string, content: string) => Promise<void>;
142
- declare const mkdir: (path: string) => Promise<void>;
143
+ declare const writeFile: (uri: string, content: string) => Promise<void>;
144
+ declare const readFile: (uri: string) => Promise<string>;
145
+ declare const mkdir: (uri: string) => Promise<void>;
143
146
  declare const remove: (uri: string) => Promise<void>;
144
147
  declare const getTmpDir: ({ scheme }?: {
145
148
  readonly scheme?: string;
146
149
  }) => Promise<string>;
147
150
  declare const chmod: (uri: string, permissions: any) => Promise<void>;
148
151
  declare const createExecutable: (content: string) => Promise<string>;
149
- declare const createExecutableFrom: (path: string) => Promise<string>;
152
+ declare const createExecutableFrom: (uri: string) => Promise<string>;
150
153
  declare const focusNext$3: () => Promise<void>;
151
154
  declare const setValue: (value: string) => Promise<void>;
152
155
  declare const setIconTheme: (id: string) => Promise<void>;
@@ -320,7 +323,7 @@ declare namespace Dialog {
320
323
  export { executeMock, mockSaveFilePicker, showSaveFilePicker };
321
324
  }
322
325
  declare namespace Editor {
323
- export { addAllMissingImports, closeColorPicker, closeCompletion, closeCompletionDetails, copy, copyLineDown, copyLineUp, cursorCharacterLeft, cursorCharacterRight, cursorDown, cursorEnd, cursorHome, cursorUp, cursorWordLeft, cursorWordPartLeft, cursorWordPartRight, cursorWordRight, deleteAllLeft, deleteAllRight, executeTabCompletion, findAllImplementations, findAllReferences, format, getText, goToDefinition, goToTypeDefinition, insertLineBreak, invokeBraceCompletion, invokeTabCompletion, openColorPicker, openCompletion, openCompletionDetails, openContextMenu, openEditorContextMenu, openFind, openFindWidget, openHover, openRename, openSourceActions, organizeImports, rename, selectAll, setCursor, setDeltaY, setSelections, shouldHaveText, showHover, sortImports, sourceActionsSelectCurrent, toggleBlockComment, toggleCompletionDetails, toggleLineComment, type };
326
+ export { addAllMissingImports, closeColorPicker, closeCompletion, closeCompletionDetails, copy, copyLineDown, copyLineUp, cursorCharacterLeft, cursorCharacterRight, cursorDown, cursorEnd, cursorHome, cursorUp, cursorWordLeft, cursorWordPartLeft, cursorWordPartRight, cursorWordRight, deleteAllLeft, deleteAllRight, executeTabCompletion, findAllImplementations, findAllReferences, format, getSelections, getText, goToDefinition, goToTypeDefinition, growSelection, insertLineBreak, invokeBraceCompletion, invokeTabCompletion, openColorPicker, openCompletion, openCompletionDetails, openContextMenu, openEditorContextMenu, openFind, openFindWidget, openHover, openRename, openSourceActions, organizeImports, rename, selectAll, setCursor, setDeltaY, setSelections, shouldHaveText, showHover, sortImports, sourceActionsSelectCurrent, toggleBlockComment, toggleCompletionDetails, toggleLineComment, type };
324
327
  }
325
328
  declare namespace EditorCompletion {
326
329
  export { selectCurrentIndex, selectIndex };
@@ -335,7 +338,7 @@ declare namespace ExtensionDetail {
335
338
  export { handleScroll, open, openCommands, openFeature, openJsonValidation, openRuntimeStatus, openSettings, openThemes, openWebViews, selectChangelog, selectDetails, selectFeature, selectFeatures, selectTab };
336
339
  }
337
340
  declare namespace FileSystem {
338
- export { chmod, createExecutable, createExecutableFrom, getTmpDir, mkdir, remove, writeFile };
341
+ export { chmod, createExecutable, createExecutableFrom, getTmpDir, mkdir, readFile, remove, writeFile };
339
342
  }
340
343
  declare namespace FindWidget {
341
344
  export { focusNext$3 as focusNext, setValue };
@@ -1976,6 +1976,14 @@ const showHover = async () => {
1976
1976
  const openRename = async () => {
1977
1977
  await invoke('Editor.openRename');
1978
1978
  };
1979
+ const growSelection = async () => {
1980
+ // @ts-ignore
1981
+ await invoke('Editor.selectionGrow');
1982
+ };
1983
+ const getSelections = async () => {
1984
+ // @ts-ignore
1985
+ return invoke('Editor.getSelections');
1986
+ };
1979
1987
  const shouldHaveText = async expectedText => {
1980
1988
  const text = await invoke('Editor.getText');
1981
1989
  if (text !== expectedText) {
@@ -2008,9 +2016,11 @@ const TestFrameWorkComponentEditor = {
2008
2016
  findAllImplementations,
2009
2017
  findAllReferences,
2010
2018
  format,
2019
+ getSelections,
2011
2020
  getText,
2012
2021
  goToDefinition,
2013
2022
  goToTypeDefinition,
2023
+ growSelection,
2014
2024
  insertLineBreak,
2015
2025
  invokeBraceCompletion,
2016
2026
  invokeTabCompletion,
@@ -2304,11 +2314,14 @@ const {
2304
2314
  Slash
2305
2315
  } = Character;
2306
2316
 
2307
- const writeFile = async (path, content) => {
2308
- await invoke('FileSystem.writeFile', path, content);
2317
+ const writeFile = async (uri, content) => {
2318
+ await invoke('FileSystem.writeFile', uri, content);
2319
+ };
2320
+ const readFile = async uri => {
2321
+ return invoke('FileSystem.readFile', uri);
2309
2322
  };
2310
- const mkdir = async path => {
2311
- await invoke('FileSystem.mkdir', path);
2323
+ const mkdir = async uri => {
2324
+ await invoke('FileSystem.mkdir', uri);
2312
2325
  };
2313
2326
  const remove = async uri => {
2314
2327
  await invoke('FileSystem.remove', uri);
@@ -2340,10 +2353,10 @@ const createExecutable = async content => {
2340
2353
  await chmod(gitPath, '755');
2341
2354
  return gitPath;
2342
2355
  };
2343
- const createExecutableFrom = async path => {
2356
+ const createExecutableFrom = async uri => {
2344
2357
  // @ts-ignore
2345
2358
  const testPath = await invoke('PlatformPaths.getTestPath');
2346
- const absolutePath = testPath + Slash + path;
2359
+ const absolutePath = testPath + Slash + uri;
2347
2360
  // @ts-ignore
2348
2361
  const content = await invoke('Ajax.getText', absolutePath);
2349
2362
  return createExecutable(content);
@@ -2356,6 +2369,7 @@ const TestFrameWorkComponentFileSystem = {
2356
2369
  createExecutableFrom,
2357
2370
  getTmpDir,
2358
2371
  mkdir,
2372
+ readFile,
2359
2373
  remove,
2360
2374
  writeFile
2361
2375
  };
@@ -3317,7 +3331,8 @@ const execute = async href => {
3317
3331
  };
3318
3332
 
3319
3333
  const commandMap = {
3320
- 'Test.execute': execute
3334
+ 'Test.execute': execute,
3335
+ 'Test.executeMock': executeMock
3321
3336
  };
3322
3337
 
3323
3338
  const listen = async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/test-worker",
3
- "version": "4.36.0",
3
+ "version": "4.38.0",
4
4
  "description": "Test Worker",
5
5
  "repository": {
6
6
  "type": "git",