如何修复Intellij IDEA中出现的“文件过大: __,仅显示前__ 的只读预览”错误?

21
我正在尝试在Intellij IDEA中查看一个大文件,但是我遇到了错误:“文件太大:30.1 MB,仅显示前2.56 MB的只读预览。” 我看到了一些先前关于这个问题的答案,包括: IntelliJ无法显示大文件?IntelliJ Idea 12- Java文件对编辑器来说太大了。问题在于我找不到idea.max.intellisense.filesize或idea.max.content.load.filesize进行编辑。当我点击Intellij中的Help | Edit Custom Properties时,它会显示“文件'〜/ Library / Preferences / IdeaC2018.3 / idea.properties'不存在。创建?”当我创建该文件并添加“idea.max.intellisense.filesize = 2500”和“idea.max.content.load.filesize = 20000”时,它没有效果。实际上,我得到了错别字错误。我也看到了https://intellij-support.jetbrains.com/hc/en-us/articles/206544869,但我也没有IDE_HOME目录。我不确定如何从这里开始,有人可以帮忙吗?谢谢。
3个回答

21

Jet Brains为调整IDE的好文档增加了良好的文档。

您需要在"idea.properties"文件中设置参数。

idea.max.content.load.filesize=512000

更多内容请点击此处.


2
请小心处理此事项。正如提供的链接所述:“不要在默认文件中更改平台属性,因为当WebStorm更新时,该文件将被替换。此外,在macOS情况下,编辑此文件会违反应用程序签名。” - Createdd
5
请确保通过菜单 Help->Edit Custom Properties... 从IDE打开属性。 - Fede Garcia

3

所以我的问题解决方案是正确的。我只需要重新启动IntelliJ,然后它就开始工作了。


3

新的方法是改变并重新启动IDE:
在最近的产品版本中,推荐的更改平台属性的方式是通过帮助 | 编辑自定义属性菜单。此操作将在IDE配置目录中创建一个.properties文件的副本,并打开一个编辑器,您可以在其中进行更改。如果无法启动IDE以访问此菜单,请按照下面的说明手动编辑文件。

您可以在IDE_HOME\bin\idea.properties文件中更改所有产品的属性,以下是一些常用属性,您可能想要调整:

#---------------------------------------------------------------------
# Maximum file size (kilobytes) IDE should provide code assistance for.
# The larger file is the slower its editor works and higher overall system memory requirements are
# if code assistance is enabled. Remove this property or set to very large number if you need
# code assistance for any files available regardless their size.
#---------------------------------------------------------------------
idea.max.content.load.filesize=512000
idea.max.intellisense.filesize=512000

https://intellij-support.jetbrains.com/hc/en-us/articles/206544869


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接