redhat-developer / redhat-developer/vscode-java

Some completions available in lightweight mode aren't available in standard mode

未关闭
#3,938 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
TypeScript
星标
2.3k
派生
547
平均合并
20 小时 1 分钟
30 天内合并 PR
11

描述

This extension decided to start acting up for no reason. I thought that maybe one of the cache/data files got corrupted somehow, so I removed every vscode-related file I could find and reinstalled everything, but it was still acting up. It's been very finicky, but the most reliably-broken feature I've seen is that some completions aren't available when they should be - mainly expanding a method name into a method stub.

I tried several old extension versions that worked previously and they also refused to work properly. I typically use vscodium, but I've also tried with vscode proper and its open source release. I'm not sure what else I can try, every log I can find hasn't been very helpful.

Steps to reproduce:

  1. Create a superclass with a method and implement it on a subclass
  2. Either type out the name of the method, or use intellisense to find it
  3. Control + space again to bring up intellisense
  4. In lightweight mode, there will be one or more completions that expand to a stub version of the method. In standard mode, there aren't any completions available

Lightweight mode:
Image

Standard mode:
Image

The method:
Image

Syntax server logs:

WARNING: Using incubator modules: jdk.incubator.vector
[Error - 4:05:59 PM] Jan 29, 2025, 4:05:59 PM An internal error occurred during: "Initialize After Load".
Cannot invoke "org.osgi.framework.Bundle.start(int)" because the return value of "org.eclipse.core.runtime.Platform.getBundle(String)" is null
java.lang.NullPointerException: Cannot invoke "org.osgi.framework.Bundle.start(int)" because the return value of "org.eclipse.core.runtime.Platform.getBundle(String)" is null
	at org.eclipse.jdt.ls.core.internal.handlers.BundleUtils.startBundle(BundleUtils.java:360)
	at org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin$1.run(JavaLanguageServerPlugin.java:196)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

[Error - 4:06:04 PM] Jan 29, 2025, 4:06:04 PM Problem with folding range for /jdt.ls-java-project/src/gregtech/common/tileentities/machines/MTEHatchCraftingInputME.java
MTEHatchCraftingInputME.java [in gregtech.common.tileentities.machines [in src [in jdt.ls-java-project]]] does not exist
Java Model Exception: Error in Java Model (code 969): MTEHatchCraftingInputME.java [in gregtech.common.tileentities.machines [in src [in jdt.ls-java-project]]] does not exist
	at org.eclipse.jdt.internal.core.JavaElement.newJavaModelException(JavaElement.java:556)
	at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:234)
	at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:569)
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:292)
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:278)
	at org.eclipse.jdt.internal.core.CompilationUnit.getSourceRange(CompilationUnit.java:1085)
	at org.eclipse.jdt.ls.core.internal.handlers.FoldingRangeHandler.computeFoldingRanges(FoldingRangeHandler.java:79)
	at org.eclipse.jdt.ls.core.internal.handlers.FoldingRangeHandler.foldingRange(FoldingRangeHandler.java:70)
	at org.eclipse.jdt.ls.core.internal.syntaxserver.SyntaxLanguageServer.lambda$8(SyntaxLanguageServer.java:376)
	at org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:87)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)

Extension host logs:

2025-01-29 16:06:22.526 [error] [redhat.java] provider FAILED
2025-01-29 16:06:22.543 [error] Error: The request (id: 14, method: 'textDocument/hover') has been cancelled
	at /home/[redacted]/.vscode/extensions/redhat.java-1.39.0-linux-x64/dist/extension.js:2:1066478
	at re (/home/[redacted]/.vscode/extensions/redhat.java-1.39.0-linux-x64/dist/extension.js:2:1066772)
	at /home/[redacted]/.vscode/extensions/redhat.java-1.39.0-linux-x64/dist/extension.js:2:1061556
	at Immediate.<anonymous> (/home/[redacted]/.vscode/extensions/redhat.java-1.39.0-linux-x64/dist/extension.js:2:1061576)
	at process.processImmediate (node:internal/timers:483:21)
2025-01-29 16:06:34.678 [error] [redhat.java] provider FAILED
2025-01-29 16:06:34.678 [error] Error: The request (id: 24, method: 'textDocument/hover') has been cancelled
	at /home/[redacted]/.vscode/extensions/redhat.java-1.39.0-linux-x64/dist/extension.js:2:1066478
	at re (/home/[redacted]/.vscode/extensions/redhat.java-1.39.0-linux-x64/dist/extension.js:2:1066772)
	at /home/[redacted]/.vscode/extensions/redhat.java-1.39.0-linux-x64/dist/extension.js:2:1061556
	at Immediate.<anonymous> (/home/[redacted]/.vscode/extensions/redhat.java-1.39.0-linux-x64/dist/extension.js:2:1061576)
	at process.processImmediate (node:internal/timers:483:21)

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

在 VS Code 中重现超类/子类场景,比较轻量模式和标准模式下的补全结果。首先检查 JDT LS 堆栈跟踪中的位置,包括 BundleUtils.startBundle 和 FoldingRangeHandler,同时对照报告的补全行为;当标准模式在没有记录的失败的情况下提供与轻量模式相同的方法存根补全时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
java, typescript, vscode
领域
developer-experience, devtools, tooling
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
42/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。