ABckh / zed-java-eclipse-jdtls

Eclipse Public License 2.0
30 stars 3 forks source link

How do I configure my Zed editor to support it? #27

Open caokunpeng opened 6 days ago

caokunpeng commented 6 days ago

How do I configure my Zed editor to support it? Can you provide a copy of your settings.json file? cuz I followed the tutorial configuration and it didn't meet my expectations.

{
    "assistant": {
        "default_model": {
            "provider": "zed.dev",
            "model": "claude-3-5-sonnet-20240620"
        },
        "version": "2"
    },
    "theme": {
        "mode": "dark",
        "light": "Atelier Dune Dark",
        "dark": "Atelier Dune Dark"
    },
    "base_keymap": "JetBrains",
    "ui_font_size": 16,
    "buffer_font_size": 16,
    "buffer_font_family": "Zed Plex Mono",
    "buffer_font_features": {
        "calt": true,
        "liga": true
    },
    "scrollbar": {
        "search_results": false,
        "selected_symbol": false,
        "cursors": false,
        "show": "always",
        "git_diff": true,
        "diagnostics": true
    },
    "inlay_hints": {
        "enabled": true,
        "show_type_hints": true,
        "show_parameter_hints": true,
        "show_other_hints": true
    },
    "tabs": {
        "file_icons": true,
        "git_status": true
    },
    "preferred_line_length": 120,
    "show_whitespaces": "selection",
    "auto_update": true,
    "telemetry": {
        "diagnostics": false,
        "metrics": false
    },
    "languages": {
        "Java": {
            "language_servers": [
                "jdtls"
            ],
            "tab_size": 4,
            "formatter": "language_server",
            "format_on_save": true,
            "enable_language_server": true
        },
        "JavaScript": {
            "tab_size": 2,
            "formatter": {
                "external": {
                    "command": "prettier",
                    "arguments": [
                        "--stdin-filepath",
                        "{buffer_path}"
                    ]
                }
            }
        },
        "Rust": {
            "language_servers": [
                "rust-analyzer"
            ],
            "formatter": "language_server",
            "format_on_save": "on",
            "enable_language_server": true
        }
    },
    "lsp": {
        "jdtls": {
            "settings": {
                "java_home": "/Users/lei/.sdkman/candidates/java/current/zulu-8.jdk/Contents/Home",
                "lombokSupport_enabled:": true,
                "vmargs": "-Xms2048m -Xmx10240m -XX:+UseG1GC"
            }
        }
    }
}
ABckh commented 4 days ago

Hello @caokunpeng!

Your config looks fine, but it should work without any config at all, could you please provide a bit more on what is not working? I can see that you set 'java_home' inside of the config, maybe try to set it as env variable so jdtls could pick it up even without config

caokunpeng commented 1 day ago

ok, i will try it;