简体   繁体   English

Visual Studio Code通过Java扩展创建哪些项目文件?

[英]What project files does Visual Studio Code create via its Java extensions?

I give a computer programming course I have written, and I recently switched to recommending Visual Studio Code in the course. 我开设了一个计算机编程课程,最近我在课程中转向推荐Visual Studio Code。 We are starting out with the basics, so I just wanted a simple editor. 我们从基础开始,所以我只想要一个简单的编辑器。 We started learning Git, and one student's repository suddenly had all sorts of cruft in it, including: 我们开始学习Git,一个学生的资料库突然有了各种各样的东西,包括:

  • .settings/
  • .vscode/
  • .classpath
  • .project

In particular the .settings directory had all sorts of Eclipse settings, such as I would expect to see in an Eclipse project. 特别是.settings目录具有各种Eclipse设置,如我希望在Eclipse项目中看到的那样。

The student explained to me that these came from VS Code after installing its Java extensions. 学生向我解释说,这些来自安装了Java扩展的VS Code。 But why are the VS Code Java extensions creating Eclipse files? 但是,为什么VS Code Java扩展创建Eclipse文件? And where is all this documented, so that I can update my lessons with the exact details and avoid this problem in the future? 所有这些都记录在哪里,以便我可以在课程中添加确切的详细信息并避免将来出现此问题?

Thanks in advance. 提前致谢。

Simplified the Language Support for Java™ by Red Hat is the headless Eclipse Java IDE integrated into Visual Studio Code via the Language Server Protocol (LSP) . Red Hat简化了对Java™语言支持,它是通过语言服务器协议(LSP)集成到Visual Studio Code中的无头Eclipse Java IDE。 See the self-description of the extension : 参见扩展名自我描述

Provides Java™ language support via Eclipse JDT Language Server, which utilizes Eclipse JDT, M2Eclipse and Buildship . 通过Eclipse JDT Language Server提供Java™语言支持,该服务器利用Eclipse JDT,M2Eclipse和Buildship

Except for .vscode/ , the mentioned files are Eclipse Java IDE files . .vscode/提到的文件是Eclipse Java IDE文件

Because in Eclipse these files are not intended to be edited manually , there is little or no documentation about them (the Java compiler settings in .settings/org.eclipse.jdt.core.prefs are similar to the command line arguments of the Eclipse batch compiler ). 因为在Eclipse中这些文件不是要手动编辑的 ,所以关于它们的文件很少或没有文件( .settings/org.eclipse.jdt.core.prefs中的Java编译器设置类似于Eclipse批处理的命令行参数编译器 )。

For example, the documentation of the Java extension recommends using the Eclipse Java IDE to edit the formatter settings (which are also stored in .settings/org.eclipse.jdt.core.prefs ) and concludes: 例如, Java扩展的文档建议使用Eclipse Java IDE编辑格式设置(也存储在.settings/org.eclipse.jdt.core.prefs ),并得出以下结论:

No it's not an ideal solution, but it should be done only once, unless you regularly change your formatter settings. 不,这不是一个理想的解决方案,但是除非您定期更改格式设置,否则它只能执行一次。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM