Class CodeActionDisabled


  • public class CodeActionDisabled
    extends java.lang.Object
    Marks that the code action cannot currently be applied.

    Clients should follow the following guidelines regarding disabled code actions:

    • Disabled code actions are not shown in automatic lightbulb code action menu.
    • Disabled actions are shown as faded out in the code action menu when the user request a more specific type of code action, such as refactorings.
    • If the user has a keybinding that auto applies a code action and only a disabled code actions are returned, the client should show the user an error message with reason in the editor.

    Since 3.16.0

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      java.lang.String getReason()
      Human readable description of why the code action is currently disabled.
      int hashCode()  
      void setReason​(java.lang.String reason)
      Human readable description of why the code action is currently disabled.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • CodeActionDisabled

        public CodeActionDisabled()
      • CodeActionDisabled

        public CodeActionDisabled​(java.lang.String reason)
    • Method Detail

      • getReason

        public java.lang.String getReason()
        Human readable description of why the code action is currently disabled.

        This is displayed in the code actions UI.

      • setReason

        public void setReason​(java.lang.String reason)
        Human readable description of why the code action is currently disabled.

        This is displayed in the code actions UI.

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object