【问题标题】:File size exceeds configured limit (2560000), code insight features not available文件大小超出配置限制 (2560000),代码洞察功能不可用
【发布时间】:2014-05-28 06:55:47
【问题描述】:

我正在尝试在 Jetbrains WebStorm 8 中处理一个大型 Javascript 文件,我在编辑窗口顶部收到一条消息:

文件大小超出配置限制 (2560000)。代码洞察功能不可用。

如何提高“配置限制”以访问所有功能?

【问题讨论】:

    标签: intellij-idea


    【解决方案1】:

    在 IntelliJ 2016 及更高版本中,您可以从帮助菜单中更改此设置,编辑自定义属性(由 @eggplantbr 评论)。

    在旧版本中,没有 GUI 可以执行此操作。但是如果你edit the IntelliJ IDEA Platform 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.intellisense.filesize=2500
    

    【讨论】:

    • 记得输入一个像 '999999' 这样的值,因为 Webstorm 11.0.3 删除该字段或将其设置为极高的值(大约 12 个 9)不起作用。
    • 代码洞察功能包括“检查”和代码格式化。我知道在我增加文件大小限制之前,这两个功能都不适用于我打开的 8MB XML 文件。
    • 当我在 android studio 中执行此操作时,它显示“文件 C/users/....androidstudio3.0/...../ideas.customproperties 不存在。创建?'不确定我想冒险搞砸一些事情。发现超出此限制是我的自动完成功能和其他功能在注意到此消息后停止的原因。
    • 我们可以对 JetBrain 的 IntelliJ IDE 衍生产品使用相同的方法。我已经在 RubyMine 2018.2.1 中进行了验证。像@Andy 一样,我遇到了一种情况,我正在查看一些大型的、未格式化的 XML 文件。重新格式化 3.5MB 的文件非常慢,但现在可以了,这正是我想要的。
    • 在无法识别 R 资源类时在 Android 项目中使用它,如 this question;因为生成的源文件超出了限制。
    【解决方案2】:

    这是根据 Álvaro González 的回答和 How to increase IDE memory limit in IntelliJ IDEA on Mac? 构建的

    转到帮助 > 编辑自定义属性

    添加:

    idea.max.intellisense.filesize=999999
    

    重新启动 IDE。

    【讨论】:

    • 对于 Windows 上的 Android Studio,它要求我创建新文件 C:\Users\<username>\.AndroidStudio2.3\idea.properties。但最后它奏效了。非常感谢!
    • 如果您想知道,该值以 KB 为单位,默认为 2500。jetbrains.com/help/idea/tuning-the-ide.html
    【解决方案3】:

    编辑 IDEA 的配置文件:IDEA_HOME/bin/idea.properties

    # Maximum file size (kilobytes) IDE should provide code assistance for.
    idea.max.intellisense.filesize=60000
    
    # Maximum file size (kilobytes) IDE is able to open.
    idea.max.content.load.filesize=60000
    

    保存并重启 IDEA

    【讨论】:

    • 默认的 max.content 设置也是其他设置的 10 倍
    【解决方案4】:

    转到 IDE:

    第 1 步: 打开菜单项:点击Help,然后点击Edit Custom Properties

    第 2 步: 设置参数:

    idea.max.intellisense.filesize= 999999999

    【讨论】:

    • 这似乎是之前几个答案的重复。
    • 此解决方案在使用 snap 安装时有效
    • @isherwood 从技术上讲不是重复,因为值(9 的数量)更高。
    • 最后还需要重启IDE!
    【解决方案5】:

    Instructions for changing this settings in latest Jetbrains products

    编辑 product64.vmoptions 对我不起作用,但编辑 idea.properties 工作正常。 此外,为了能够处理大文件,您可能需要更改 product64.vmoptions / product.vmoptions 中 -Xms 和 -Xmx

    【讨论】:

      【解决方案6】:

      为了澄清Alvaro's 的答案,您需要将 -D 选项添加到命令行列表中。我用的是 PyCharm,但概念是一样的:

      pycharm{64,.exe,64.exe}.vmoptions:
      <code>
          -server
          -Xms128m
          ...
          -Didea.max.intellisense.filesize=999999 # <--- new line
      </code>
      

      【讨论】:

      • 你不必添加'-D',你需要使用idea.properties文件而不是vmoptions文件。
      • 我正在使用 64 位可执行文件并将其添加到 idea.properties 中没有应用更改。如上所述添加换行符为我解决了这个问题。应该有类似的idea64.properties文件吗?
      • @Noremac - 在同一个bin 目录中有一个PhpStorm.bat 文件表明有一个-Didea.properties.file=... JVM 选项:-?
      【解决方案7】:

      对于那些不知道在哪里找到他们正在谈论的文件的人。在我的机器 (OSX) 上,它位于:

      • PyCharm CE:/Applications/PyCharm CE.app/Contents/bin/idea.properties
      • 网络风暴:/Applications/WebStorm.app/Contents/bin/idea.properties

      【讨论】:

      • 我也是 OSX 用户,接受的答案对我有用。在 RubyMine 中执行,但它们都应该是相同的。
      【解决方案8】:

      适用于 64 位 2020 版本

      我徒劳地试图找到该文件在 2020 版中的当前位置。导航到Help &gt; Edit Custom Properties 时,会在appData/Roaming/JetBrains/IntelliJIdea2020.1/idea.properties 创建一个新(空)文件。正如一些教程所建议的那样,没有 /bin 目录。但是,将 accepted answer 中的块添加到此文件或将同一文件添加到 /bin 都不会导致我的配置更新。

      我终于发现appData/Roaming/JetBrains/IntelliJIdea2020.1/idea64.exe.vmoptions 中存在对同一属性的引用。它看起来像这样:

      -Didea.max.intellisense.filesize=3470
      

      我改成这个了,应该可以满足我的需求了:

      -Didea.max.intellisense.filesize=9999
      

      这让我觉得这是这个版本中的一个错误,其中菜单项的行为不能反映所需的内容,但也可能是我的特定设置与库存有所不同。我确实安装了 PyCharm 和 JDK。

      【讨论】:

      【解决方案9】:

      PhpStorm 2020

      1. 帮助 -> 编辑自定义属性。
      2. 文件将在编辑器中打开。将以下部分粘贴到文件中。
       #---------------------------------------------------------------------
       # 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.intellisense.filesize=2500
      
      1. 文件 -> 无效/重新启动 -> 重新启动

      这有时可能不会更新,您可能需要编辑根 idea.properties 文件。

      为任何版本的 Idea 编辑此文件

      1. 转到应用程序位置,即 linux => /opt/PhpStorm[version]/bin
      2. 找到名为idea.properties的文件备份文件,即idea.properties.old
      3. 使用任何 txt 编辑器打开原件。
      4. 查找idea.max.intellisense.filesize=
      5. 替换为idea.max.intellisense.filesize=your_required_sizeidea.max.intellisense.filesize=10480 NB by default this size is in kb
      6. 保存并重新启动 IDE。

      【讨论】:

        【解决方案10】:

        Webstorm 的 Windows 默认安装位置:

        C:\Program Files\JetBrains\WebStorm 2019.1.3\bin\idea.properties

        我去了x4 default for intellisensex5 for file size

        (不过,我的商务工作站很牛:第 8 代 i7、32Gb RAM、NVMe PCIE3.0x4 SDD、幸灾乐祸等、幸灾乐祸等

        #---------------------------------------------------------------------
        # 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.intellisense.filesize=10000
        
            #---------------------------------------------------------------------
            # Maximum file size (kilobytes) IDE is able to open.
            #--------------------------------------------------------------------- 
        
        idea.max.content.load.filesize=100000
        

        【讨论】:

          【解决方案11】:

          从帮助菜单中更改上述选项对我不起作用。 您已编辑 idea.properties 文件并更改为一些大编号。

          MAC: /Applications/<Android studio>.app/Contents/bin[Open App contents] 
          
          Idea.max.intellisense.filesize=999999 
          
          WINDOWS: IDE_HOME\bin\idea.properties
          

          【讨论】:

            猜你喜欢
            • 2016-07-05
            • 1970-01-01
            • 2017-12-19
            • 1970-01-01
            • 1970-01-01
            • 2016-01-08
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            相关资源
            最近更新 更多