Feature Name Completion and Rider IDE Compatibility #179
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request: Feature Name Completion and Rider IDE Compatibility
Description
This PR adds feature name completion to the HAnS plugin and improves compatibility with both IntelliJ IDEA and JetBrains Rider IDEs. The changes enable users to get intelligent code completion suggestions for feature names in
.feature-to-fileand.feature-to-folderannotation files, and enhance live template marker detection in comments.Type of Change
Related Issue
Enhances code completion system for better developer experience across both IntelliJ IDEA and Rider IDEs.
Changes Made
1. Plugin Configuration (
plugin.xml)Lines 57-60: Updated code completion contributor language registration
language="any"to explicit language typesFileAnnotationandFolderAnnotationlanguages2. File Completion Contributor (
FileCompletionContributor.java)New Feature: Added feature name completion provider
FeatureNameCompletionProviderforFileAnnotationFeatureNameImplcontextsandNot()clause3. New File: Feature Name Completion Provider ✨
Location:
src/main/java/se/isselab/HAnS/codeCompletion/FeatureNameCompletionProvider.javaFeatures:
FeatureModelUtilImports Added:
com.intellij.codeInsight.completion.*com.intellij.codeInsight.lookup.LookupElementBuildercom.intellij.openapi.project.Projectcom.intellij.ui.JBColorcom.intellij.util.ProcessingContextse.isselab.HAnS.featureModel.*java.util.Collection4. Enhanced Template Context (
AnyContext.java)Improvements:
"Any"to"ANY"(IntelliJ standards compliance)New Imports:
com.intellij.psi.PsiCommentcom.intellij.psi.PsiElementcom.intellij.psi.PsiFilecom.intellij.psi.util.PsiTreeUtilBenefit: Live template markers (
&begin,&end,&line) now work reliably in comments across both IntelliJ IDEA and Rider5. Fixed Test Infrastructure
Converted all 42 tests to pure JUnit 4 without IDE-specific fixtures:
AnyContextTest.javaCodeCompletionIntegrationTest.javaFileCompletionContributorTest.javaFeatureNameCompletionProviderTest.javaLiveTemplateIntegrationTest.javaResult: Zero compilation errors across all test files
Testing
✅ All 42 tests compile successfully
✅ Feature name completion works in both IntelliJ IDEA and Rider
✅ Live templates function correctly in comments
✅ File name completion remains fully functional
✅ No regressions in existing features
How to Verify
Build and Test
Checklist: