-
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: provide a stop process action (dev mode) in the console
Signed-off-by: azerr <[email protected]>
- Loading branch information
1 parent
7ffb092
commit acee927
Showing
7 changed files
with
62 additions
and
11 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
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
42 changes: 42 additions & 0 deletions
42
...com/redhat/devtools/intellij/lsp4ij/console/explorer/actions/StopProcessServerAction.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,42 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2023 Red Hat Inc. and others. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 | ||
* which is available at https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 | ||
* | ||
* Contributors: | ||
* Red Hat Inc. - initial API and implementation | ||
*******************************************************************************/ | ||
package com.redhat.devtools.intellij.lsp4ij.console.explorer.actions; | ||
|
||
import com.intellij.openapi.actionSystem.AnActionEvent; | ||
import com.intellij.openapi.project.DumbAware; | ||
import com.intellij.ui.treeStructure.Tree; | ||
import com.redhat.devtools.intellij.lsp4ij.LanguageServerBundle; | ||
import com.redhat.devtools.intellij.lsp4ij.LanguageServerWrapper; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
/** | ||
* Action to stop the selected language server process from the language explorer. | ||
*/ | ||
public class StopProcessServerAction extends TreeAction implements DumbAware { | ||
|
||
public static final String ACTION_ID = "com.redhat.devtools.intellij.lsp4ij.console.explorer.actions.StopProcessServerAction"; | ||
|
||
public StopProcessServerAction() { | ||
super(LanguageServerBundle.message("lsp.console.explorer.actions.stop.process")); | ||
} | ||
|
||
@Override | ||
protected void actionPerformed(@NotNull Tree tree, @NotNull AnActionEvent e) { | ||
LanguageServerWrapper languageServer = getSelectedLanguageServer(tree); | ||
if (languageServer != null) { | ||
languageServer.stop(); | ||
} | ||
} | ||
|
||
} |
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