Add Starters Inlay Hint in the pom file
This commit is contained in:
@@ -82,6 +82,10 @@
|
||||
</enabledInputWhen>
|
||||
-->
|
||||
</contentTypeMapping>
|
||||
<contentTypeMapping
|
||||
contentType="org.springframework.boot.ide.pom.xml"
|
||||
id="org.eclipse.languageserver.languages.springboot">
|
||||
</contentTypeMapping>
|
||||
|
||||
</extension>
|
||||
|
||||
@@ -173,6 +177,17 @@
|
||||
file-names="spring.factories,aot.factories"
|
||||
file-patterns="*.factories">
|
||||
</file-association>
|
||||
<content-type
|
||||
base-type="org.eclipse.core.runtime.xml"
|
||||
default-charset="UTF-8"
|
||||
id="org.springframework.boot.ide.pom.xml"
|
||||
name="Pom Xml"
|
||||
priority="normal">
|
||||
</content-type>
|
||||
<file-association
|
||||
content-type="org.springframework.boot.ide.pom.xml"
|
||||
file-names="pom.xml">
|
||||
</file-association>
|
||||
</extension>
|
||||
|
||||
<extension
|
||||
@@ -261,6 +276,10 @@
|
||||
class="org.springframework.tooling.boot.ls.commands.RefreshModulithMetadata"
|
||||
commandId="org.springframework.tooling.boot.ls.modulith.metadata.refresh">
|
||||
</handler>
|
||||
<handler
|
||||
class="org.springframework.tooling.boot.ls.commands.AddStartersHandler"
|
||||
commandId="spring.initializr.addStarters">
|
||||
</handler>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.commands">
|
||||
@@ -292,6 +311,24 @@
|
||||
id="org.springframework.tooling.boot.ls.modulith.metadata.refresh"
|
||||
name="Refresh Modulith Metadata">
|
||||
</command>
|
||||
<command
|
||||
categoryId="org.eclipse.lsp4e.commandCategory"
|
||||
description="Adds Spring Boot Starters dependencies"
|
||||
id="spring.initializr.addStarters"
|
||||
name="Add Spring Boot Starters">
|
||||
<commandParameter
|
||||
id="org.eclipse.lsp4e.command.param"
|
||||
name="command"
|
||||
optional="true"
|
||||
typeId="org.eclipse.lsp4e.commandParameterType">
|
||||
</commandParameter>
|
||||
<commandParameter
|
||||
id="org.eclipse.lsp4e.path.param"
|
||||
name="path"
|
||||
optional="true"
|
||||
typeId="org.eclipse.lsp4e.pathParameterType">
|
||||
</commandParameter>
|
||||
</command>
|
||||
</extension>
|
||||
|
||||
<extension
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2024 Broadcom, 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
|
||||
* https://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Broadcom, Inc. - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.springframework.tooling.boot.ls.commands;
|
||||
|
||||
import org.eclipse.core.commands.AbstractHandler;
|
||||
import org.eclipse.core.commands.ExecutionEvent;
|
||||
import org.eclipse.core.commands.ExecutionException;
|
||||
import org.eclipse.ui.IWorkbenchWindow;
|
||||
import org.eclipse.ui.handlers.HandlerUtil;
|
||||
import org.eclipse.ui.handlers.IHandlerService;
|
||||
|
||||
public class AddStartersHandler extends AbstractHandler {
|
||||
|
||||
@Override
|
||||
public Object execute(ExecutionEvent event) throws ExecutionException {
|
||||
try {
|
||||
IWorkbenchWindow workbenchWindow = HandlerUtil.getActiveWorkbenchWindow(event);
|
||||
final IHandlerService service = workbenchWindow.getService(IHandlerService.class);
|
||||
return service.executeCommand("org.springframework.ide.eclipse.boot.commands.editStartersCommand2", null);
|
||||
} catch (Exception e) {
|
||||
throw new ExecutionException("", e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user