redhat-developer / vscode-java

Java Language Support for Visual Studio Code
Eclipse Public License 2.0
2.07k stars 433 forks source link

Document how to work with a non-"project" set of files #745

Open cfjedimaster opened 5 years ago

cfjedimaster commented 5 years ago

I'm very new to Java development and am learning by simply creating a few ad hoc files. I'm following a book that uses a folder/package structure of "ch01/sec01" which I mimicked in my VSC folder structure. I noticed that the plugin would always give an error for:

package ch01.sec01;

Saying that the package was actually "" instead. I ignored this error and just carried on but it bothered me. :) A friend pointed out that if I moved my files into a "src" folder, this would go away, and apparently this is the default if you make a new Java project, but as I was just playing around and not really doing a 'project', I never knew this was an issue.

My recommendation is that a quick note be adding to the Troubleshooting section of the readme.

Steps To Reproduce
  1. Work with Java files w/o first making a Java project
  2. Note that even though you have the right package, it gets flagged as an error.
fbricon commented 5 years ago

We've been working on improving the user experience in some cases, such as yours, so you should now see some improvements with the next version of vscode-java. You can try the latest CI build, see if it works better for you (See manual vsix installation instructions).