microsoft / microsoft/vscode-java-debug

VSCode and folders in repository from GitHub

未关闭
#785 8 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

ai-triaged question standalone files
主要语言
TypeScript
星标
591
派生
429
平均合并
1 天 9 小时
30 天内合并 PR
19

描述

First of all I'm not an expert, but I will try to explain my issue as well as I can. I'm not sure if it's a bug, but I still need help to figure it out.
I was working with a GitHub-repository with standalone .java-files (no Java-project, Maven etc.). I'm a student, and so far we are programming Java by making different classes in different .java-files, that works together by being in the same folder. Then I changed the name of the repository, and added some folders within the repository and moved my .java-files into one of those folders. Then I tried to run the my program, by hitting "run" on in the file that contain my "static void main-method". It then returned a "fileNotFoundException", because the program I coded was trying to read from a .txt-file inside the folder. The program had worked before I renamed the repository and moved the files into the folder. After some googling, I found out that the issue was that I moved the .txt file, and that this could be fixed by deleting the directory "Library/Application Support/Code/User/workspaceStorage". So I did, and it didn't fix the problem, and created another problem, which is now the problem that I need help with. When I open my GitHub-repository (which I have cloned to my Mac) in VSCode it opens fine, and I can open the folders inside the repository in the file-explorer in VSCode. But when I open one of the .java-files within one of those folders, it seems like VSCode sets this folder to a main folder or something, because when I go into one of those other folders inside the repository, and open one of the .java files there, then VSCode says that "filename.java is not on the classpath of project nameOfProject, only syntax errors are reported". But I have not created a project or anything, I just have .java-files inside the same folder, and they work together that way. So how do I fix this issue, because I didn't have a problem with this before, and it reported all sort of errors, not only syntax error

Environment
  • Operating System: MacOS 10.15.4
  • JDK version: 1.8.0_231
  • Visual Studio Code version: 1.43.2
  • Java extension version: 0.8.1
  • Java Debugger extension version: 0.25.1
Steps To Reproduce
  1. Open my GitHub-repository that has been cloned to my computer.
  2. Open a .java-file within a subfolder in the repository.
  3. Open a .java-file inside another of the subfolders in the repository.
  4. Try to run a file with static void main-method in it.

[attach a sample project reproducing the error]
[attach logs]
I try to add a logg here, hope this is the correct one

Current Result
Expected Result
Additional Informations

贡献指南

打开贡献指南

从这里开始

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

调研方向

首先,在 VS Code 1.43.2 中使用 Java extension 和 Java Debugger extension 重现该行为:打开克隆的仓库,然后打开位于不同子文件夹中的 Java 文件,并运行包含 static void main 方法的文件。检查链接的日志和 workspaceStorage 详细信息,以确定为什么文件被报告在项目 classpath 之外;确定了可重现的原因和有文档记录的解决方案后,即表示完成。

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

评估

技术栈
java, typescript, vscode
领域
devtools
Issue 类型
缺陷
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

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