How to get Scala Compiler Plugin to work in Scala IDE

痴心易碎 提交于 2019-12-05 16:41:17

The Scala IDE uses the presentation compiler, not the compiler that you've installed. To use a plugin, with Scala IDE, you need to specify it in the preferences in Eclipse.

Try Windows->Preferences->Scala->Compiler. See the Advanced tab. The paths are relative to the workspace.

EDIT: When I say relative to the workspace, I mean the actual workspace directory under which the .metadata is stored ($workspace_loc). I have a project where project files including the source code is stored in one directory and the workspace is elsewhere, i.e the $project_loc (c:\code\project\source) is different from the $workspace_loc (c:\code\project\workspace). The directory that you specify in the compiler parameters is relative to the workspace ($workspace_loc).

To find out if you have a similar setup, go to the project and select Properties->Resource->Linked Resources.

I created a directory under $workspace_loc called plugin and placed the jar file in there. Under Windows->Preferences->Scala->Compiler Advanced tab I have

Xplugin = C:\code\project\workspace\plugin\xxx-0.0.1.jar
Xplugin-require = xxx

Please note that you can specify the plugin in the project properties as well, but it still uses $workspace_loc. The above configuration works for me.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!