Skip to content

Conversation

@DSaatz
Copy link

@DSaatz DSaatz commented Dec 8, 2024

Description

Related Issue

Motivation and Context

How Has This Been Tested?

  • Tests are created and passing
  • Manual testing

Screenshots (if appropriate):

Types of changes

  • Pipeline changes
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • I have updated the CONTRIBUTORS file.
  • I have updated the CHANGELOG.

DSaatz and others added 16 commits November 1, 2024 16:57
…d setting up UI (needs fixes), misses logic for toggeling
…current issue is that ToggleStateService is null at runtime (see error logs)
…added dependency of CodeAnnotationsSyntaxHighlighterFactory to state, need to implement a profile for no highlighting.
… to CodeAnnotationsSyntaxHighlighterFactory and added refresh to ToggleStateService
… state after IDE restart, added logging to console for debugging temporarily.
…dialog that requires user to restart the IDE for the changes to take place, everything works
@DSaatz
Copy link
Author

DSaatz commented Dec 8, 2024

If anyhting else has to be done to fullfill the requirments for the feature and the pull request, please tell @JuliaF9 and me and we will go about it.

@JuliaF9
Copy link

JuliaF9 commented Feb 21, 2025

Description

We implemented a feature in HAnS that allows users to toggle annotation visibility in the IntelliJ IDEA editor. This functionality enables users to dynamically hide or display annotations, ensuring higher concentration on the code while still keeping annotations accessible when required. The implementation includes a persistent state mechanism, so the user’s setting is remembered across IDE sessions.

Related Issue

#40

Motivation and Context

Annotations can clutter the editor, making it difficult for developers to concentrate on the main code. However, completely removing annotations is not ideal since they contain important information. Our solution allows users to dynamically toggle annotations on or off, giving them more control over their workspace.

Previously, when the setting for annotation visibility was changed, the highlighting did not update immediately. We found out that a restart was required for the changes to take effect. To address this, we implemented a notification system that informs users to restart the IDE after changing the setting.###

Functionality Implemented

  1. Toggle Action (ToggleAction.java)
    • Allows users to enable or disable annotation visibility.
    • Interacts with ToggleStateService to manage the visibility state.
    • Dynamically updates the user interface to reflect the current state.

  2. Persistent State Management (ToggleState.java, ToggleStateService.java)
    • Stores the annotation visibility state across IDE sessions.
    • Uses PersistentStateComponent to save and restore the state.

  3. Syntax Highlighting (CodeAnnotationsSyntaxHighlighter.java, CodeAnnotationsSyntaxHighlighterFactory.java)
    • Modifies annotation appearance based on the visibility state.
    • If annotations are hidden, it applies a “no-operation” highlighter to remove syntax highlighting.

  4. Restart Notification System
    • When the visibility state is changed, a notification prompts the user to restart the IDE for changes to
    apply.
    • Ensures users are informed about the required restart.

  5. Plugin Registration (plugin.xml)
    • Registers ToggleAction and ToggleStateService in the IDE to ensure seamless integration.

How Has This Been Tested?

Manual Testing
• Enabled and disabled annotations through the toggle action.
-> Verified that annotations disappear and reappear correctly after toggling the setting.
• Restarted the IDE to confirm that the visibility state is persisted.
• Verified the notification appears correctly when the state is changed.

Types of changes

  • Pipeline changes
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have updated the CONTRIBUTORS file.
  • I have updated the CHANGELOG.

@DSaatz
Copy link
Author

DSaatz commented Feb 22, 2025

@johmara annotations have been added to our new code as you requested. Also I think you commented on here for us to do it since I still have a notif in my mailbox but the comment disappeared?

@DSaatz
Copy link
Author

DSaatz commented Feb 26, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants