Tags: isselab/HAnS
Tags
fix: restrict FeatureAnnotationSearchScope to project content The scope only excluded library, excluded, and test-source files. It did not require the file to be in the scope's own project content, so when two projects were open simultaneously FilenameIndex/FileTypeIndex queries returned .feature-model files from the other project. Opening HAnS while a Snake project was still loaded caused FeatureLocationManager and ProjectMetrics to compute metrics from Snake's features in HAnS's Metrics view. Add an isInContent check to contains() so the scope only admits files belonging to its own project. Bumps version to 0.3.0-beta.7.
fix: scope feature discovery to canonical feature model and isolate m…
…etrics panel per project
Two distinct bugs surfaced when installing beta.5 on the HAnS project:
1. The Metrics tool window content stayed populated with the previously
opened project's data. MetricsViewFactory kept a single JPanel as an
instance field, which IntelliJ shared across all projects via the
plugin-singleton ToolWindowFactory. Move the JPanel to a local in
createToolWindowContent so every project gets its own panel.
2. Find Usages, navigation, and metric calculation produced no results in
the HAnS project. The .wiki/.raw/plugin.feature-model file is an exact
duplicate of the root .feature-model (it is the wiki-rendered copy of
the production feature model). FeatureModelUtil.findFeatures scanned
every .feature-model file in the production scope, so every feature
like "Referencing" appeared twice, processSelectedFeatures dropped
them through the size > 1 branch with parent-name mismatch, and
FeatureReference.resolve returned null for size != 1.
Switch findFeatures to enumerate only the canonical feature model
resolved via findFeatureModel (literal ".feature-model" filename
first, then any *.feature-model fallback). Tests using
myFixture.configureByText("model.feature-model", ...) still work
because that file is the only feature model in the synthetic test
project and the *.feature-model fallback locates it.
Bumps version to 0.3.0-beta.6.
fix: scan feature models across content roots, exclude test sources beta.4 used GlobalSearchScopesCore.projectProductionScope, which only includes production source roots. A .feature-model file at the project root (the most common placement) falls outside any source root and was therefore dropped from the scan — Metrics view, Feature Model view, and reference resolution all came up empty even on a minimal project. Replace the scope with FeatureAnnotationSearchScope and extend its contains() to also exclude test source content. The scope still covers project content roots, so root-level feature models are picked up, while test fixtures under src/test/resources/ stay out. Bumps version to 0.3.0-beta.5.
fix: exclude test-source feature-model files from project scan FeatureModelUtil.getFeatureModelFiles used GlobalSearchScope.allScope, which also indexes feature-model fixtures under src/test/resources. When the plugin was loaded into the HAnS project itself the Metrics view and Feature Model view listed features from the parser-test fixtures. Switch to GlobalSearchScopesCore.projectProductionScope so only files under production source roots are picked up. Existing plugin tests use light test fixtures whose copied files land in the production source root of the synthetic test project, so they still find their fixtures. Bumps version to 0.3.0-beta.4.
fix: serialize feature-location scan across concurrent callers GetFeatureFileMappings (traffic-light) and GetProjectMetrics (metrics tool window) both call FeatureLocationManager.getAllFeatureFileMappings on startup. The double-checked isFullyInitialized guard alone was not enough: both threads entered the guarded branch and ran calculateAllFeatureFileMappings in parallel, each spending minutes inside ReferencesSearch.search under tryRunReadActionInSmartMode. The resulting read-lock pressure starved the EDT write-intent permit and triggered the IDE freeze popup. Add a per-project Object lock and wrap the calculation in synchronized + double-checked isFullyInitialized. First caller computes, subsequent callers block briefly, then see the populated cache and return immediately. Bumps version to 0.3.0-beta.3.
fix: restore PSI traversal through OR/XOR wrapper nodes PR #201 grammar change wraps feature children in COMPONENT/LOGIC/OR_BLOCK/XOR_BLOCK/SUB_LOGIC nodes. Several callers still assumed direct PSI parent/child relationships, causing: - Feature Model view collapsed to root (shallow getChildrenOfTypeAsList) - Metrics view empty (ClassCastException in getChildFeatures/getParentFeature) - IDE background-task pileup at startup (HansTrafficLightAction queued a GetFeatureFileMappings task on every update; broken casts blocked the cache from initializing, so each task redid the full scan) Add wrapper-safe FeatureModelPsiImplUtil.getChildFeatures(PsiElement) and route FeatureViewElement, ProjectMetricsService, FeatureReferenceUtil, and FeatureModelPsiImplUtil (addFeature, moveFeatureWithChildren) through it or through the existing getParentFeature helper. Add AtomicBoolean dedupe to HansTrafficLightAction so concurrent update() calls don't pile up. Also rewrite ProjectMetricsService.getRootFeatures using findFeatures + isRootFeature filter, removing a latent infinite-loop bug in the prior sibling-walk implementation. Bumps version to 0.3.0-beta.2.
PreviousNext