【问题标题】:How do you format a file without the excepted extension in PyCharm?如何在 PyCharm 中格式化没有例外扩展名的文件?
【发布时间】:2022-11-28 09:46:59
【问题描述】:

语境:

我将数据保存到没有扩展名的文件中。这些文件映射到 http url 但位于文件系统上并用作缓存。即http://server.com/calendar/data 将在/tmp/calendar/data 处有一个相应的文件。所以保持文件名不变很重要。

当我打开文件 data 时,它是 PyCharm 中的一个 json 文件,我不能 Reformat Code 并使其易于阅读。

有没有办法在 PyCharm 中格式化 json ad hoc 文件?是否可以在 PyCharm 中选择格式化程序而不是让扩展指定它?

【问题讨论】:

    标签: pycharm


    【解决方案1】:

    右键单击该文件,然后单击 Override File Type,然后选择 JSON。

    按照上述步骤,激活Reformat Code选项:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-10-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-02-15
      • 2013-11-03
      • 2016-12-24
      相关资源
      最近更新 更多