-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add command to update Qute configuration from Qute LS
Signed-off-by: Fred Bricon <[email protected]>
- Loading branch information
Showing
34 changed files
with
464 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/main/java/com/redhat/devtools/intellij/lsp4ij/ui/components/InspectionHyperlink.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.redhat.devtools.intellij.lsp4ij.ui.components; | ||
|
||
import com.intellij.ide.DataManager; | ||
import com.intellij.openapi.actionSystem.DataContext; | ||
import com.intellij.openapi.options.ex.Settings; | ||
import com.intellij.openapi.util.NlsContexts; | ||
import com.intellij.profile.codeInspection.ui.ErrorsConfigurable; | ||
import com.intellij.ui.HyperlinkLabel; | ||
import com.redhat.devtools.intellij.lsp4mp4ij.MicroProfileBundle; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import javax.swing.event.HyperlinkEvent; | ||
|
||
/** | ||
* HyperlinkLabel that opens an inspection settings page | ||
*/ | ||
public class InspectionHyperlink extends HyperlinkLabel { | ||
|
||
/** | ||
* Creates a new hyperlink to an inspection settings page | ||
* @param label the hyperlink label | ||
* @param inspectionGroupPath the group path to open in the inspections settings | ||
*/ | ||
public InspectionHyperlink(@NotNull @NlsContexts.LinkLabel String label, @NotNull String inspectionGroupPath) { | ||
super(label); | ||
addHyperlinkListener(e -> { | ||
if (HyperlinkEvent.EventType.ACTIVATED.equals(e.getEventType())) { | ||
@NotNull DataContext dataContext = DataManager.getInstance().getDataContext(this); | ||
@Nullable Settings settings = Settings.KEY.getData(dataContext); | ||
if (settings != null) { | ||
@Nullable ErrorsConfigurable inspections = settings.find(ErrorsConfigurable.class); | ||
if (inspections != null) { | ||
settings.select(inspections).doWhenDone(new Runnable() { | ||
@Override | ||
public void run() { | ||
inspections.selectInspectionGroup(new String[]{inspectionGroupPath}); | ||
} | ||
}); | ||
} | ||
} | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.