将`.java`设置为Visual Studio Code中的默认文件扩展名?

huangapple go评论83阅读模式
英文:

Set .java as default file extension in vscode?

问题

有没有一种方法可以更改新文件的默认语言?默认情况下,当我们创建一个新文件时,它的扩展名被设置为“txt”。我希望“.java”作为默认的文件扩展名。
我尝试过使用“files.defaultLanguage”:“java”,
但是这会将文件扩展名设置为“.class”而不是“.java”。

如何将“.java”设置为默认的文件扩展名?

英文:

Is there a way to change the default language for new files? By default when we create a new file it is set as "txt"extensions.I want that ".java" as default file extension
I tried using "files.defaultLanguage":"java"
But this is setting file extension as ".class" instead of ".java"

How do I set ".java" as a default file extension?

答案1

得分: 1

这是一个关于VSCode的问题。实际上,它确实已经选择了'Java'作为文件类型。但是你会发现'Java'类型的文件扩展名列表为:*.class, *.java, *.jav, *.java, *.jav。所以,目前只能手动进行修改。我已经在GitHub上提交了一个功能请求:https://github.com/microsoft/vscode/issues/105463

英文:

It's an issue about VSCode. In fact, it really has chosen the 'Java' as the file type. But you can find the filename extension list of 'Java' type: *.class, *.java, *.jav, *.java, *.jav. So, you only can modify it manually for now. And I have put a feature request in Github: https://github.com/microsoft/vscode/issues/105463

huangapple
  • 本文由 发表于 2020年9月8日 00:50:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/63781477.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定