Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
GH_TOKEN: ${{ github.token }}
# Releases on plugin contract v0, which only the new desktop client
# installs, and that client ships as desktop-v* pre-releases.
PRERELEASE_TAGS: v0.0.1 v0.0.2
PRERELEASE_TAGS: v0.0.1 v0.0.2 v0.0.3
run: |
prerelease=false
for tag in $PRERELEASE_TAGS; do
Expand All @@ -49,9 +49,9 @@ jobs:
echo
fi
if [[ "$prerelease" == true ]]; then
echo "安装:预发布版本,Lithe Store 自动追踪会跳过,索引条目手工提交(https://github.com/Lithe-IDEA/Lithe-store);条目合并后可在 设置 → 插件 → 插件市场 中搜索 Java Navigation 并安装。也可以下载与你的系统和芯片对应的 ZIP,在 设置 → 插件 中点击页面标题栏右侧的 从文件安装…,选中 ZIP 后核对 SHA-256 并确认。"
echo "安装:预发布版本,Lithe Store 自动追踪会跳过,索引条目手工提交(https://github.com/Lithe-IDEA/Lithe-store);条目合并后可在 设置 → 插件 → 插件市场 中搜索 Java Support Lite 并安装。也可以下载与你的系统和芯片对应的 ZIP,在 设置 → 插件 中点击页面标题栏右侧的 从文件安装…,选中 ZIP 后核对 SHA-256 并确认。"
else
echo "安装:Lithe Store(https://github.com/Lithe-IDEA/Lithe-store)中的 Java Navigation 条目合并后,可在 设置 → 插件 → 插件市场 中搜索 Java Navigation 并安装。"
echo "安装:Lithe Store(https://github.com/Lithe-IDEA/Lithe-store)中的 Java Support Lite 条目合并后,可在 设置 → 插件 → 插件市场 中搜索 Java Support Lite 并安装。"
fi
echo
echo "SHA-256:"
Expand All @@ -63,4 +63,4 @@ jobs:
if [[ "$prerelease" == true ]]; then
release_flags+=(--prerelease)
fi
gh release create "$GITHUB_REF_NAME" dist/*.zip --title "Java Navigation $GITHUB_REF_NAME" --notes-file "$RUNNER_TEMP/notes.md" "${release_flags[@]}"
gh release create "$GITHUB_REF_NAME" dist/*.zip --title "Java Support Lite $GITHUB_REF_NAME" --notes-file "$RUNNER_TEMP/notes.md" "${release_flags[@]}"
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Java Navigation for Lithe
# Java Support Lite for Lithe

[Java Support](https://github.com/Lithe-IDEA/lithe-plugin-java) 的轻量版(插件 ID 仍是 `io.github.lithe-idea.java-navigation`,0.0.2 及以前叫 Java Navigation)。
为 [Lithe](https://github.com/1lck/Lithe-IDEA) 提供**不依赖 JDT LS 的轻量 Java 跳转**:跳转到定义、查找引用和文档结构,
能跳进 JDK 和 Maven 依赖库。插件自带一个用 Go 写的小型语言服务器,不需要 JDK 运行时、不运行 Maven,
打开项目后第一次跳转约 0.2–0.5 秒就能用,常驻内存 60–90 MiB(同一个项目 JDT LS 要 3 GB,导入要 1 分钟)。
这是一个**社区插件**,按插件契约 v0 编写。

> English: lightweight Java navigation for Lithe without JDT LS — go to definition, find references and the
> English: Java Support Lite, the lightweight edition of Java Support (plugin ID `io.github.lithe-idea.java-navigation`,
> named Java Navigation up to 0.0.2): lightweight Java navigation for Lithe without JDT LS — go to definition, find references and the
> document outline, into the JDK and Maven dependency jars, served by a small Go language server that keeps
> an index of declarations only. No JDK runtime, no build import, 60–90 MiB of memory.

Expand Down Expand Up @@ -123,7 +125,10 @@ JSF 依赖没下载过,OpenCms 的 Gradle 依赖读不了)、数组的 `.len
- **`.jsp` 文件里不能跳转**:插件只处理 `.java` 文件,JSP 里的 `<% %>` 脚本、`<jsp:useBean>`、EL 表达式和标签库都不跳。
- **只认一个 JDK**:用的是上面顺序找到的 JDK,不一定是项目编译用的版本。
- **引用不含重写和实现**:查找方法的引用不包括子类重写的方法和通过接口调用到的其他声明。
- **和 Java Support(JDT LS)同时安装**:两个插件都为 Java 声明语言服务器,宿主怎么分配请求还没有定义,暂时不要同时启用。
- **和 Java Support 二选一**:两个插件都为 Java 提供语言服务器,Lithe 同一时间只让一个已启用的插件服务一门语言。
启用或安装其中一个,另一个会被自动停用,Lithe 会提示停用了哪个(需要包含
[Lithe-core-rust#39](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/39) 的桌面端;更早的预览版里两个都启用时,
只有其中一个能用)。要补全、诊断、运行和调试,请改用 Java Support。

## 开发

Expand Down
171 changes: 171 additions & 0 deletions assets/LICENSE-APACHE-2.0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.

"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.

"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work.

"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:

(a) You must give any other recipients of the Work or Derivative Works
a copy of this License; and

(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and

(c) You must retain, in the Source form of any Derivative Works that
You distribute, all copyright, patent, trademark, and attribution
notices from the Source form of the Work, excluding those notices
that do not pertain to any part of the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one of
the following places: within a NOTICE text file distributed as
part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.

You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.

6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS
7 changes: 7 additions & 0 deletions assets/NOTICE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
java-support-lite.svg and java-support-lite_dark.svg are modified versions of
java.svg from the JetBrains IntelliJ Platform Community repository
(https://github.com/JetBrains/intellij-community), platform/icons/src/fileTypes,
Copyright 2000-2023 JetBrains s.r.o. and contributors, licensed under the Apache
License 2.0 in LICENSE-APACHE-2.0.txt. Lithe changed the filled cup to an
outline and added a lightning bolt. These icons are only used by the Lithe Store
listing and are not part of the plugin package.
7 changes: 7 additions & 0 deletions assets/java-support-lite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions assets/java-support-lite_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions docs/releases/v0.0.3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
0.0.3 改名为 Java Support Lite,作为 Java Support 的轻量版。功能和插件 ID(`io.github.lithe-idea.java-navigation`)不变,已安装的用户照常收到更新。

变更:
- 显示名称从 Java Navigation 改为 Java Support Lite;依赖库签名存根的首行注释同步改名。
- 与 Java Support 二选一:两者都为 Java 提供语言服务器,Lithe 同一时间只让一个已启用的插件服务一门语言,启用或安装其中一个会自动停用另一个并提示(需要包含 Lithe-core-rust#39 的桌面端)。
- Lithe Store 条目使用新图标(空心咖啡杯加闪电,改自 JetBrains IntelliJ Platform 的 Apache-2.0 图标,见仓库 `assets/NOTICE.txt`)。
2 changes: 1 addition & 1 deletion internal/deps/stub.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const maxNesting = 8

// stubHeader starts every stub; origin names the jar.
func stubHeader(origin string) string {
return "// Signatures read from " + origin + " by Java Navigation; no sources are attached.\n"
return "// Signatures read from " + origin + " by Java Support Lite; no sources are attached.\n"
}

type stubWriter struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/deps/testdata/stubs/Container.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Signatures read from lib-1.0.jar by Java Navigation; no sources are attached.
// Signatures read from lib-1.0.jar by Java Support Lite; no sources are attached.
package com.example.lib;

import java.io.Serializable;
Expand Down
2 changes: 1 addition & 1 deletion internal/deps/testdata/stubs/Level.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Signatures read from lib-1.0.jar by Java Navigation; no sources are attached.
// Signatures read from lib-1.0.jar by Java Support Lite; no sources are attached.
package com.example.lib;

public enum Level {
Expand Down
2 changes: 1 addition & 1 deletion internal/deps/testdata/stubs/NoDebug.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Signatures read from lib-1.0.jar by Java Navigation; no sources are attached.
// Signatures read from lib-1.0.jar by Java Support Lite; no sources are attached.
package com.example.lib;

public class NoDebug {
Expand Down
2 changes: 1 addition & 1 deletion internal/deps/testdata/stubs/Point.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Signatures read from lib-1.0.jar by Java Navigation; no sources are attached.
// Signatures read from lib-1.0.jar by Java Support Lite; no sources are attached.
package com.example.lib;

public record Point(int x, int y) implements Comparable<Point> {
Expand Down
2 changes: 1 addition & 1 deletion internal/deps/testdata/stubs/Process.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Signatures read from lib-1.0.jar by Java Navigation; no sources are attached.
// Signatures read from lib-1.0.jar by Java Support Lite; no sources are attached.
package com.example.lib;

public class Process {
Expand Down
2 changes: 1 addition & 1 deletion internal/deps/testdata/stubs/Repository.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Signatures read from lib-1.0.jar by Java Navigation; no sources are attached.
// Signatures read from lib-1.0.jar by Java Support Lite; no sources are attached.
package com.example.lib;

import java.util.List;
Expand Down
2 changes: 1 addition & 1 deletion internal/deps/testdata/stubs/Runner.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Signatures read from lib-1.0.jar by Java Navigation; no sources are attached.
// Signatures read from lib-1.0.jar by Java Support Lite; no sources are attached.
package com.example.lib;

public class Runner {
Expand Down
2 changes: 1 addition & 1 deletion internal/deps/testdata/stubs/Schema.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Signatures read from lib-1.0.jar by Java Navigation; no sources are attached.
// Signatures read from lib-1.0.jar by Java Support Lite; no sources are attached.
package com.example.lib;

public @interface Schema {
Expand Down
4 changes: 2 additions & 2 deletions io.github.lithe-idea.java-navigation/plugin.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"schemaVersion": 0,
"id": "io.github.lithe-idea.java-navigation",
"displayName": "Java Navigation",
"version": "0.0.2",
"displayName": "Java Support Lite",
"version": "0.0.3",
"pluginAPIVersion": 0,
"requires": {
"languageServers": 0,
Expand Down
Loading