Skip to content

Commit

Permalink
Provide pluginNamespace.properties and lsp4ij.xml for use by lsp4ij d…
Browse files Browse the repository at this point in the history
…ependency.

Signed-off-by: Paul Gooderham <turkeyonmarblerye@gmail.com>
  • Loading branch information
turkeylurkey committed Oct 23, 2023
1 parent f1501f7 commit cf80996
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 5 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ configurations {

dependencies {
// LSP4IJ dependencies
implementation 'org.microshed:lsp4ij:0.0.5'
implementation ('org.eclipse.lsp4mp:org.eclipse.lsp4mp.ls:0.6.0') {
exclude group: 'org.eclipse.lsp4j'
}
Expand Down Expand Up @@ -138,8 +139,7 @@ intellij {
// For a full list of IntelliJ IDEA releases please see https://www.jetbrains.com/intellij-repository/releases
version = '2023.1.2'

plugins = ['java', 'maven', 'gradle-java', 'properties', 'terminal', 'org.jetbrains.idea.maven', 'com.intellij.gradle',
file("../intellij-lsp-common-provider/lsp4ij/build/libs/lsp4ij-0.0.4.uber.jar")]
plugins = ['java', 'maven', 'gradle-java', 'properties', 'terminal', 'org.jetbrains.idea.maven', 'com.intellij.gradle']
updateSinceUntilBuild = false
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/lsp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
-->

<idea-plugin>
<extensions defaultExtensionNs="org.microshed.lsp4ij">
<extensions defaultExtensionNs="open-liberty.intellij">
<!-- MicroProfile LS -->
<server id="lsp4mp" class="io.openliberty.tools.intellij.lsp4mp.lsp.MicroProfileServer"
clientImpl="io.openliberty.tools.intellij.lsp4mp.lsp.MicroProfileLanguageClient"
Expand Down
49 changes: 49 additions & 0 deletions src/main/resources/META-INF/lsp4ij.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<idea-plugin>

<!-- Adapted from https://github.com/redhat-developer/intellij-quarkus/blob/2585eb422beeb69631076d2c39196d6eca2f5f2e/src/main/resources/META-INF/lsp.xml -->
<extensionPoints>
<extensionPoint name="server"
beanClass="org.microshed.lsp4ij.ServerExtensionPointBean"/>
<extensionPoint name="languageMapping"
beanClass="org.microshed.lsp4ij.LanguageMappingExtensionPointBean"/>
</extensionPoints>
<extensions defaultExtensionNs="com.intellij">
<!-- Completion support for all language servers -->
<completion.contributor id="LSPCompletionContributor" language="any"
implementationClass="org.microshed.lsp4ij.operations.completion.LSContentAssistProcessor"
order="first"/>

<!-- Diagnostic support for all language servers -->
<inspectionToolProvider
implementation="org.microshed.lsp4ij.operations.diagnostics.LSPInspectionToolProvider"/>
<projectService serviceImplementation="org.microshed.lsp4ij.LanguageServiceAccessor"/>
<!-- TODO re-enable goto handler -->
<!-- <gotoDeclarationHandler
implementation="org.microshed.lsp4ij.operations.navigation.LSPGotoDeclarationHandler"/> -->

<!-- Hover for LemMinX + Liberty LemMinX ext -->
<lang.documentationProvider id="LSPTextHoverXML" language="XML"
implementationClass="org.microshed.lsp4ij.operations.hover.LSPTextHover"
order="first"/>
<!-- Hover for Liberty Config LS bootstrap.properties and LSP4MP microprofile-config.properties -->
<lang.documentationProvider id="LSPTextHoverProperties" language="Properties"
implementationClass="org.microshed.lsp4ij.operations.hover.LSPTextHover"
order="first"/>
<!-- Hover for Java files, LSP4MP and LSP4Jakarta -->
<lang.documentationProvider id="LSPTextHoverJAVA" language="JAVA"
implementationClass="org.microshed.lsp4ij.operations.hover.LSPTextHover"
order="first"/>
<codeInsight.inlayProvider language="JAVA"
implementationClass="org.microshed.lsp4ij.operations.codelens.LSPInlayProvider"/>
<externalAnnotator language="XML" implementationClass="org.microshed.lsp4ij.operations.diagnostics.LSPDiagnosticAnnotator"/>
<externalAnnotator language="TEXT" implementationClass="org.microshed.lsp4ij.operations.diagnostics.LSPDiagnosticAnnotator"/>
<externalAnnotator language="Properties" implementationClass="org.microshed.lsp4ij.operations.diagnostics.LSPDiagnosticAnnotator"/>
<externalAnnotator language="JAVA" implementationClass="org.microshed.lsp4ij.operations.diagnostics.LSPDiagnosticAnnotator"/>
</extensions>

<project-components>
<component>
<implementation-class>org.microshed.lsp4ij.ConnectDocumentToLanguageServerSetupParticipant</implementation-class>
</component>
</project-components>
</idea-plugin>
8 changes: 6 additions & 2 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
<depends>com.intellij.properties</depends>
<depends>org.jetbrains.idea.maven</depends>
<depends>com.intellij.gradle</depends>
<!-- Not really optional, this attribute prevents a warning message during installation. -->
<depends optional="true">org.microshed.lsp4ij</depends>
<idea-version since-build="231" until-build="231.*"/>

<extensions defaultExtensionNs="com.intellij">
Expand Down Expand Up @@ -254,6 +252,12 @@

</actions>
<!-- Point to LSP4IJ xml -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="/META-INF/lsp4ij.xml"
xpointer="xpointer(/idea-plugin/*)"/>
<!-- Point to LSP xml -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="/META-INF/lsp.xml"
xpointer="xpointer(/idea-plugin/*)"/>
<!-- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"-->
<!-- href="file://libs/lsp4ij-0.0.5.uber.jar!/META-INF/lsp4ij.xml"-->
<!-- xpointer="xpointer(/idea-plugin/*)"/>-->
</idea-plugin>
1 change: 1 addition & 0 deletions src/main/resources/pluginNamespace.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pluginNamespace=open-liberty.intellij

0 comments on commit cf80996

Please sign in to comment.