Support for `.jar` files in tasks and debugger

オープン
#220 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
15/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
java
領域
tooling

調査の方向性

The payload shows a user's workaround using .zed/debug.json (javac build step and Java debug launch), .zed/tasks.json (a run task), and .zed/settings.json (jdtls referencedLibraries pointing at MyJar.jar). The open question is whether the extension should detect .jar files on its own, which the issue leaves to the maintainers. Starting work means deciding that design first, then checking how the extension's debugger and jdtls setup handle classpath entries. Done would mean an agreed approach plus tests or docs.

索引モデルが issue の本文から書いたものです。

説明

I’m not sure how the maintainers would like to implement this, but it would be great to have support for .jar files without any configuration or at least some mention of it in the documentation for this extension. Below is an example of the Zed settings files I’ve created to make jar files work in my project. I haven’t done much research on this, but I just wanted to get the conversation started. I’m also not sure if using a lib/ folder is better, but here’s the current project structure:

./
├── .zed/
│   ├── debug.json
│   ├── settings.json
│   └── tasks.json
├── MyJar.jar
├── bin/
└── src/
    ├── Main.java
    └── ExampleFile.java
// .zed/debug.json
[
    {
        "label": "Debug $ZED_STEM",
        "adapter": "Java",
        "request": "launch",
        "mainClass": "$ZED_STEM",
        "build": {
            "command": "javac -cp $ZED_WORKTREE_ROOT/MyJar.jar -d $ZED_WORKTREE_ROOT/bin $ZED_WORKTREE_ROOT/src/*.java",
            "shell": {
                "with_arguments": {
                    "program": "/bin/sh",
                    "args": ["-c"],
                },
            },
        },
    },
]
// .zed/settings.json
{
    "lsp": {
        "jdtls": {
            "initialization_options": {
                "project": {
                    "sourcePaths": ["src"],
                },
                "settings": {
                    "java": {
                        "project": {
                            "referencedLibraries": ["MyJar.jar"],
                        },
                    },
                },
            },
        },
    },
}
// .zed/tasks.json
[
    {
        "label": "Run Main with jar",
        "command": "find . -name '*.java' -not -path './bin/*' -print0 | xargs -0 javac -cp MyJar.jar -d bin && java -cp 'bin:MyJar.jar' Main",
        "use_new_terminal": false,
        "reveal": "always",
        "shell": {
            "with_arguments": {
                "program": "/bin/sh",
                "args": ["-c"],
            },
        },
    },
]
主要言語
Rust
スター
225
フォーク
47
平均マージ
3時間 51分
マージ済み PR(30日)
7

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

zed-extensions/java のほかの issue

zed-extensions/java の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。