microsoft / microsoft/vscode-java-debug

VSCode and folders in repository from GitHub

Aberta
#785 8 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

ai-triaged question standalone files
Linguagem predominante
TypeScript
Estrelas
591
Forks
429
Merge médio
1d 9h
PRs com merge (30d)
19

Descrição

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

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Direção de pesquisa

Comece reproduzindo o comportamento no VS Code 1.43.2 com a Java extension e a Java Debugger extension: abra o repositório clonado, depois arquivos Java em subpastas separadas, e execute o arquivo que contém o método static void main. Revise o log vinculado e os detalhes de workspaceStorage para determinar por que os arquivos são relatados fora do classpath do projeto; a tarefa estará concluída quando uma causa reproduzível e uma resolução documentada forem identificadas.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
java, typescript, vscode
Domínio
devtools
Tipo de issue
Bug
Dificuldade
5/5
Tempo estimado
Mais de uma semana
Status de atividade
Estagnada
Clareza
Precisa de esclarecimento
Facilidade para iniciantes
25/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.