дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-06 18:17:15 +02:00
feat(build): add Build › Recompile for a single Java file (#5587)
Build › Recompile '<file>.java' (Shift+Cmd+F9 / Ctrl+Shift+F9, moved from Build Module, which keeps no default shortcut) compiles only the active Java file with javac and streams its output and diagnostics to the Build tool window. The menu, editor, tab and Project view entries name the file and are enabled only for local .java files. - Maven modules resolve the classpath of the file's scope (compile for main sources, test for test sources) through dependency:build-classpath; the probe is now cancellable. - Gradle projects get the source set's output, compile classpath, source folders and release from an init script. - Projects without a build tool compile against their Project Structure roots, outputs and libraries. - In a workspace the file's member project is used. - javac gets -g, omits an empty -cp, and uses -source/-target on JDK 8; localized javac error and warning prefixes are parsed. Co-authored-by: RuyimgByCN <[email protected]>
Цей коміт міститься в:
1 джерело
d729ae8122
коміт
748e5cee89
25 files changed
+1038
-150
No files matched your search
@@ -0,0 +1,23 @@
|
||||
/** Parameters shared between the native menu bridge and the custom title bar menu. */
|
||||
import { getContext } from "@/platform/context";
|
||||
import { basename } from "@/platform/project";
|
||||
import { isVirtualUri } from "@/platform/virtualDocs";
|
||||
import { maybeEditorService } from "./contributions";
|
||||
import { isDistractionFree } from "./distractionFree";
|
||||
import { toolWindowsRestorable } from "./toolwindows/store";
|
||||
|
||||
export function javaFileNameOf(path: unknown): string | null {
|
||||
if (typeof path !== "string" || !path || isVirtualUri(path) || !/\.java$/i.test(path)) return null;
|
||||
return basename(path) || null;
|
||||
}
|
||||
|
||||
export function menuLabelParams(os: string) {
|
||||
const compileFileName = javaFileNameOf(getContext().editorPath ?? maybeEditorService()?.activePath());
|
||||
return {
|
||||
os,
|
||||
distractionFree: isDistractionFree() ? "on" : "off",
|
||||
toolWindows: toolWindowsRestorable() ? "hidden" : "shown",
|
||||
compileFile: compileFileName ? "yes" : "no",
|
||||
compileFileName: compileFileName ?? "",
|
||||
};
|
||||
}
|
||||
Reference in new issue
Заблокувати користувача