-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] Resolve circular reference of imports #121
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
It should.
It should not. Because |
We have stopped re-exporting, but the problem continues to persist. |
Hm... If so, |
Oh, I have found export type DduOptions = {
// ...
columnParams: Record<ColumnName, Partial<BaseColumnParams>>;
filterParams: Record<FilterName, Partial<BaseFilterParams>>;
kindParams: Record<KindName, Partial<BaseKindParams>>;
// ...
postFilters: UserFilter[];
sourceParams: Record<SourceName, Partial<BaseSourceParams>>;
sources: UserSource[];
// ...
uiParams: Record<UiName, Partial<BaseUiParams>>;
}; |
Hm...
|
Remaining circular reference:
|
4a31a19
to
f1e5a15
Compare
export interface Loader {
initStaticImportPath(denops: Denops): Promise<void>;
autoload(denops: Denops, type: DduExtType, name: string): Promise<void>;
registerAlias(type: DduAliasType, alias: string, base: string): void;
registerPath(type: DduExtType, path: string): Promise<void>;
getUi(index: string, name: string): BaseUi<BaseParams> | null;
getSource(index: string, name: string): BaseSource<BaseParams> | null;
getFilter(index: string, name: string): BaseFilter<BaseParams> | null;
getKind(index: string, name: string): BaseKind<BaseParams> | null;
getColumn(index: string, name: string): BaseColumn<BaseParams> | null;
getAlias(type: DduAliasType, name: string): string | undefined;
getAliasNames(type: DduAliasType): string[];
getSourceNames(): string[];
}
import type { Loader } from "./types.ts";
export class LoaderImpl implements Loader {
// ...
}
|
Hm. export { ContextBuilder } from "./context.ts"; can be removed in
can be removed in NOTE: Both |
Hm...
export type OnInitArguments<Params extends BaseSourceParams> = {
denops: Denops;
sourceOptions: SourceOptions;
sourceParams: Params;
loader: Loader;
};
export type OnEventArguments<Params extends BaseSourceParams> = {
denops: Denops;
sourceOptions: SourceOptions;
sourceParams: Params;
event: DduEvent;
};
export type GatherArguments<Params extends BaseSourceParams> = {
denops: Denops;
context: Context;
options: DduOptions;
sourceOptions: SourceOptions;
sourceParams: Params;
input: string;
parent?: DduItem;
loader: Loader;
}; You can split the file. |
Why |
https://github.com/4513ECHO/ddu-source-source/blob/main/denops/%40ddu-sources/source.ts Hm... |
9d77ebf
to
3418b06
Compare
Remaining circular references:
If we move the definition of |
This dependency was added at 3202e53. Why |
Because user actions want to use ddu like this. args.contextBuilder.patchGlobal({
ui: "ff",
profile: false,
uiOptions: {
ff: {
actions: {
kensaku: async (args: {
denops: Denops;
ddu: Ddu;
}) => {
args.ddu.updateOptions({
sourceOptions: {
_: {
matchers: ["matcher_kensaku"],
},
},
});
await args.denops.cmd("echomsg 'change to kensaku matcher'");
return ActionFlags.Persist;
},
},
},
filer: {
toggle: true,
},
}, Hm... It should use denops dispatcher instead. |
This pull request is now ready to use now. Current dependencies graph: |
OK. |
WIP
Need to discuss:
Base*
classes andBase*Params
types from types.ts?Base*Params
types to types.ts and import them frombase/*.ts
?Current dependencies graph: