redhat-developer / redhat-developer/vscode-java

java.import.maven.enabled setting not honored

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

还没有人认领这个 Issue。

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

描述

Currently, the "java.import.maven.enabled":false setting requires that the .project, .classpath files and the .settings directory be removed and the Java workspace cleaned before taking effect (see https://github.com/redhat-developer/vscode-java/issues/634#issuecomment-529466893). This is clunky and poorly-documented.

Ideally, setting the "java.import.maven.enabled":false should immediately take effect. Less ideally, there should be clear documentation around the use of this setting to instruct users to clear out the files and clean the workspace.

Truthfully, my use case is to disable the Java language features for one of the folders in my multi-root workspace. This is currently made possible by disabling the import, but one could imagine a world in which this is a different setting, which would take effect immediately.

Environment
  • Operating System: Windows 10 1809
  • JDK version: 1.8.0_221
  • Visual Studio Code version: 1.38.0
  • Java extension version: 0.48.0
Steps To Reproduce
  1. Open a fresh workspace in VS Code
  2. Open a folder containing a Java project - we'll call this Project1
    1. The Java extension will immediately import and start compiling the code
  3. Add another folder containing another Java project to the workspace - we'll call this Project2
    1. The Java extension will immediately import and start compiling the code
  4. Restart VS Code
    1. The Java extension will immediately start compiling the code for both projects
  5. Edit Project2's VS Code settings ([project2]/.vscode/settings.json) to contain the following:
    {
        "java.import.gradle.enabled":false,
        "java.import.maven.enabled":false
    }
    
  6. Restart VS Code
    1. The Java extensions will immediately start compiling the code for both projects
Current Result

Immediately after setting the "java.import.maven.enabled":false property, the Java language features are still alive and active in the project.
Even after a restart of VS Code, the Java language features are still alive and active.

Expected Result

Immediately after setting the "java.import.maven.enabled":false property, the Java language features for the project should stop working.
After a restart of VS Code, the Java language features for the project should not load.

Additional Informations

This issue was based on a conversation with @snjeza in the VS Code Java Extension gitter channel.

贡献指南

打开贡献指南

从这里开始

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

调研方向

首先使用 Project2/.vscode/settings.json 和 java.import.maven.enabled 设置复现多根工作区行为。检查现有的 .project、.classpath 和 .settings 文件在重启后如何影响导入;当禁用该设置后无需手动删除这些文件即可生效,或所需的清理已得到明确记录时,即视为完成。

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

评估

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

把新 issue 发到你的邮箱

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