Skip to content

Commit 45431e9

Browse files
committed
Remove "ddc#set_static_import_path()".
1 parent a14a858 commit 45431e9

File tree

4 files changed

+5
-70
lines changed

4 files changed

+5
-70
lines changed

autoload/ddc.vim

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,6 @@ function ddc#update_items(name, items) abort
6868
call ddc#denops#_notify('updateItems', [a:name, a:items])
6969
endfunction
7070

71-
function ddc#set_static_import_path() abort
72-
" Clear current import path.
73-
call writefile([
74-
\ '// NOTE: It is dummy module.',
75-
\ 'export const mods = {};',
76-
\ ], ddc#denops#_mods())
77-
78-
call ddc#denops#_notify('setStaticImportPath', [])
79-
endfunction
80-
8171
function ddc#on_event(event) abort
8272
" NOTE: If denops isn't running, stop
8373
if !ddc#denops#_running()

denops/ddc/app.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import type {
1313
Previewer,
1414
UserOptions,
1515
} from "./types.ts";
16-
import { initStaticImportPath, Loader } from "./loader.ts";
16+
import { Loader } from "./loader.ts";
1717
import { isDenoCacheIssueError } from "./utils.ts";
1818
import { createCallbackContext } from "./callback.ts";
1919
import { getFilter, getPreviewer, onCompleteDone, onEvent } from "./ext.ts";
@@ -173,10 +173,6 @@ export const main: Entrypoint = (denops: Denops) => {
173173
getCurrent(): Promise<DdcOptions> {
174174
return Promise.resolve(contextBuilder.getCurrent(denops));
175175
},
176-
async setStaticImportPath(): Promise<void> {
177-
await initStaticImportPath(denops);
178-
return Promise.resolve();
179-
},
180176
async getPreviewer(arg1: unknown, arg2: unknown): Promise<Previewer> {
181177
const [_skip, context, options] = await contextBuilder
182178
.createContext(denops, "Manual");

denops/ddc/loader.ts

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import type { BaseSource } from "./base/source.ts";
99
import type { BaseFilter } from "./base/filter.ts";
1010
import type { BaseUi } from "./base/ui.ts";
1111
import { isDenoCacheIssueError } from "./utils.ts";
12-
import { mods } from "./_mods.js";
1312

1413
import type { Denops } from "jsr:@denops/std@~7.4.0";
1514
import * as op from "jsr:@denops/std@~7.4.0/option";
@@ -144,8 +143,7 @@ export class Loader {
144143

145144
const name = parse(path).name;
146145

147-
const mod = (mods as Record<string, unknown>)[toFileUrl(path).href] ??
148-
await import(toFileUrl(path).href);
146+
const mod = await import(toFileUrl(path).href);
149147

150148
const typeExt = this.#exts[type];
151149
let add;
@@ -190,46 +188,6 @@ export class Loader {
190188
}
191189
}
192190

193-
export async function initStaticImportPath(denops: Denops) {
194-
// Generate _mods.ts
195-
let mods: string[] = [];
196-
const runtimepath = await op.runtimepath.getGlobal(denops);
197-
for (
198-
const glob of [
199-
"denops/@ddc-filters/*.ts",
200-
"denops/@ddc-sources/*.ts",
201-
"denops/@ddc-uis/*.ts",
202-
]
203-
) {
204-
mods = mods.concat(
205-
await fn.globpath(
206-
denops,
207-
runtimepath,
208-
glob,
209-
1,
210-
1,
211-
),
212-
);
213-
}
214-
215-
const staticLines = [];
216-
for (const [index, path] of mods.entries()) {
217-
staticLines.push(
218-
`import * as mod${index} from "${toFileUrl(path).href}"`,
219-
);
220-
}
221-
staticLines.push("export const mods = {");
222-
for (const [index, path] of mods.entries()) {
223-
staticLines.push(` "${toFileUrl(path).href}":`);
224-
staticLines.push(` mod${index},`);
225-
}
226-
staticLines.push("};");
227-
await Deno.writeTextFile(
228-
await denops.call("ddc#denops#_mods") as string,
229-
staticLines.join("\n"),
230-
);
231-
}
232-
233191
async function globpath(
234192
denops: Denops,
235193
search: string,

doc/ddc.txt

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -370,16 +370,6 @@ ddc#register({type}, {path})
370370
{path} is ddc extension path.
371371
NOTE: {path} must be full path.
372372

373-
*ddc#set_static_import_path()*
374-
ddc#set_static_import_path()
375-
Make static import file to optimize load ddc extensions from
376-
current 'runtimepath'.
377-
NOTE: It should be called if you have updated plugins.
378-
NOTE: It changes "denops/ddc/_mods.js" in the repository.
379-
"--skip-worktree" is recommended if you use "git".
380-
>
381-
$ git update-index --skip-worktree denops/ddc/_mods.js
382-
<
383373
*ddc#skip_next_complete()*
384374
ddc#skip_next_complete()
385375
Skip the next auto completion.
@@ -1620,8 +1610,6 @@ feature.
16201610

16211611
https://github.com/vim-denops/denops.vim#shared-server
16221612

1623-
Or you can create static import file by |ddc#set_static_import_path()|.
1624-
16251613
Or ignore deno cache directory "%LOCALAPPDATA%\deno" from anti virus scan.
16261614

16271615
*ddc-faq-22*
@@ -1750,6 +1738,9 @@ A: You can use |ddc-option-dynamicUi| for it. >vim
17501738
==============================================================================
17511739
COMPATIBILITY *ddc-compatibility*
17521740

1741+
2025.03.01
1742+
* Remove "ddc#set_static_import_path()".
1743+
17531744
2024.11.25
17541745
* Vim 9.1.0448+ or Neovim 0.10.0+ is required.
17551746

0 commit comments

Comments
 (0)