简体   繁体   English

在Intellij中突出显示Scala脚本

[英]Scala script highlighting in intellij

I've got a rather large project set up in intellij. 我在intellij建立了一个相当大的项目。 The project uses scala scripts to specify various instances of the program. 该项目使用scala脚本来指定程序的各种实例。

It used to be the case that the scala scripts were in a resources directory of the project, but, this is not ideal. Scala脚本曾经在项目的资源目录中,但这种情况并不理想。 I've moved them, so my project looks like this (the idea is, ultimately, to move them away completely) 我已经移动了它们,所以我的项目看起来像这样(最终的想法是将它们完全移开)

+Project root
  +subproject
    +src.main.resources
        [Scripts were here]
     pom
     iml
   pom
   iml

  +scripts
      [scripts are now here]

but now intellij syntax highlighting does not recognise the scripted imports relating to the project. 但现在intellij语法突出显示无法识别与项目相关的脚本化导入。 Is there some way of getting intellij to recognise the dependency of these scripts without going back to a module structure and the src/main/resources folder? 有什么方法可以让intellij识别这些脚本的依赖性,而无需返回模块结构和src / main / resources文件夹?

Define scripts as a source folder: scripts定义为源文件夹:

File > Project Structure > Modules > Sources

and mark scripts as Sources (blue icon). 并将scripts标记为Sources (蓝色图标)。

You can find more info on IntelliJ WebHelp . 您可以在IntelliJ WebHelp上找到更多信息。

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

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