Created hover content utils with commonly used information
This commit is contained in:
@@ -30,6 +30,7 @@ import org.eclipse.lsp4j.jsonrpc.messages.Either;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.springframework.ide.vscode.boot.java.handlers.HoverProvider;
|
||||
import org.springframework.ide.vscode.boot.java.utils.HoverContentUtils;
|
||||
import org.springframework.ide.vscode.commons.boot.app.cli.SpringBootApp;
|
||||
import org.springframework.ide.vscode.commons.util.BadLocationException;
|
||||
import org.springframework.ide.vscode.commons.util.Log;
|
||||
@@ -100,7 +101,7 @@ public class ConditionalsLiveHoverProvider implements HoverProvider {
|
||||
RunningAppConditional condition = conditions.get(i);
|
||||
hoverContent.add(Either.forLeft(condition.message));
|
||||
hoverContent.add(Either
|
||||
.forLeft("Process " + condition.app.getProcessID() + ": " + condition.app.getProcessName()));
|
||||
.forLeft(HoverContentUtils.getProcessInformation(condition.app)));
|
||||
|
||||
if (i < conditions.size() - 1) {
|
||||
hoverContent.add(Either.forLeft("---"));
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2017 Pivotal, Inc.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Pivotal, Inc. - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.springframework.ide.vscode.boot.java.utils;
|
||||
|
||||
import org.springframework.ide.vscode.commons.boot.app.cli.SpringBootApp;
|
||||
|
||||
public class HoverContentUtils {
|
||||
|
||||
public static String getProcessInformation(SpringBootApp app) {
|
||||
return "Process " + app.getProcessID() + ": " + app.getProcessName();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user