redhat-developer / redhat-developer/vscode-java

Problems with (I think) the language server and maven cross-project dependencies

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

还没有人认领这个 Issue。

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

描述

This is possibly a PEBCAK or user-ignorance issue.

I work with several Maven projects.
I have project A and project B open in separate VSCOde workspaces. Project B has multiple sub-projects

A subproject of Project B builds a JAR that is a maven dependency in project A.

Project B is quite large. Project A is small (but all are spring boot so there's quite a lot of cruft around).

If in project B I make some change (say, add a method to a class) and "mvn install", then the VSCode doesn't pick up the change in project A. The new method isn't visible.

Java: refresh, Java: force compilation, java: update project configuration don't fix this.
Java: clean the language server workspace sometimes fixes it, but not always. And takes an age so I don't want to be doing this.

The dependencies are all correct as far as Maven is concerned, as a command-line "mvn install" (for example) of Project A succeeds, including the code that calls the new method

Existing the VSCode for Project A and restarting does seem to work, so it looks like some sort of refresh/caching issue

How am I supposed to set things up for this case? (one maven project depending on the artefact of another)?

I've tried adding Project B as a folder to the workspace of Project A - but the LSP seems to have issues with that (I previously reported a non-reproducable bug were @Test run/debug no longer appeared, and when I tried it as a work around for this, I lost the semantic highlighting etc, (I think - the import statements weren't green but white, as they are while the LSP workspace is loading when first opening the workspace).

If I can provide more info/logs etc, please let me know what is needed.

Environment
  • Operating System: Windows 10
  • JDK version: VSCode says current version is JDK11
  • Visual Studio Code version: 1.47
  • Java extension version: MS Java 0.9.1, Redhat 0.65.0
Steps To Reproduce

Please see description above, I don't have a small test case. Sorry

[Please attach a sample project reproducing the error]
Proprietary code. I can't.
Please attach logs

Current Result
Expected Result
Additional Informations

贡献指南

打开贡献指南

从这里开始

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

调研方向

未提供源文件、测试或小型复现。首先,使用列出的 Java 和扩展版本,在 Windows 上按照 issue 的双 workspace Maven 场景进行操作,然后使用链接的 troubleshooting 指南启用 language-server logs。当无需重启 VS Code 或清理 language-server workspace,便能在 Project A 中看到从 Project B 安装的更改时,即表示完成。

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

评估

技术栈
java, vscode
领域
build-system, developer-experience, tooling
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

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