Skip to content

Commit 1cbea33

Browse files
committed
1.0.0 Alpha 2
- **Overview auto-scan on tool-window open** — no longer walks every module `.php`/`.tpl` when the XOOPS Support tool window is created. That path froze multi-project monorepo boot (high disk I/O / power). Default is idle until **Refresh**. - Setting **Auto-scan project when Overview tool window opens** (off by default) for users who want the old behaviour. - Background scan tasks are **cancellable**; the filesystem scanner calls `ProgressManager.checkCanceled()` between modules and files.
1 parent 0c49482 commit 1cbea33

9 files changed

Lines changed: 102 additions & 22 deletions

File tree

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project uses [Semantic Versioning](https://semver.org/) with pre-release tags
77
(`1.0.0-alpha.N`).
88

9+
## [1.0.0-alpha.2] — 1.0.0 Alpha 2 — 2026-08-12
10+
11+
### Fixed
12+
13+
- **Overview auto-scan on tool-window open** — no longer walks every module `.php`/`.tpl` when the XOOPS Support tool window is created. That path froze multi-project monorepo boot (high disk I/O / power). Default is idle until **Refresh**.
14+
- Setting **Auto-scan project when Overview tool window opens** (off by default) for users who want the old behaviour.
15+
- Background scan tasks are **cancellable**; the filesystem scanner calls `ProgressManager.checkCanceled()` between modules and files.
16+
17+
### Changed
18+
19+
- **Inspection tree placement** — all XOOPS inspections use top-level group **XOOPS** in Settings → Editor → Inspections (removed `groupPath="PHP"` so they are not buried under PHP → XOOPS).
20+
921
## [1.0.0-alpha.1] — 1.0.0 Alpha 1 — 2026-08-11
1022

1123
First public alpha of **XOOPS Support** — a PhpStorm / IntelliJ helper for XOOPS 2.5 / 2.7 / 4.0 module and core work.

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
pluginGroup=org.xoops
66
pluginName=xoops-support
77
pluginId=org.xoops.plugin.support
8-
# Technical version (ZIP / Marketplace). Display: "1.0.0 Alpha 1"
9-
pluginVersion=1.0.0-alpha.1
8+
# Technical version (ZIP / Marketplace). Display: "1.0.0 Alpha 2"
9+
pluginVersion=1.0.0-alpha.2
1010

1111
# Platform / compatibility (PhpStorm build numbers)
1212
# 243 = 2024.3; leave until open so 2025.x / 2026.x (e.g. 2026.2.1 = 262.*) install cleanly.

src/main/java/org/xoops/support/XoopsStartupActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public void runActivity(@NotNull Project project) {
5858
.createNotification(
5959
"XOOPS Support active",
6060
"Detected XOOPS markers (" + modules + " module(s) with xoops_version.php). "
61-
+ "See Settings → Editor → Inspections → PHP → XOOPS, "
61+
+ "See Settings → Editor → Inspections → XOOPS, "
6262
+ "and Tools → XOOPS Support.",
6363
NotificationType.INFORMATION
6464
)

src/main/java/org/xoops/support/actions/ShowXoopsProjectInfoAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public void actionPerformed(@NotNull AnActionEvent e) {
2525
return;
2626
}
2727
String basePath = project.getBasePath();
28-
ProgressManager.getInstance().run(new Task.Backgroundable(project, "Scanning XOOPS project", false) {
28+
ProgressManager.getInstance().run(new Task.Backgroundable(project, "Scanning XOOPS project", true) {
2929
@Override
3030
public void run(@NotNull ProgressIndicator indicator) {
3131
XoopsProjectReport report;

src/main/java/org/xoops/support/scanner/XoopsProjectScanner.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.xoops.support.scanner;
22

3+
import com.intellij.openapi.progress.ProgressManager;
34
import org.jetbrains.annotations.NotNull;
45

56
import java.io.IOException;
@@ -68,6 +69,8 @@ public XoopsProjectReport scan(Path requestedRoot) {
6869

6970
List<XoopsFinding> findings = new ArrayList<>();
7071
for (Path moduleRoot : moduleRoots) {
72+
// Cooperative cancel when run under ProgressManager (Overview Refresh).
73+
ProgressManager.checkCanceled();
7174
scanModule(moduleRoot, findings);
7275
}
7376
findings.sort(Comparator
@@ -222,7 +225,10 @@ private void scanModule(Path moduleRoot, List<XoopsFinding> findings) {
222225
String n = p.getFileName().toString().toLowerCase(Locale.ROOT);
223226
return n.endsWith(".php") || n.endsWith(".tpl");
224227
})
225-
.forEach(path -> scanSourceFile(path, findings));
228+
.forEach(path -> {
229+
ProgressManager.checkCanceled();
230+
scanSourceFile(path, findings);
231+
});
226232
} catch (IOException exception) {
227233
findings.add(new XoopsFinding(
228234
"SCAN_ERROR",

src/main/java/org/xoops/support/settings/XoopsConfigurable.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public final class XoopsConfigurable implements Configurable {
2323
private final Project project;
2424
private JCheckBox enabledBox;
2525
private JCheckBox suppressNotifyBox;
26+
private JCheckBox autoScanBox;
2627
private JComboBox<String> profileBox;
2728
private JTextField prefixField;
2829
private JPanel panel;
@@ -53,6 +54,12 @@ public XoopsConfigurable(Project project) {
5354
suppressNotifyBox = new JCheckBox("Suppress startup notification");
5455
form.add(suppressNotifyBox, c);
5556

57+
c.gridy++;
58+
autoScanBox = new JCheckBox(
59+
"Auto-scan project when Overview tool window opens (slow on large trees)"
60+
);
61+
form.add(autoScanBox, c);
62+
5663
c.gridy++;
5764
form.add(new JLabel("Core profile:"), c);
5865
c.gridx = 1;
@@ -80,6 +87,7 @@ public boolean isModified() {
8087
String storedPrefix = s.tablePrefix == null ? "" : s.tablePrefix;
8188
return enabledBox.isSelected() != s.enabled
8289
|| suppressNotifyBox.isSelected() != s.suppressStartupNotification
90+
|| autoScanBox.isSelected() != s.autoScanOnToolWindowOpen
8391
|| !Objects.equals(selectedProfile, storedProfile)
8492
|| !Objects.equals(prefixField.getText().trim(), storedPrefix);
8593
}
@@ -89,6 +97,7 @@ public void apply() {
8997
XoopsSettingsState s = XoopsSettingsState.getInstance(project);
9098
s.enabled = enabledBox.isSelected();
9199
s.suppressStartupNotification = suppressNotifyBox.isSelected();
100+
s.autoScanOnToolWindowOpen = autoScanBox.isSelected();
92101
s.coreProfile = String.valueOf(profileBox.getSelectedItem());
93102
s.tablePrefix = prefixField.getText().trim();
94103
}
@@ -98,6 +107,7 @@ public void reset() {
98107
XoopsSettingsState s = XoopsSettingsState.getInstance(project);
99108
enabledBox.setSelected(s.enabled);
100109
suppressNotifyBox.setSelected(s.suppressStartupNotification);
110+
autoScanBox.setSelected(s.autoScanOnToolWindowOpen);
101111
profileBox.setSelectedItem(s.coreProfile == null ? "Auto" : s.coreProfile);
102112
prefixField.setText(s.tablePrefix == null ? "" : s.tablePrefix);
103113
}

src/main/java/org/xoops/support/settings/XoopsSettingsState.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ public final class XoopsSettingsState implements PersistentStateComponent<XoopsS
1515

1616
public boolean enabled = true;
1717
public boolean suppressStartupNotification = false;
18+
/**
19+
* When true, the Overview tool window scans the project as soon as it opens.
20+
* Default false: full module tree walks are expensive on monorepos / multi-project
21+
* boot; user must click Refresh (or Tools → Refresh XOOPS Overview).
22+
*/
23+
public boolean autoScanOnToolWindowOpen = false;
1824
/** Auto | 2.5 | 2.7 | 4.0 */
1925
public String coreProfile = "Auto";
2026
public String tablePrefix = "";

src/main/java/org/xoops/support/ui/XoopsToolWindowPanel.java

Lines changed: 55 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,39 @@ public XoopsToolWindowPanel(Project project) {
6969

7070
add(toolbar, BorderLayout.NORTH);
7171
add(new JBScrollPane(overview), BorderLayout.CENTER);
72-
refresh();
72+
73+
// Never walk the module tree on tool-window create by default — monorepos freeze boot.
74+
XoopsSettingsState settings = XoopsSettingsState.getInstance(project);
75+
if (!settings.enabled) {
76+
showDisabled();
77+
} else if (settings.autoScanOnToolWindowOpen) {
78+
refresh();
79+
} else {
80+
showIdlePrompt();
81+
}
82+
}
83+
84+
private void showDisabled() {
85+
overview.setText("<html><body style='font-family:sans-serif;padding:8px'>"
86+
+ "<p><b>XOOPS Support is disabled</b> for this project.</p>"
87+
+ "<p>Settings → Languages &amp; Frameworks → XOOPS Support.</p>"
88+
+ "</body></html>");
89+
status.setText("Disabled");
90+
refreshButton.setEnabled(true);
91+
}
92+
93+
private void showIdlePrompt() {
94+
overview.setText("<html><body style='font-family:sans-serif;padding:8px'>"
95+
+ "<p><b>Overview is idle</b> — no automatic project scan.</p>"
96+
+ "<p>Click <b>Refresh</b> (or <b>Tools → XOOPS Support → Refresh XOOPS Overview</b>) "
97+
+ "to scan modules for convention findings. "
98+
+ "Full-tree scans read every module <code>.php</code>/<code>.tpl</code> and are "
99+
+ "expensive on large monorepos.</p>"
100+
+ "<p>Optional: Settings → XOOPS Support → "
101+
+ "<i>Auto-scan project when Overview tool window opens</i> (off by default).</p>"
102+
+ "</body></html>");
103+
status.setText("Idle — click Refresh to scan");
104+
refreshButton.setEnabled(true);
73105
}
74106

75107
public void refresh() {
@@ -84,30 +116,35 @@ public void refresh() {
84116
return;
85117
}
86118
if (!XoopsSettingsState.getInstance(project).enabled) {
87-
overview.setText("<html><body><p>XOOPS Support is disabled for this project "
88-
+ "(Settings → XOOPS Support).</p></body></html>");
89-
status.setText("Disabled");
90-
refreshButton.setEnabled(true);
119+
showDisabled();
91120
return;
92121
}
93122

94123
final long requestId = scanGeneration.incrementAndGet();
95124
refreshButton.setEnabled(false);
96125
status.setText("Scanning…");
97126

98-
ProgressManager.getInstance().run(new Task.Backgroundable(project, "Scanning XOOPS project", false) {
127+
// canBeCancelled = true so the user can stop a runaway monorepo walk.
128+
ProgressManager.getInstance().run(new Task.Backgroundable(project, "Scanning XOOPS project", true) {
99129
@Override
100130
public void run(@NotNull ProgressIndicator indicator) {
101131
try {
132+
indicator.setText("Scanning XOOPS modules (cancellable)…");
133+
indicator.checkCanceled();
102134
XoopsProjectReport report = new XoopsProjectScanner().scan(Path.of(basePath));
135+
indicator.checkCanceled();
103136
String html = new XoopsReportHtmlRenderer().render(report);
104137
ApplicationManager.getApplication().invokeLater(
105138
() -> applyReport(report, html, requestId),
106139
ModalityState.any(),
107140
__ -> disposed.get() || project.isDisposed() || requestId != scanGeneration.get()
108141
);
109142
} catch (ProcessCanceledException e) {
110-
throw e;
143+
ApplicationManager.getApplication().invokeLater(
144+
() -> applyCancelled(requestId),
145+
ModalityState.any(),
146+
__ -> disposed.get() || project.isDisposed() || requestId != scanGeneration.get()
147+
);
111148
} catch (Exception e) {
112149
String msg = e.getMessage() == null ? e.getClass().getSimpleName() : e.getMessage();
113150
String html = "<html><body style='font-family:sans-serif;padding:8px'>"
@@ -124,6 +161,17 @@ public void run(@NotNull ProgressIndicator indicator) {
124161
});
125162
}
126163

164+
private void applyCancelled(long requestId) {
165+
if (disposed.get() || project.isDisposed() || requestId != scanGeneration.get()) {
166+
return;
167+
}
168+
overview.setText("<html><body style='font-family:sans-serif;padding:8px'>"
169+
+ "<p><b>Scan cancelled.</b></p>"
170+
+ "<p>Click <b>Refresh</b> to try again.</p></body></html>");
171+
status.setText("Cancelled");
172+
refreshButton.setEnabled(true);
173+
}
174+
127175
private void applyReport(XoopsProjectReport report, String html, long requestId) {
128176
if (disposed.get() || project.isDisposed() || requestId != scanGeneration.get()) {
129177
return;

src/main/resources/META-INF/plugin.xml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
<idea-plugin>
44
<id>org.xoops.plugin.support</id>
55
<name>XOOPS Support</name>
6-
<version>1.0.0-alpha.1</version>
6+
<version>1.0.0-alpha.2</version>
77
<vendor url="https://github.com/XOOPS/phpstorm-plugin" email="dev@xoops.org">XOOPS Project</vendor>
88

99
<!-- since-build/until-build are patched from gradle.properties (until open-ended for 2026.2+). -->
1010

1111
<description><![CDATA[
1212
<p><b>XOOPS Support</b> — PhpStorm / IntelliJ helper for XOOPS 2.5 / 2.7 / 4.0 module and core work.</p>
13-
<p><i>1.0.0 Alpha 1</i> — first public preview; APIs and inspections may change.</p>
13+
<p><i>1.0.0 Alpha 2</i> — on-demand overview scan; inspections under top-level XOOPS group.</p>
1414
<ul>
1515
<li>Project detection, scanner, and HTML overview tool window</li>
1616
<li>Inspections with Alt+Enter quick fixes (guards, query/exec, Request, Smarty, templates)</li>
@@ -20,6 +20,12 @@
2020
]]></description>
2121

2222
<change-notes><![CDATA[
23+
<h3>1.0.0 Alpha 2 (1.0.0-alpha.2)</h3>
24+
<ul>
25+
<li><b>Performance:</b> Overview no longer auto-scans the whole module tree when the tool window opens (monorepo boot freeze). Click <b>Refresh</b> to scan. Optional setting re-enables auto-scan.</li>
26+
<li>Scan tasks are cancellable; scanner cooperates with ProgressManager between modules/files.</li>
27+
<li>Inspections appear under top-level <b>XOOPS</b> in Settings → Editor → Inspections (no longer nested under PHP).</li>
28+
</ul>
2329
<h3>1.0.0 Alpha 1 (1.0.0-alpha.1)</h3>
2430
<p>First public alpha of <b>XOOPS Support</b>.</p>
2531
<ul>
@@ -55,7 +61,6 @@
5561

5662
<localInspection
5763
language="PHP"
58-
groupPath="PHP"
5964
groupName="XOOPS"
6065
enabledByDefault="true"
6166
level="WARNING"
@@ -65,7 +70,6 @@
6570

6671
<localInspection
6772
language="PHP"
68-
groupPath="PHP"
6973
groupName="XOOPS"
7074
enabledByDefault="true"
7175
level="WARNING"
@@ -75,7 +79,6 @@
7579

7680
<localInspection
7781
language="PHP"
78-
groupPath="PHP"
7982
groupName="XOOPS"
8083
enabledByDefault="true"
8184
level="ERROR"
@@ -85,7 +88,6 @@
8588

8689
<localInspection
8790
language="PHP"
88-
groupPath="PHP"
8991
groupName="XOOPS"
9092
enabledByDefault="true"
9193
level="ERROR"
@@ -95,7 +97,6 @@
9597

9698
<localInspection
9799
language="PHP"
98-
groupPath="PHP"
99100
groupName="XOOPS"
100101
enabledByDefault="true"
101102
level="WARNING"
@@ -105,7 +106,6 @@
105106

106107
<localInspection
107108
language="PHP"
108-
groupPath="PHP"
109109
groupName="XOOPS"
110110
enabledByDefault="true"
111111
level="WARNING"
@@ -115,7 +115,6 @@
115115

116116
<localInspection
117117
language="PHP"
118-
groupPath="PHP"
119118
groupName="XOOPS"
120119
enabledByDefault="true"
121120
level="WEAK WARNING"
@@ -125,7 +124,6 @@
125124

126125
<localInspection
127126
language="Smarty"
128-
groupPath="PHP"
129127
groupName="XOOPS"
130128
enabledByDefault="true"
131129
level="WARNING"

0 commit comments

Comments
 (0)