Skip to content

JetBrains IntelliJ IDEA Support - #1773

Open
snoweuph wants to merge 3 commits into
mainfrom
feat/intellij
Open

JetBrains IntelliJ IDEA Support#1773
snoweuph wants to merge 3 commits into
mainfrom
feat/intellij

Conversation

@snoweuph

@snoweuph snoweuph commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

We'll need to decide whether we wanna package unfree stuff. Also in the future we might need some custom LSP commands for log in

Closes: #1772

Sanity Checking

  • I have updated the changelog as per my changes
  • I have tested, and self-reviewed my code
  • My changes fit guidelines found in hacking nvf
  • Style and consistency
    • I ran Alejandra to format my code (nix fmt)
    • My code conforms to the editorconfig configuration of the project
    • My changes are consistent with the rest of the codebase
  • If new changes are particularly complex:
    • My code includes comments in particularly complex areas
    • I have added a section in the manual
    • (For breaking changes) I have included a migration guide
  • Package(s) built:
    • .#nix (default package)
    • .#maximal
    • .#docs-html (manual, must build)
    • .#docs-linkcheck (optional, please build if adding links)
  • Tested on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin

Add a 👍 reaction to pull requests you find important.

@snoweuph snoweuph added the TBD More discussion and research is in order label Aug 9, 2026
github-actions Bot pushed a commit that referenced this pull request Aug 9, 2026
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

🚀 Live preview deployed from 38eab0f

View it here:

Debug Information

Triggered by: snoweuph

HEAD at: feat/intellij

Reruns: 4023

github-actions Bot pushed a commit that referenced this pull request Aug 9, 2026
@snoweuph

snoweuph commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

CI fails due to it being a UNFREE package.

};

config = mkIf cfg.enable {
vim.lsp.servers.intellij-server = {

This comment was marked as low quality.

This comment was marked as off-topic.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

found the fix. its 2 part.

  1. If you use maven or gradle, have it in your path (should be via a devshell provided and not shipped with nvf). if it detects maven or gradle, but those are not available it can't even resolve String
  2. Define JDK in the LSP init options

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've tried that, but without success. i still cant do a go to definition on imported lib

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI I updated inside this branch earlier. as for why it doesn't work, for you I don't know. did you look at your lsp.log file yet?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My flake input is:

nvf.url = "github:NotAShelf/nvf/3d54267724fe2da0abbbc7901875527b1e02120b";
nvf.inputs.nixpkgs.follows = "nixpkgs";

this is the nix config:

let
  intellij-server =
    pkgs.callPackage
      "${inputs.nvf}/flake/pkgs/by-name/intellij-server/package.nix"
      { };
in
{
  vim.lsp.enable = true;

  vim.languages.java = {
    enable = true;
    lsp.enable = false;
    extensions = {
      maven-nvim.enable = true;
      gradle-nvim.enable = true;
    };
  };

  vim.languages.kotlin = {
    enable = true;
    lsp.enable = false;
  };

  vim.lsp.presets.intellij-server.enable = true;
  vim.lsp.servers.intellij-server = {
    filetypes = [
      "java"
      "kotlin"
    ];

    cmd = lib.mkForce [
      (lib.getExe intellij-server)
      "--stdio"
      "--data-sharing=none"
      "--region=not_set"
    ];

    init_options.eulaHash = lib.mkForce (
      lib.generators.mkLuaInline ''
        (function()
          local file = assert(io.open("${intellij-server}/EULA.txt", "rb"))
          local hash = vim.fn.sha256(file:read("*a"))
          file:close()
          return hash:sub(1, 16)
        end)()
      ''
    );
  };
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove nvf.inputs.nixpkgs.follows = "nixpkgs"; plz. we dont support overriding nixpkgs for nvf, we always just test with the version we bundle

@snoweuph snoweuph Aug 16, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also youre overriding the cmd args and co for the lsp, why?

just test with

{
  vim.languages.java = {
    enable = true;
    treesitter.enable = true;
    lsp = {
      enable = true;
      servers = ["intellij-server"];
    };
    dap = {
      enable = true;
      debugger = ["intellij-server"];
    };
    extensions = {
      maven-nvim.enable = true;
      gradle-nvim.enable = true;
    };
  };
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the tips, i`ve tried it with your sample, but got the same result. im using a gradle btw.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh, im using maven. gradle is shit after all, doesnt even have the concept of licenses

@snoweuph
snoweuph force-pushed the feat/intellij branch 3 times, most recently from b8042d2 to 1321ded Compare August 9, 2026 16:25
@snoweuph

snoweuph commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

Got the DAP hacked together to work locally

image

gonna clean this up and add to this MR later :3
gonna need some rest now

github-actions Bot pushed a commit that referenced this pull request Aug 9, 2026
github-actions Bot pushed a commit that referenced this pull request Aug 9, 2026
substituters = https://cache.nixos.org/ https://feel-co.cachix.org
substituters = https://cache.nixos.org/ https://feel-co.cachix.org
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= feel-co.cachix.org-1:nwEFNnwZvtl4KKSH5LDg+/+K7bV0vcs6faMHAJ6xx0w=
allowUnfree = true

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will only apply after the MR is merged.

Comment thread modules/plugins/lsp/presets/intellij-server.nix
github-actions Bot pushed a commit that referenced this pull request Aug 15, 2026
@snoweuph
snoweuph marked this pull request as ready for review August 16, 2026 00:14
@snoweuph
snoweuph requested a review from Soliprem as a code owner August 16, 2026 00:14
github-actions Bot pushed a commit that referenced this pull request Aug 16, 2026
github-actions Bot pushed a commit that referenced this pull request Aug 16, 2026
github-actions Bot pushed a commit that referenced this pull request Aug 20, 2026
@snoweuph

Copy link
Copy Markdown
Collaborator Author

new version theoreticlly has the test runner shiped and also now has lombok support. for now just updated the urls and hashes, so no custom wiring for the test runne yet

github-actions Bot pushed a commit that referenced this pull request Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Jetbrains IntelliJ LSP support

2 participants