дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-04 09:11:10 +02:00
perf(mid): resolve no-await-in-loop in five feature groups (#5774)
Clears the no-await-in-loop diagnostics in analysis, platform, project-tree, http-client and debugger and turns the rule on there. Independent directory walks (Reformat/cleanup targets, batches of 8; the result is sorted as before), Spring config reads (parsed in candidate order, so the first file with a value still wins) and Python package __init__.py creation now run in parallel; every other loop is intentionally sequential and carries a documented suppression. Co-authored-by: akbar1214 <[email protected]>
Цей коміт міститься в:
1 джерело
9ecef0ef0f
коміт
4a18d4d205
40 files changed
+142
-21
No files matched your search
+11
-1
@@ -158,7 +158,17 @@
|
||||
"src/features/run/**/*.ts",
|
||||
"src/features/run/**/*.tsx",
|
||||
"src/features/database/**/*.ts",
|
||||
"src/features/database/**/*.tsx"
|
||||
"src/features/database/**/*.tsx",
|
||||
"src/features/analysis/**/*.ts",
|
||||
"src/features/analysis/**/*.tsx",
|
||||
"src/features/project-tree/**/*.ts",
|
||||
"src/features/project-tree/**/*.tsx",
|
||||
"src/features/http-client/**/*.ts",
|
||||
"src/features/http-client/**/*.tsx",
|
||||
"src/platform/**/*.ts",
|
||||
"src/platform/**/*.tsx",
|
||||
"src/features/debugger/**/*.ts",
|
||||
"src/features/debugger/**/*.tsx"
|
||||
],
|
||||
"rules": {
|
||||
"no-await-in-loop": "error"
|
||||
|
||||
@@ -49,6 +49,7 @@ export async function walkFiles(
|
||||
while (queue.length && out.length < limit) {
|
||||
let entries: FileEntry[];
|
||||
try {
|
||||
// oxlint-disable-next-line no-await-in-loop -- BFS stops at the file limit; each read supplies the next queue entries
|
||||
entries = await readDir(queue.shift()!);
|
||||
} catch {
|
||||
continue;
|
||||
@@ -143,10 +144,13 @@ async function runOverFiles(
|
||||
done: false,
|
||||
cancel: () => (run.cancelled = true),
|
||||
});
|
||||
// oxlint-disable-next-line no-await-in-loop -- cleanup runs one file at a time so cancel, progress and open/close state stay ordered
|
||||
const result = await cleanupFile(path, options);
|
||||
if (result?.applied) summary.formatted++;
|
||||
if (result?.noFormatter) summary.noFormatter.push(path);
|
||||
// oxlint-disable-next-line no-await-in-loop -- save the file just cleaned before its tab is closed
|
||||
await saveCleaned(path);
|
||||
// oxlint-disable-next-line no-await-in-loop -- a refused close cancels the run; editors must settle before the next file
|
||||
if (!wasOpen.has(path) && (await editors?.closePath?.(path)) === false) {
|
||||
run.cancelled = true;
|
||||
break;
|
||||
@@ -266,13 +270,17 @@ export async function reformatTargets(
|
||||
const mask = maskMatcher(options.mask);
|
||||
const accept = (p: string) => sources.isText(p) && mask(nameOf(p));
|
||||
const found = new Set<string>();
|
||||
for (const t of targets) {
|
||||
if (!t.dir) {
|
||||
if (mask(nameOf(t.path))) found.add(t.path);
|
||||
continue;
|
||||
}
|
||||
for (const p of await walkFiles(t.path, sources.readDir, accept, { recursive: options.recursive })) found.add(p);
|
||||
for (const t of targets) if (!t.dir && mask(nameOf(t.path))) found.add(t.path);
|
||||
const dirs = targets.filter((t) => t.dir);
|
||||
const walked: string[][] = [];
|
||||
for (let i = 0; i < dirs.length; i += 8) {
|
||||
// oxlint-disable-next-line no-await-in-loop -- bound concurrent walks; results are merged in target order
|
||||
const batch = await Promise.all(
|
||||
dirs.slice(i, i + 8).map((t) => walkFiles(t.path, sources.readDir, accept, { recursive: options.recursive })),
|
||||
);
|
||||
walked.push(...batch);
|
||||
}
|
||||
for (const paths of walked) for (const p of paths) found.add(p);
|
||||
if (options.changedTextOnly) {
|
||||
const changed = new Set(await sources.changedFiles());
|
||||
for (const p of found) if (!changed.has(p)) found.delete(p);
|
||||
|
||||
@@ -452,6 +452,7 @@ it("leaves test code alone", async () => {
|
||||
expect(await testMethod.run()).toEqual([]);
|
||||
for (const path of ["/p/tests/test_a.py", "/p/a_test.py", "/p/conftest.py"]) {
|
||||
const testFile = new Fixture(path).add(path, [{ name: "Helpers", line: 0, bases: [], methods: [helper] }]);
|
||||
// oxlint-disable-next-line no-await-in-loop -- assertions stay in path order so a failure names the exact test file
|
||||
expect(await testFile.run()).toEqual([]);
|
||||
}
|
||||
});
|
||||
@@ -140,6 +140,7 @@ class ProjectView {
|
||||
const decl = this.declarationOf(facts);
|
||||
if (!decl) continue;
|
||||
const item = classItem(this.deps.outline, facts);
|
||||
// oxlint-disable-next-line no-await-in-loop -- classes stay in declaration order while ancestryOf fills the shared memo cache
|
||||
const { firstUnresolvedDepth } = await this.ancestryOf(decl);
|
||||
out.push({ decl, facts, members: memberNames(item), firstUnresolvedDepth });
|
||||
}
|
||||
@@ -177,6 +178,7 @@ class ProjectView {
|
||||
const key = declarationKey(sub);
|
||||
if (seen.has(key)) continue;
|
||||
seen.add(key);
|
||||
// oxlint-disable-next-line no-await-in-loop -- BFS with a shared `seen` set; the first subclass declaring the name ends the search
|
||||
if ((await this.membersOf(sub)).has(name) || (await this.methodsOf(sub)).some((m) => m.name === name))
|
||||
return true;
|
||||
queue.push(sub);
|
||||
@@ -263,13 +265,18 @@ export async function inheritanceDiagnostics(deps: InheritanceInspectionDeps): P
|
||||
// A class whose header changed since the graph was indexed is skipped: every rule
|
||||
// below would reason about a parent the source no longer names.
|
||||
if (!sameNames(cls.facts.bases, cls.decl.bases)) continue;
|
||||
// oxlint-disable-next-line no-await-in-loop -- ordered analysis pass; diagnostics append in producer order
|
||||
if (runs(PYTHON_CIRCULAR_BASES_PRODUCER)) out.push(...(await circularInheritance(view, cls)));
|
||||
// A method may live on any ancestor: only a fully known chain can say it does not.
|
||||
// oxlint-disable-next-line no-await-in-loop -- ordered analysis pass; diagnostics append in producer order
|
||||
if (runs(PYTHON_OVERRIDE_PRODUCER) && view.complete(cls)) out.push(...(await unusedOverride(view, cls)));
|
||||
// oxlint-disable-next-line no-await-in-loop -- ordered analysis pass; diagnostics append in producer order
|
||||
if (runs(PYTHON_REDUNDANT_OVERRIDE_PRODUCER)) out.push(...(await redundantOverride(view, cls)));
|
||||
// oxlint-disable-next-line no-await-in-loop -- ordered analysis pass; diagnostics append in producer order
|
||||
if (runs(PYTHON_ABSTRACT_METHOD_PRODUCER)) out.push(...(await missingAbstractMethods(view, cls)));
|
||||
// A method may override one a foreign base declares: only a fully known chain can say it does not.
|
||||
if (runs(PYTHON_METHOD_MAY_BE_STATIC_PRODUCER) && view.complete(cls))
|
||||
// oxlint-disable-next-line no-await-in-loop -- ordered analysis pass; diagnostics append in producer order
|
||||
out.push(...(await mayBeStatic(view, cls, deps.path)));
|
||||
}
|
||||
return out;
|
||||
@@ -294,6 +301,7 @@ async function unusedOverride(view: ProjectView, cls: ClassView): Promise<Diagno
|
||||
const out: Diagnostic[] = [];
|
||||
for (const method of cls.facts.methods) {
|
||||
if (!method.overrideDecorated || isDunder(method.name)) continue;
|
||||
// oxlint-disable-next-line no-await-in-loop -- one method at a time so diagnostics keep declaration order; the memoised view is concurrency-safe
|
||||
if (await declaredInAncestry(view, cls, method.name)) continue;
|
||||
out.push(
|
||||
problem(
|
||||
@@ -320,6 +328,7 @@ async function mayBeStatic(view: ProjectView, cls: ClassView, path: string): Pro
|
||||
const out: Diagnostic[] = [];
|
||||
for (const method of cls.facts.methods) {
|
||||
if (!method.unusedReceiver || method.name.startsWith("test")) continue;
|
||||
// oxlint-disable-next-line no-await-in-loop -- ancestry checks share the memoised view; the first hit skips this method
|
||||
if ((await declaredInAncestry(view, cls, method.name)) || (await view.overriddenBelow(cls, method.name))) continue;
|
||||
out.push(
|
||||
problem(
|
||||
@@ -344,9 +353,11 @@ async function missingAbstractMethods(view: ProjectView, cls: ClassView): Promis
|
||||
for (const ancestor of await view.ancestors(cls)) {
|
||||
// A foreign base above the declarer cannot override it: Python's MRO puts it later.
|
||||
if (!view.knownTo(cls, ancestor.depth - 1)) continue;
|
||||
// oxlint-disable-next-line no-await-in-loop -- ancestor methods are read in MRO order into the shared `reported` set
|
||||
for (const method of await view.methodsOf(ancestor.decl)) {
|
||||
const name = method.name;
|
||||
if (!method.abstractMethod || reported.has(name) || cls.members.has(name)) continue;
|
||||
// oxlint-disable-next-line no-await-in-loop -- the nearest concrete implementation wins; later ancestors are still in MRO order
|
||||
if (await implementedAbove(view, cls, ancestor.depth, name)) continue;
|
||||
reported.add(name);
|
||||
out.push(
|
||||
@@ -372,8 +383,10 @@ async function implementedAbove(
|
||||
for (const ancestor of await view.ancestors(cls)) {
|
||||
if (ancestor.depth >= declarerDepth) return false;
|
||||
if (!view.knownTo(cls, ancestor.depth - 1)) return true;
|
||||
// oxlint-disable-next-line no-await-in-loop -- nearest ancestor first; a method found here returns before reading further
|
||||
const method = (await view.methodsOf(ancestor.decl)).find((m) => m.name === name);
|
||||
if (method) return !method.abstractMethod;
|
||||
// oxlint-disable-next-line no-await-in-loop -- an attribute on a nearer ancestor resolves the search immediately
|
||||
if ((await view.membersOf(ancestor.decl)).has(name)) return true;
|
||||
}
|
||||
return false;
|
||||
@@ -383,6 +396,7 @@ async function implementedAbove(
|
||||
async function redundantOverride(view: ProjectView, cls: ClassView): Promise<Diagnostic[]> {
|
||||
const out: Diagnostic[] = [];
|
||||
for (const method of cls.facts.methods) {
|
||||
// oxlint-disable-next-line no-await-in-loop -- one method at a time so diagnostics keep declaration order; the memoised view is concurrency-safe
|
||||
const inherited = await inheritedMethod(view, cls, method.name);
|
||||
// A foreign base below the declarer cannot change which method runs: MRO puts it later.
|
||||
if (!inherited || !view.knownTo(cls, inherited.depth)) continue;
|
||||
@@ -422,6 +436,7 @@ async function inheritedMethod(
|
||||
name: string,
|
||||
): Promise<{ method: PythonMethodFacts; depth: number } | null> {
|
||||
for (const ancestor of await view.ancestors(cls)) {
|
||||
// oxlint-disable-next-line no-await-in-loop -- nearest ancestor wins; stop at the first declaration found
|
||||
const found = (await view.methodsOf(ancestor.decl)).find((m) => m.name === name);
|
||||
if (found) return { method: found, depth: ancestor.depth };
|
||||
}
|
||||
@@ -431,7 +446,9 @@ async function inheritedMethod(
|
||||
/** Whether any ancestor declares `name`, as a member or a method. */
|
||||
async function declaredInAncestry(view: ProjectView, cls: ClassView, name: string): Promise<boolean> {
|
||||
for (const ancestor of await view.ancestors(cls)) {
|
||||
// oxlint-disable-next-line no-await-in-loop -- nearest ancestor first; the first declaration ends the search
|
||||
if ((await view.membersOf(ancestor.decl)).has(name)) return true;
|
||||
// oxlint-disable-next-line no-await-in-loop -- only reached when the nearer ancestor had no such member
|
||||
if ((await view.methodsOf(ancestor.decl)).some((m) => m.name === name)) return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -463,6 +463,7 @@ describe("debugger actions (IDEA parity)", () => {
|
||||
for (const action of ["debug.toggleBreakpoint", "debug.toggleTemporaryBreakpoint"]) {
|
||||
for (const line of [1, 2]) {
|
||||
caret("/p/a.py", "python", "x = 1\n\n \ny = 2", line);
|
||||
// oxlint-disable-next-line no-await-in-loop -- caret setup and the breakpoint assertion share editor/breakpoint state, so each action must run before the next caret change
|
||||
await executeAction(action);
|
||||
}
|
||||
expect(breakpointsOf("/p/a.py"), action).toHaveLength(0);
|
||||
|
||||
@@ -154,6 +154,7 @@ describe("Java debugging (java-debug through jdtls)", () => {
|
||||
it("lets java-debug shorten a classpath too long for the OS, as Run does", async () => {
|
||||
for (const how of ["jarmanifest", "argfile"]) {
|
||||
shortenCommandLine = how;
|
||||
// oxlint-disable-next-line no-await-in-loop -- shortenCommandLine is shared module state set per iteration; the assertion must follow the launch that used it
|
||||
const l = await javaLaunchConfig(app, "/p");
|
||||
expect(JSON.parse(l.extraJson!).shortenCommandLine).toBe(how);
|
||||
}
|
||||
@@ -229,6 +230,7 @@ it.each(["sibling", "/outside/modules"])("debugs from %s with the main class mod
|
||||
kotlinFiles = false;
|
||||
for (const module of ["api", undefined]) {
|
||||
invoked.length = 0;
|
||||
// oxlint-disable-next-line no-await-in-loop -- invoked is a shared call log reset each iteration; the assertions must follow the matching launch
|
||||
const launch = await javaLaunchConfig({ ...app, module, cwd }, "/p");
|
||||
expect(invoked).toContainEqual(["javaResolveLaunch", ["api", false, "automatic", expect.any(Number)]]);
|
||||
expect(invoked).toContainEqual(["javaDebugServer", ["api"]]);
|
||||
@@ -281,6 +283,7 @@ describe("the debugger for a build tool's JVMs", () => {
|
||||
try {
|
||||
for (const missing of [[], ["kotlin-debug-adapter"], ["kotlin-lsp"]]) {
|
||||
missingTools = missing;
|
||||
// oxlint-disable-next-line no-await-in-loop -- missingTools is shared state changed per iteration; each assertion must check the matching configuration
|
||||
expect(await jvmAttachDebuggerReady("app", "/p", retry)).toBe(true);
|
||||
}
|
||||
missingTools = ["kotlin-debug-adapter", "kotlin-lsp"];
|
||||
|
||||
@@ -112,6 +112,7 @@ describe("watches while the program runs", () => {
|
||||
];
|
||||
for (const [s, visible] of quiet) {
|
||||
const { result, unmount } = renderHook(() => useLiveWatches(s, ["a"], visible));
|
||||
// oxlint-disable-next-line no-await-in-loop -- fake timers and the hook under test are per iteration; the assertion and unmount must follow this advance
|
||||
await act(async () => void (await vi.advanceTimersByTimeAsync(2500)));
|
||||
expect(result.current).toEqual([]);
|
||||
unmount();
|
||||
|
||||
@@ -73,10 +73,14 @@ it.each([undefined, true, false])(
|
||||
const show = vi.fn();
|
||||
provideToolWindowService({ show } as unknown as ToolWindowService);
|
||||
if (prepared) {
|
||||
// oxlint-disable-next-line no-await-in-loop -- prepared and direct starts share tool-window/session state; the show assertion must follow this start
|
||||
await startPreparedSession({ id: "java", name: "Java" } as never, async () => config("launch"), {
|
||||
show: foreground,
|
||||
});
|
||||
} else await startSession(config("launch"), { show: foreground });
|
||||
} else {
|
||||
// oxlint-disable-next-line no-await-in-loop -- prepared and direct starts share tool-window/session state; the show assertion must follow this start
|
||||
await startSession(config("launch"), { show: foreground });
|
||||
}
|
||||
if (showOnStart && foreground !== false) expect(show).toHaveBeenCalledWith("debug");
|
||||
else expect(show).not.toHaveBeenCalled();
|
||||
}
|
||||
|
||||
@@ -125,6 +125,7 @@ async function drainBreakpoints() {
|
||||
while (paths.size) {
|
||||
for (const timer of timers.values()) clearTimeout(timer);
|
||||
timers.clear();
|
||||
// oxlint-disable-next-line no-await-in-loop -- the debounce drain must repeat: syncing can schedule new timers, so the next batch is recomputed only after this one settles
|
||||
await Promise.all([...paths].map((path) => syncFile(path)));
|
||||
paths = new Set([...timers.keys(), ...inFlight.keys()]);
|
||||
}
|
||||
|
||||
@@ -183,12 +183,14 @@ export async function evaluateWithImports(
|
||||
const known = importsOf(sessionId);
|
||||
for (let round = 0; ; round++) {
|
||||
try {
|
||||
// oxlint-disable-next-line no-await-in-loop -- retry loop: the next attempt runs only after this one fails and imports discovered so far are applied
|
||||
return await run(qualify(expression, known));
|
||||
} catch (e) {
|
||||
const names = unresolvedNames(messageOf(e)).filter((name) => !known.has(name));
|
||||
if (round >= MAX_ROUNDS || !names.length) throw e;
|
||||
let added = false;
|
||||
for (const name of names) {
|
||||
// oxlint-disable-next-line no-await-in-loop -- lookups are processed in name order to keep the first ambiguity and the shared imports map deterministic
|
||||
const candidates = await find(name).catch(() => []);
|
||||
if (candidates.length > 1) throw new AmbiguousClassError(name, candidates, messageOf(e));
|
||||
if (candidates.length === 1) {
|
||||
|
||||
@@ -53,6 +53,7 @@ async function sourceRoots(s: DebugSession): Promise<string[]> {
|
||||
let dir = start;
|
||||
for (let depth = 0; depth < MAX_PACKAGE_DEPTH; depth++) {
|
||||
const file = `${dir}/.dart_tool/package_config.json`;
|
||||
// oxlint-disable-next-line no-await-in-loop -- directory walk depends on the previous step and stops at the first config found
|
||||
const text = await call(commands.fsReadText(file)).catch(() => null);
|
||||
if (text !== null) {
|
||||
try {
|
||||
|
||||
@@ -146,6 +146,7 @@ export async function reloadChangedClasses(build = true, configId?: string, allo
|
||||
});
|
||||
let status: "cancelled" | "failed" | "succeeded" | "withErrors" | null = null;
|
||||
try {
|
||||
// oxlint-disable-next-line no-await-in-loop -- builds run one module at a time against the shared activeBuild/cancel state and UI context; cancellation aborts the whole reload
|
||||
status = await call(commands.javaBuildWorkspace(module, request));
|
||||
} catch (e) {
|
||||
status = isCancelled(e) ? "cancelled" : null;
|
||||
@@ -199,6 +200,7 @@ export async function reloadChangedClasses(build = true, configId?: string, allo
|
||||
const obsolete: DebugSessionId[] = [];
|
||||
for (const s of sessions) {
|
||||
try {
|
||||
// oxlint-disable-next-line no-await-in-loop -- redefines run in session order; errors and obsolete-session results are aggregated in that order for the notification
|
||||
const r = await call(commands.debugRedefineClasses(s.id));
|
||||
r.changedClasses.forEach((c) => changed.add(c));
|
||||
if (r.errorMessage) {
|
||||
|
||||
@@ -73,6 +73,7 @@ export async function moduleHasKotlinSources(cwd: string): Promise<boolean> {
|
||||
const pending = [join(cwd, "src")];
|
||||
while (pending.length) {
|
||||
const path = pending.pop()!;
|
||||
// oxlint-disable-next-line no-await-in-loop -- source-set traversal uses a shared pending stack and returns as soon as a .kt file is found
|
||||
const entries = await call(commands.fsReadDir(path)).catch(() => []);
|
||||
for (const entry of entries) {
|
||||
if (entry.excluded) continue;
|
||||
|
||||
@@ -1251,6 +1251,7 @@ async function logSuspendingHit(id: DebugSessionId, frame: StackFrame) {
|
||||
const bp = breakpointsOf(frame.path!).find((b) => b.line === frame.line && b.enabled);
|
||||
if (!bp || !suspends(bp)) return;
|
||||
for (const part of logParts(bp, frame.path!)) {
|
||||
// oxlint-disable-next-line no-await-in-loop -- console lines must be appended in log-part order
|
||||
const text = await interpolateLog(part, async (expr) => {
|
||||
const v = await call(commands.debugEvaluateIn(id, frame.id, expr, "repl"));
|
||||
return v.value;
|
||||
|
||||
@@ -43,6 +43,7 @@ export async function valueText(
|
||||
// A lazy child's reference holds its uncomputed value, not its contents.
|
||||
if (ref > 0 && !child.lazy && !path.has(ref)) {
|
||||
path.add(ref);
|
||||
// oxlint-disable-next-line no-await-in-loop -- shared cycle-detection path and line order require children to be walked one at a time
|
||||
await walk(ref, depth + 1);
|
||||
path.delete(ref);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ export function registerFileNavigation(): () => void {
|
||||
if (!at) return null;
|
||||
const candidates = at.response ? [`/.idea/httpRequests/${at.value}`, at.value] : [at.value];
|
||||
for (const value of candidates) {
|
||||
// oxlint-disable-next-line no-await-in-loop -- candidates are fallbacks; the first resolvable path wins
|
||||
const path = await call(commands.fsResolveReference(doc.path, value)).catch(() => null);
|
||||
if (path) {
|
||||
const start = { line: 0, col: 0 };
|
||||
|
||||
@@ -102,6 +102,7 @@ export class ConstantPool {
|
||||
if (this.classes.has(name) && !this.pending.has(name)) continue;
|
||||
if (!this.pending.has(name) && this.classes.size >= MAX_CLASSES) continue;
|
||||
const isNew = !this.pending.has(name);
|
||||
// oxlint-disable-next-line no-await-in-loop -- lookup seeds classes/pending and the loaded file drives the next breadth-first round
|
||||
const loaded = await this.lookup(name, file);
|
||||
if (!loaded) continue;
|
||||
added = true;
|
||||
@@ -137,10 +138,12 @@ export class ConstantPool {
|
||||
const imported = from.imports.find((i) => i.endsWith(`.${name}`) || i.includes(`.${name}.`));
|
||||
const pkg = imported ? imported.slice(0, imported.indexOf(`.${name}`)) : from.packageName;
|
||||
for (const ext of EXTENSIONS) {
|
||||
// oxlint-disable-next-line no-await-in-loop -- .java is tried before .kt; stop once an extension has a candidate
|
||||
const paths = (await this.files.filesNamed(`${name}${ext}`)).map((p) => p.replace(/\\/g, "/"));
|
||||
if (!paths.length) continue;
|
||||
const suffix = `/${pkg.replace(/\./g, "/")}/${name}${ext}`;
|
||||
const path = paths.find((p) => p.endsWith(suffix)) ?? paths[0]!;
|
||||
// oxlint-disable-next-line no-await-in-loop -- a missing or unreadable file falls through to the next candidate
|
||||
const text = await this.files.read(path);
|
||||
if (text != null) return parseSource(text);
|
||||
}
|
||||
|
||||
@@ -105,6 +105,7 @@ describe("core service-aware Feign navigation", () => {
|
||||
await resolve();
|
||||
for (let version = 2; version < 6; version++) {
|
||||
_emitEditorEvent({ type: "docChanged", doc: 9, path: users, baseVersion: version - 1, version, changes: [] });
|
||||
// oxlint-disable-next-line no-await-in-loop -- each emitted edit must be revalidated before the next edit
|
||||
await resolve();
|
||||
}
|
||||
expect(commands.springRouteSources).toHaveBeenCalledTimes(1);
|
||||
|
||||
@@ -116,6 +116,7 @@ async function* currentMappings<T extends MappedMethod>(
|
||||
paths.add(path);
|
||||
for (const path of [...paths].sort()) {
|
||||
if (scope.stale()) return;
|
||||
// oxlint-disable-next-line no-await-in-loop -- yields one parsed file at a time; staleness is checked before and after the read
|
||||
const text = await read(path).catch(() => null);
|
||||
if (scope.stale()) return;
|
||||
if (text === null || text.length > MAX_NAVIGATION_SOURCE) continue;
|
||||
|
||||
@@ -208,10 +208,13 @@ export function configCandidates(sourcePath: string, projectRoot: string | null,
|
||||
|
||||
export async function findHost(sourcePath: string, projectRoot: string | null, fs: SourceReader): Promise<string> {
|
||||
const read = async (paths: string[]) => {
|
||||
// Independent reads: collect them together, then parse in candidate order so the first file with a value still wins.
|
||||
const texts = await Promise.all(paths.map((path) => fs.read(path).catch(() => null)));
|
||||
const configs: Map<string, string>[] = [];
|
||||
for (const path of paths) {
|
||||
const text = await fs.read(path).catch(() => null);
|
||||
if (text !== null) configs.push(path.endsWith(".properties") ? parseProperties(text) : parseYaml(text));
|
||||
for (const [i, text] of texts.entries()) {
|
||||
if (text === null) continue;
|
||||
const path = paths[i]!;
|
||||
configs.push(path.endsWith(".properties") ? parseProperties(text) : parseYaml(text));
|
||||
}
|
||||
return configs;
|
||||
};
|
||||
@@ -276,6 +279,7 @@ export async function bodyLookup(
|
||||
const dirs = new Set([...packages.map((p) => (p ? `${root}/${p.replace(/\./g, "/")}` : root)), dirname(from.path)]);
|
||||
for (const d of dirs)
|
||||
for (const x of ext) {
|
||||
// oxlint-disable-next-line no-await-in-loop -- stop at the first candidate that exists; readAt feeds the shared class map
|
||||
const loaded = await readAt(`${d}/${name}${x}`);
|
||||
if (loaded) return loaded;
|
||||
}
|
||||
@@ -283,8 +287,10 @@ export async function bodyLookup(
|
||||
if (!fs.filesNamed) return null;
|
||||
const suffixes = packages.map((p) => `/${p ? `${p.replace(/\./g, "/")}/` : ""}${name}`);
|
||||
for (const x of ext) {
|
||||
// oxlint-disable-next-line no-await-in-loop -- .java/.kt candidates are tried in order; a hit skips the remaining extensions
|
||||
const paths = (await fs.filesNamed(`${name}${x}`).catch(() => [])).map((p) => p.replace(/\\/g, "/"));
|
||||
const path = paths.find((p) => suffixes.some((s) => p.endsWith(`${s}${x}`)));
|
||||
// oxlint-disable-next-line no-await-in-loop -- stop at the first matching file in an imported package
|
||||
const loaded = path ? await readAt(path) : null;
|
||||
if (loaded) return loaded;
|
||||
}
|
||||
@@ -297,17 +303,21 @@ export async function bodyLookup(
|
||||
let [current, at]: [string | undefined, Origin | null] = [name, from];
|
||||
while (current && at && !seen.has(current) && seen.size < MAX_SUPERCLASSES) {
|
||||
seen.add(current);
|
||||
// oxlint-disable-next-line no-await-in-loop -- each superclass comes from the class resolved in the previous iteration
|
||||
const loaded = await load(current, at);
|
||||
const c = known.get(current);
|
||||
if (!c || !loaded) break;
|
||||
if (depth > 0)
|
||||
for (const p of [...c.ctorParams, ...c.fields.filter((f) => !f.isStatic)])
|
||||
// oxlint-disable-next-line no-await-in-loop -- property types share the known/origins maps and the depth budget
|
||||
await loadWithProperties(typeName(p.type), loaded, depth - 1);
|
||||
[current, at] = [c.superclass && typeName(c.superclass), loaded];
|
||||
}
|
||||
};
|
||||
const names = new Set(endpoints.flatMap((e) => (e.bodyType ? [typeName(e.bodyType)] : [])));
|
||||
for (const n of names) await loadWithProperties(n, origin, 1);
|
||||
for (const n of names)
|
||||
// oxlint-disable-next-line no-await-in-loop -- body types share the known/origins maps
|
||||
await loadWithProperties(n, origin, 1);
|
||||
return (name) => known.get(name) ?? null;
|
||||
}
|
||||
|
||||
|
||||
@@ -53,6 +53,7 @@ describe("source-declared Spring service identity", () => {
|
||||
"application-dev.properties": "spring.application.name=users\n",
|
||||
},
|
||||
] as Record<string, string>[])
|
||||
// oxlint-disable-next-line no-await-in-loop -- the test asserts each configuration sample in order
|
||||
expect(await loadServiceName("/p/users", reader(configs))).toBe("users");
|
||||
expect(sourceModule("D:\\p\\users\\src\\main\\kotlin\\Users.kt")).toBe("D:/p/users");
|
||||
expect(sourceModule("/p/users/child/src/main/java/C.java")).toBe("/p/users/child");
|
||||
@@ -104,6 +105,7 @@ describe("source-declared Spring service identity", () => {
|
||||
},
|
||||
];
|
||||
for (const configs of samples)
|
||||
// oxlint-disable-next-line no-await-in-loop -- the test asserts each sample with its own message before the next one
|
||||
expect(await loadServiceName("/p/users", reader(configs)), JSON.stringify(configs)).toBeNull();
|
||||
});
|
||||
|
||||
@@ -120,6 +122,7 @@ describe("source-declared Spring service identity", () => {
|
||||
r.read = async () => {
|
||||
throw new Error("Must not be read");
|
||||
};
|
||||
// oxlint-disable-next-line no-await-in-loop -- each override is asserted in order with its own reader
|
||||
expect(await loadServiceName("/p/users", r)).toBeNull();
|
||||
}
|
||||
const denied = reader(configs);
|
||||
@@ -136,6 +139,7 @@ describe("source-declared Spring service identity", () => {
|
||||
const list = r.directory;
|
||||
r.directory = vi.fn(async (path) => (await list(path)).map((file) => ({ ...file, ...entry }) as FileEntry));
|
||||
r.read = vi.fn();
|
||||
// oxlint-disable-next-line no-await-in-loop -- each override is asserted in order with fresh spies
|
||||
expect(await loadServiceName("/p/users", r)).toBeNull();
|
||||
expect(r.directory).toHaveBeenCalledTimes(1);
|
||||
expect(r.read).not.toHaveBeenCalled();
|
||||
|
||||
@@ -88,6 +88,7 @@ export async function loadServiceName(module: string, reader: ServiceReader): Pr
|
||||
if (entry.kind !== "dir" || entry.ignored || entry.excluded || ipcPath(entry.path) !== directory) return null;
|
||||
let entries: FileEntry[];
|
||||
try {
|
||||
// oxlint-disable-next-line no-await-in-loop -- resources then config: each inventory comes from the previous directory's entries
|
||||
entries = await reader.directory(directory);
|
||||
} catch (error) {
|
||||
if (isErrorKind(error, "notFound")) continue;
|
||||
@@ -109,6 +110,7 @@ export async function loadServiceName(module: string, reader: ServiceReader): Pr
|
||||
return null;
|
||||
let text: string;
|
||||
try {
|
||||
// oxlint-disable-next-line no-await-in-loop -- per-file caps and read failures short-circuit; rejected entries must not be read
|
||||
text = await reader.read(file.path);
|
||||
} catch {
|
||||
return null;
|
||||
|
||||
@@ -104,6 +104,7 @@ function response(id: string): HttpExchange {
|
||||
it("keeps 100 history rows and the four most recently used exchanges", async () => {
|
||||
for (let n = 0; n < 101; n++) {
|
||||
backend.httpExecute.mockResolvedValueOnce(ok(response(String(n))));
|
||||
// oxlint-disable-next-line no-await-in-loop -- each request mutates the shared history/exchanges store in order
|
||||
await runRequest(null, text, 0);
|
||||
}
|
||||
const state = useHttpClient.getState();
|
||||
|
||||
@@ -236,6 +236,7 @@ export async function runAll(path: string | null, text: string): Promise<void> {
|
||||
if (path && !useHttpClient.getState().environments[path]) await loadEnvironments(path);
|
||||
const environment = effectiveEnvironment(path, selection);
|
||||
for (const b of blocks) {
|
||||
// oxlint-disable-next-line no-await-in-loop -- requests run in order and stop at the first failure
|
||||
if (!(await runRequest(path, text, b.index, environment))) return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -433,6 +433,7 @@ describe("ProjectView", () => {
|
||||
burst(clicks);
|
||||
const toggles = singleClickExpand ? Math.ceil(clicks / 2) : Math.floor(clicks / 2);
|
||||
if (toggles % 2) expanded = !expanded;
|
||||
// oxlint-disable-next-line no-await-in-loop -- each click burst is asserted before the next burst is fired
|
||||
await waitFor(() => expect(rows().includes("App.kt")).toBe(expanded));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,11 +77,13 @@ export function memoryRefactorBackend(): FileRefactorBackend {
|
||||
const done: FileMove[] = [];
|
||||
try {
|
||||
for (const m of moves) {
|
||||
// oxlint-disable-next-line no-await-in-loop -- moves apply in order; a failure rolls back only the completed ones
|
||||
await fs().rename(m.from, m.to);
|
||||
done.push(m);
|
||||
}
|
||||
} catch (e) {
|
||||
for (const m of done.reverse())
|
||||
// oxlint-disable-next-line no-await-in-loop -- rollback undoes the completed moves in reverse order
|
||||
await fs()
|
||||
.rename(m.to, m.from)
|
||||
.catch(() => {});
|
||||
@@ -95,7 +97,9 @@ export function memoryRefactorBackend(): FileRefactorBackend {
|
||||
if (!moves) throw new Error("The refactoring can no longer be undone");
|
||||
records.delete(id);
|
||||
const back = [...moves].reverse().map((m) => ({ from: m.to, to: m.from }));
|
||||
for (const m of back) await fs().rename(m.from, m.to);
|
||||
for (const m of back)
|
||||
// oxlint-disable-next-line no-await-in-loop -- undo restores the moves in reverse order
|
||||
await fs().rename(m.from, m.to);
|
||||
return { moves: back, conflicts: [] };
|
||||
},
|
||||
};
|
||||
|
||||
@@ -37,6 +37,7 @@ export async function markDirectory(path: string, role: FolderRole | null): Prom
|
||||
const next = markFolder(attached.structure, rel, role, attached.detected);
|
||||
for (const key of PROJECT_STRUCTURE_KEYS) {
|
||||
if (JSON.stringify(attached.structure[key]) !== JSON.stringify(next[key])) {
|
||||
// oxlint-disable-next-line no-await-in-loop -- settings keys are written in order to the same member settings
|
||||
await call(
|
||||
commands.projectWorkspaceMemberSet(attached.root, `projectStructure.${key}`, JSON.stringify(next[key])),
|
||||
);
|
||||
@@ -50,6 +51,7 @@ export async function markDirectory(path: string, role: FolderRole | null): Prom
|
||||
const next = markFolder(before, rel, role, currentDetectedRoots());
|
||||
for (const key of PROJECT_STRUCTURE_KEYS) {
|
||||
if (JSON.stringify(before[key]) !== JSON.stringify(next[key])) {
|
||||
// oxlint-disable-next-line no-await-in-loop -- settings keys are written in order to the same project settings
|
||||
await call(commands.settingsSet("project", `projectStructure.${key}`, JSON.stringify(next[key])));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,8 +164,8 @@ describe("OS file imports", () => {
|
||||
});
|
||||
const imported = vi.spyOn(fs, "importLocal");
|
||||
for (let i = 0; i < 2; i++) {
|
||||
if (entry === "paste") await paste("/p/target");
|
||||
else await importExternal(["/p/local.txt"], "/p/target");
|
||||
// oxlint-disable-next-line no-await-in-loop -- the second attempt must see the conflict state left by the first
|
||||
await (entry === "paste" ? paste("/p/target") : importExternal(["/p/local.txt"], "/p/target"));
|
||||
}
|
||||
expect(imported.mock.calls).toEqual([
|
||||
["/p/local.txt", "/p/target/local.txt", expect.anything()],
|
||||
|
||||
@@ -166,7 +166,9 @@ export function selectedFiles(): ProjectNode[] {
|
||||
|
||||
/** Open in Right Split (⇧Enter): the selected files in the pane right of the current editor. */
|
||||
export async function openSelectionInRightSplit(nodes = selectedFiles()) {
|
||||
for (const [i, n] of nodes.entries()) await openFile(n.path, { side: true, focus: i === nodes.length - 1 });
|
||||
for (const [i, n] of nodes.entries())
|
||||
// oxlint-disable-next-line no-await-in-loop -- files open into the same split in order; the last one takes focus
|
||||
await openFile(n.path, { side: true, focus: i === nodes.length - 1 });
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -304,10 +306,13 @@ export async function commitEditing(name: string): Promise<boolean> {
|
||||
if (editing.nodeKind === "file") await fs.createFile(path);
|
||||
else await fs.createDir(path);
|
||||
// Every folder of a Python package gets an `__init__.py`, as in PyCharm.
|
||||
if (editing.pkg === "python")
|
||||
if (editing.pkg === "python") {
|
||||
const dirs: string[] = [];
|
||||
for (let dir = path; isInside(dir, editing.parent) && dir !== editing.parent; dir = parentOf(dir))
|
||||
// An existing intermediate package keeps its own `__init__.py`.
|
||||
await fs.createFile(joinPath(dir, "__init__.py")).catch(() => {});
|
||||
dirs.push(dir);
|
||||
// Each folder is a distinct path and existing files are left alone, so the writes can run together.
|
||||
await Promise.all(dirs.map((dir) => fs.createFile(joinPath(dir, "__init__.py")).catch(() => {})));
|
||||
}
|
||||
} catch (e) {
|
||||
fail(editing.nodeKind === "file" ? tx("Cannot create file") : tx("Cannot create folder"), e);
|
||||
return true;
|
||||
@@ -331,6 +336,7 @@ export async function commitEditing(name: string): Promise<boolean> {
|
||||
async function refreshAfterCreate(parent: string, path: string) {
|
||||
const dirs = [parent];
|
||||
for (let p = parentOf(path); isInside(p, parent); p = parentOf(p)) dirs.push(p);
|
||||
// oxlint-disable-next-line no-await-in-loop -- reloads mutate shared listings/selection; each folder must settle before the next
|
||||
for (const d of dirs) await loadDir(d, true);
|
||||
}
|
||||
|
||||
@@ -496,6 +502,7 @@ export async function deleteSelection(nodes: ProjectNode[] = selectedNodes()) {
|
||||
const deleted: NonNullable<typeof lastDelete>["items"] = [];
|
||||
for (const p of paths) {
|
||||
try {
|
||||
// oxlint-disable-next-line no-await-in-loop -- deletes run in order; snapshots and errors keep path order for Undo
|
||||
const restore = await fs.delete(p);
|
||||
parents.add(parentOf(p));
|
||||
deleted.push({ path: p, restore });
|
||||
@@ -537,6 +544,7 @@ export async function undoDelete(): Promise<boolean> {
|
||||
for (const { path, restore } of op.items) {
|
||||
if (get().root !== op.root) break;
|
||||
try {
|
||||
// oxlint-disable-next-line no-await-in-loop -- restores run in order and stop as soon as the project changes
|
||||
const skipped = await restore();
|
||||
for (const skippedPath of skipped) failed.add(skippedPath);
|
||||
if (!restored && !skipped.includes(path)) restored = path;
|
||||
@@ -666,6 +674,7 @@ async function pasteImage(target: string): Promise<boolean> {
|
||||
if (taken.has(name)) continue;
|
||||
const path = joinPath(target, name);
|
||||
try {
|
||||
// oxlint-disable-next-line no-await-in-loop -- names are tried one at a time; alreadyExists selects the next name
|
||||
await projectFs(get().root ?? target).createFileBytes(path, png);
|
||||
} catch (e) {
|
||||
// Created since the listing was read: take the next name.
|
||||
@@ -673,6 +682,7 @@ async function pasteImage(target: string): Promise<boolean> {
|
||||
fail(tx`Cannot paste the image into ${name}`, e);
|
||||
return true;
|
||||
}
|
||||
// oxlint-disable-next-line no-await-in-loop -- the listing is refreshed before revealing the successfully saved image
|
||||
await loadDir(target, true);
|
||||
revealPath(path, true);
|
||||
return true;
|
||||
@@ -759,11 +769,15 @@ export async function transfer(
|
||||
const to = joinPath(target, finalName);
|
||||
try {
|
||||
if (source === "local") {
|
||||
// oxlint-disable-next-line no-await-in-loop -- cancellation is checked per source; each import feeds the taken-name set
|
||||
const skipped = await fs.importLocal(src, to, upload);
|
||||
errors.push(...skipped);
|
||||
} else {
|
||||
// oxlint-disable-next-line no-await-in-loop -- copies pick conflict-free names from the shared taken set
|
||||
await fs.copy(src, to);
|
||||
if (!srcIsDir) await renameCopiedJavaType(src, to).catch(() => undefined);
|
||||
if (!srcIsDir)
|
||||
// oxlint-disable-next-line no-await-in-loop -- the Java type rename follows this copy, before the next source
|
||||
await renameCopiedJavaType(src, to).catch(() => undefined);
|
||||
}
|
||||
taken.add(caseInsensitive ? finalName.toLowerCase() : finalName);
|
||||
first ??= to;
|
||||
@@ -895,6 +909,7 @@ export async function revealInFinder(nodes: ProjectNode[] = selectedNodes()) {
|
||||
/** Opens each selected file with the application the OS associates with it. */
|
||||
export async function openWithAssociatedApp(nodes: ProjectNode[] = selectedNodes()) {
|
||||
for (const file of nodes.filter((n) => !n.dir && !n.placeholder)) {
|
||||
// oxlint-disable-next-line no-await-in-loop -- stop at the first file the OS cannot open
|
||||
if (!(await openWithSystemApp(file.path))) {
|
||||
notifications().notify({ level: "error", title: tx`Cannot open ${nameOf(file.path)} with its application` });
|
||||
return;
|
||||
|
||||
@@ -40,6 +40,7 @@ describe("automatic project types", () => {
|
||||
expect(backend.fsReadDir).toHaveBeenCalledTimes(4);
|
||||
while (useProjectTree.getState().projectTypes.size < 9) {
|
||||
pending.splice(0).forEach((resolve) => resolve());
|
||||
// oxlint-disable-next-line no-await-in-loop -- wait for each batch of root reads before releasing the next batch
|
||||
await waitFor(() => expect(pending.length || useProjectTree.getState().projectTypes.size === 9).toBeTruthy());
|
||||
}
|
||||
expect([...useProjectTree.getState().projectTypes.values()]).toEqual(Array(9).fill("go"));
|
||||
|
||||
@@ -215,6 +215,7 @@ describe("applyFsChange reload of many folders", () => {
|
||||
applyFsChange({ created: [], modified: changed.map(filePath), removed: [] }).then(() => void fs),
|
||||
);
|
||||
const single = await run(async () => {
|
||||
// oxlint-disable-next-line no-await-in-loop -- this is the sequential baseline the batched reload is compared against
|
||||
for (const k of changed) await loadDir(dirPath(k), true);
|
||||
});
|
||||
|
||||
|
||||
@@ -923,6 +923,7 @@ export async function expandAll(from?: string, limit = 400) {
|
||||
continue;
|
||||
}
|
||||
const path = pathOfKey(dir);
|
||||
// oxlint-disable-next-line no-await-in-loop -- breadth-first walk loads one folder at a time; generation is checked before enqueuing children
|
||||
await loadDir(path);
|
||||
if (gen !== generation) return;
|
||||
const s = get();
|
||||
|
||||
@@ -262,7 +262,9 @@ describe("project view modes", () => {
|
||||
|
||||
it("shows library folders inside the project in both places, read-only", async () => {
|
||||
const site = "/p/.venv/lib/site-packages";
|
||||
for (const dir of ["/p", "/p/.venv", "/p/.venv/lib", site, `${site}/req`]) await loadDir(dir);
|
||||
for (const dir of ["/p", "/p/.venv", "/p/.venv/lib", site, `${site}/req`])
|
||||
// oxlint-disable-next-line no-await-in-loop -- nested folders are listed in order before the model is asserted
|
||||
await loadDir(dir);
|
||||
const m = currentModel();
|
||||
// Under the project: path keys, read-only from the library root down.
|
||||
const venvKids = m.children.get("/p/.venv")!;
|
||||
|
||||
@@ -71,15 +71,22 @@ export async function closeDocumentWindows(): Promise<boolean> {
|
||||
const result = new Promise<boolean>((resolve) => {
|
||||
finish = resolve;
|
||||
});
|
||||
// oxlint-disable-next-line no-await-in-loop -- subscribe to this child's close result before touching its window
|
||||
const offResult = await parent.listen<AuxCloseResult>(AUX_CLOSED, ({ payload }) => {
|
||||
if (payload.label === child.label && !payload.closed) finish(false);
|
||||
});
|
||||
// oxlint-disable-next-line no-await-in-loop -- register the destroyed listener before showing the window
|
||||
const offDestroyed = await child.once(TauriEvent.WINDOW_DESTROYED, () => finish(true));
|
||||
try {
|
||||
// oxlint-disable-next-line no-await-in-loop -- window lifecycle: unminimize, then show, then focus, then close
|
||||
await child.unminimize();
|
||||
// oxlint-disable-next-line no-await-in-loop -- window lifecycle: unminimize, then show, then focus, then close
|
||||
await child.show();
|
||||
// oxlint-disable-next-line no-await-in-loop -- window lifecycle: unminimize, then show, then focus, then close
|
||||
await child.setFocus();
|
||||
// oxlint-disable-next-line no-await-in-loop -- window lifecycle: unminimize, then show, then focus, then close
|
||||
await child.close();
|
||||
// oxlint-disable-next-line no-await-in-loop -- one window at a time; a cancelled close stops the whole loop
|
||||
if (!(await result)) return false;
|
||||
} finally {
|
||||
offResult();
|
||||
|
||||
@@ -124,6 +124,7 @@ export function globalRunner(text: string): DotnetRunner {
|
||||
export async function runnerMode(dir: string): Promise<DotnetRunner> {
|
||||
for (let current = dir; current;) {
|
||||
try {
|
||||
// oxlint-disable-next-line no-await-in-loop -- nearest global.json wins; the upward search stops at the first one
|
||||
return globalRunner(await call(commands.fsReadText(`${current}/global.json`)));
|
||||
} catch {
|
||||
/* No global.json at this level. */
|
||||
@@ -209,6 +210,7 @@ export async function dotnetWorkspace(root: string, signal?: AbortSignal): Promi
|
||||
while (queue.length) {
|
||||
signal?.throwIfAborted();
|
||||
const dir = queue.shift()!;
|
||||
// oxlint-disable-next-line no-await-in-loop -- BFS enumeration; cancellation and the growing queue make each read sequential
|
||||
for (const entry of await call(commands.fsReadDir(dir))) {
|
||||
if (
|
||||
entry.kind === "dir" &&
|
||||
@@ -219,6 +221,7 @@ export async function dotnetWorkspace(root: string, signal?: AbortSignal): Promi
|
||||
else if (/\.(?:cs|fs|vb)proj$/i.test(entry.name)) paths.add(entry.path);
|
||||
else if (/\.slnx?$/i.test(entry.name)) {
|
||||
const projects = solutionPaths(
|
||||
// oxlint-disable-next-line no-await-in-loop -- solution projects feed the shared `paths` set in traversal order
|
||||
await call(commands.fsReadText(entry.path)),
|
||||
entry.name.endsWith(".slnx"),
|
||||
dirname(entry.path),
|
||||
@@ -232,6 +235,7 @@ export async function dotnetWorkspace(root: string, signal?: AbortSignal): Promi
|
||||
const errors: string[] = [];
|
||||
for (const path of paths) {
|
||||
try {
|
||||
// oxlint-disable-next-line no-await-in-loop -- `paths` grows with discovered references; cancellation and error order stay intact
|
||||
const project = await evaluateProject(path, "Debug", "", signal);
|
||||
projects.push(project);
|
||||
project.references.forEach((reference) => paths.add(reference));
|
||||
|
||||
@@ -52,6 +52,7 @@ export function pendingFileMoves(root: string | null) {
|
||||
export async function notifyFilesMoved(moves: readonly FileMove[]): Promise<void> {
|
||||
for (const listener of moveListeners) {
|
||||
try {
|
||||
// oxlint-disable-next-line no-await-in-loop -- listeners run in registration order before editors reopen; failures stay in sequence
|
||||
await listener(moves);
|
||||
} catch (e) {
|
||||
console.warn("file move listener failed", e);
|
||||
|
||||
@@ -34,6 +34,7 @@ beforeEach(() => {
|
||||
|
||||
it("says once that a remote Java launch got no agent, naming the plugins with a granted one", async () => {
|
||||
for (const kind of ["application", "spring-boot", "jar-application"]) {
|
||||
// oxlint-disable-next-line no-await-in-loop -- assert each kind in order so a failure names the offending kind
|
||||
expect(await remoteJavaAgentNote({ kind })).toBe(
|
||||
"Java agents of Spring Agent were not added: they load only in local projects.\n",
|
||||
);
|
||||
|
||||
@@ -213,6 +213,7 @@ export async function classModules(binaryName: string): Promise<string[]> {
|
||||
const configs = await call(commands.runConfigs());
|
||||
const modules = new Set<string>();
|
||||
for (const file of matches) {
|
||||
// oxlint-disable-next-line no-await-in-loop -- keep read errors in candidate order and hold only one source text at a time
|
||||
const text = await call(commands.fsReadText(file.path));
|
||||
const sourcePackage = /^\s*package\s+([\w.]+)\s*[;\r\n]/m.exec(text)?.[1] ?? "";
|
||||
if (sourcePackage === pkg) modules.add(jvmModuleDir(root ? relativePath(root, file.path) : file.relPath, configs));
|
||||
|
||||
@@ -118,6 +118,7 @@ describe("remote client settings", () => {
|
||||
commands: [command],
|
||||
});
|
||||
invoke.mockResolvedValue(JSON.stringify({ gradle, maven: null }));
|
||||
// oxlint-disable-next-line no-await-in-loop -- each command reconfigures global remote routing, then asserts against it
|
||||
expect(await routedInvoke(command)).toEqual({ gradle: expected, maven: null });
|
||||
}
|
||||
});
|
||||
|
||||
@@ -53,6 +53,7 @@ export function hideSplash(): void {
|
||||
if (!el) return;
|
||||
const timeout = new Promise((resolve) => setTimeout(resolve, MAX_WAIT_MS));
|
||||
void Promise.race([Promise.all(holds), timeout]).then(async () => {
|
||||
// oxlint-disable-next-line no-await-in-loop -- wait for dialog answers; new questions can arrive while we wait
|
||||
while (questions.size) await Promise.all(questions);
|
||||
// Two frames: let React commit the state the holds produced before uncovering it.
|
||||
requestAnimationFrame(() =>
|
||||
|
||||
Reference in new issue
Заблокувати користувача