Skip to content

Commit

Permalink
Remove "convertImportPaths".
Browse files Browse the repository at this point in the history
  • Loading branch information
Shougo committed Dec 6, 2023
1 parent b5d672c commit cafef82
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 49 deletions.
1 change: 0 additions & 1 deletion denops/dpp/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export function defaultContext(): Context {

export function defaultDppOptions(): DppOptions {
return {
convertImportPaths: [],
extOptions: {},
extParams: {},
hooksFileMarker: "{{{,}}}",
Expand Down
33 changes: 0 additions & 33 deletions denops/dpp/dpp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,39 +421,6 @@ export class Dpp {
}
}

// Generate static.ts
let mods: string[] = [];
for (const importPath of options.convertImportPaths) {
for (const glob of importPath.globs) {
for (const plugin of Object.values(recordPlugins)) {
if (!await isDirectory(`${plugin.rtp}/denops`)) {
continue;
}

mods = mods.concat(
await fn.glob(
denops,
`${plugin.rtp}/${glob}`,
true,
true,
) as string[],
);
}
}

const staticFile = `${basePath}/${name}/${importPath.output}`;
const staticLines = [];
for (const [index, path] of mods.entries()) {
staticLines.push(`import * as mod${index} from "file://${path}"`);
}
staticLines.push("export const mods = {");
for (const [index, path] of mods.entries()) {
staticLines.push(` "${path}": mod${index},`);
}
staticLines.push("};");
await Deno.writeTextFile(staticFile, staticLines.join("\n"));
}

await denops.cmd("doautocmd <nomodeline> User Dpp:makeStatePost");
}

Expand Down
1 change: 0 additions & 1 deletion denops/dpp/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ type ImportPath = {
};

export type DppOptions = {
convertImportPaths: ImportPath[];
extOptions: Record<ExtName, Partial<ExtOptions>>;
extParams: Record<ExtName, Partial<BaseExtParams>>;
hooksFileMarker: string;
Expand Down
17 changes: 3 additions & 14 deletions doc/dpp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,6 @@ INTERFACE *dpp-interface*
------------------------------------------------------------------------------
OPTIONS *dpp-options*

*dpp-option-convertImportPaths*
convertImportPaths (ImportPath[])
It is the list of dynamic import paths for denops plugins.
It is converted to "output" file under {base-path}/{name}
directory.

>
type ImportPath = {
globs: string[];
output: string;
};
<
It is useful for dynamic load denops plugins.

*dpp-option-extOptions*
extOptions (dictionary)
It is a dictionary that maps ext names to its options.
Expand Down Expand Up @@ -865,5 +851,8 @@ END
==============================================================================
COMPATIBILITY *dpp-compatibility*

2023.12.06
* Remove "convertImportPaths".

==============================================================================
vim:tw=78:ts=8:ft=help:norl:noet:fen:noet:

0 comments on commit cafef82

Please sign in to comment.