Skip to content

Enaium/jimmer-dto-lsp

Repository files navigation

Jimmer DTO LSP

Jimmer

GitHub top language GitHub

intellij vscode eclipse neovim

Features

  • Syntax highlighting
  • Compiler checking
  • Automatic completion for prop, macro, function, keyword, comment etc.
  • Folding
  • Structure view
  • Format export and import
  • Hover for export, import, macro, prop, alias group etc.

Implemented LSP features

Screenshots

highlighting

compiler checking

comment

prop

folding

structure

import annotation

formatting export and import

export package hover

import hover

macro hover

prop hover

alias group hover

Supported IDEs

  • Visual Studio Code
  • IntelliJ IDEA (Recommend you change the default theme because the default theme semantic token color is not good)
  • Eclipse
  • Neovim
  • Any IDEs that support LSP

Requirements

  • You need to install JDK 21 or later in your system environment, but make sure your jdk version is compatible with your project
  • Your project should have gradlew or mvnw file otherwise you need to install Gradle or Maven in your system environment

Installation

  • Visual Studio Code: Install the extension from the marketplace
  • IntelliJ IDEA: Install the plugin from the marketplace
  • Eclipse: First install new software LSP4E and then move the plugin to the dropins folder
  • Neovim: Install the neovim plugin and then move the server jar file to the <userdir>/jimmer-dto-lsp/server.jar
  • Other IDEs: Install the LSP server from the release page

Usage

  • Build your project with Jimmer apt/ksp plugin
  • Open a Jimmer DTO file
  • Enjoy the features

Other Dependencies

If your project has other immutable dependencies you need to add the jimmer-gradle plugin to your project. If you use Maven, you don't need to do anything.

Supported classpath

  • build/classes/kotlin/main Gradle Kotlin
  • build/classes/kotlin/test Gradle Kotlin
  • build/classes/java/main Gradle Java
  • build/classes/java/test Gradle Java
  • target/classes Maven Java or Kotlin
  • build/tmp/kotlin-classes/debug Gradle Android Kotlin
  • build/intermediates/javac/debug/classes Gradle Android Java
  • build/intermediates/javac/debug/compileDebugJavaWithJavac/classes Gradle Android Java

If you want to add a new classpath, you can add it to the dependencies.json file in the LSP server directory(<userdir>/jimmer-dto-lsp).

In Windows your path should be like this:

{
  "X:\\path\\to\\your\\project": [
    "X:\\path\\to\\your\\xx.jar",
    //Jar classpath
    "X:\\path\\to\\your\\project\\build\\classes\\kotlin\\main",
    //Directory classpath
  ],
}

In Linux or MacOS your path should be like this:

{
  "/path/to/your/project": [
    "/path/to/your/xx.jar",
    //Jar classpath
    "/path/to/your/project/build/classes/kotlin/main",
    //Directory classpath
  ],
}

If you want to add a new jar classpath automatically, you can use the jimmer-gradle plugin and then run the generateLspDependencies task.