如何在 Eclipse 中使用(共享)项目范围的拼写检查字典?

发布于 2024-12-17 16:17:31 字数 190 浏览 3 评论 0原文

对于多开发人员 Eclipse 项目来说拥有用户词典是没有意义的,因此我正在寻找一种解决方案,允许我与所有用户共享拼写检查词典。

正如您可以想象的那样,每个用户的结帐和日食位置可能不同。

另外,字典应该保留在项目目录中,因为我想将它添加到项目使用的版本控制系统中。

这个问题针对的是最新发布的Eclipse 3.7版本

It doesn't make sense to have user dictionaries for multi-developer Eclipse projects, so I'm looking for a solution that would allow me to share a spell-check dictionary with all users.

As you can imagine the checkout and eclipse locations can be different for each user.

Also the dictionary should stay inside project directory because I want to add it to the version control system used by the project.

This question is targeted to the latest released version of Eclipse 3.7

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

罗罗贝儿 2024-12-24 16:17:31

要在所有项目中使用项目特定的字典,您可以在项目的根目录下创建一个文件 .dictionary,并将“用户定义的字典”的值设置为 (General- >编辑器->文本编辑器->拼写)到${project_loc}/.dictionary。我不知道如何同时拥有全局词典和特定于项目的词典,因为相关的首选项页面仅允许一个“用户定义的词典”。

注意:当项目中没有定义 .dictionary 文件时,可能会出现一些非常令人困惑的行为。该行为取决于拼写检查实现的某些隐藏缓存行为以及您之前的操作,并且可能被视为 Eclipse bug。

  1. 如果您刚刚打开 Eclipse,进入一个没有.dictionary的项目,编辑一些文件,并向字典添加拼写,Eclipse 将创建.dictionary 文件。这很奇怪,因为它甚至不会从主向导页面执行此操作。您必须先手动创建该文件,然后才能指定它。

  2. 如果您第一次工作的项目.dictionary,然后切换到另一个没有的项目,编辑一个文件,并添加拼写,Eclipse 会将其添加到原始项目中的.dictionary

  3. 无论刷新项目或文件,删除词典中的全部内容或删除词典文件都不会导致添加的单词被重新标记为拼写错误。然而,关闭并收割 Eclipse 确实会恢复单词的“拼写错误”状态。

仅供参考,我正在使用 Eclipse Indigo Service Release 1; Mac OS X lion 上的内部版本号:20110916-0149。

To use project-specific dictionaries in all your projects, you could create a file .dictionary at the root of your project, and set the value of the "User defined dictionary" at (General->Editors->Text Editors->Spelling) to ${project_loc}/.dictionary. I don't know how to have BOTH a global dictionary and a project-specific dictionary, as the relevant preference page allows only one "User defined dictionary".

Note: that there can be some very confusing behavior when you don't have .dictionary files defined in a project. The behavior depends on some hidden cache behavior of the spell-checking implementation and your previous actions, and might be considered an Eclipse bug.

  1. If you have just opened Eclipse, go to a project without a .dictionary, edit some file, and add a spelling to the dictionary, Eclipse will create the .dictionary file. That is strange because it won't even do that from the main wizard page. You have to create the file manually first before you can specify it.

  2. If you were first working in project that does have a .dictionary, then switch to a different project without one, edit a file, and add a spelling, Eclipse will add it to the .dictionary in the original project!

  3. Deleting entires in the dictionary or deleting the dictionary file will not cause the added words to be relabeled as misspelled, regardless of refreshing the project or file. Closing and reaping Eclipse does, however, restore the "misspelled" status of words.

FYI, I am using Eclipse Indigo Service Release 1; Build id: 20110916-0149 on Mac OS X lion.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文