Bug 204370 - Unable to spell check both C++ and Java
Summary: Unable to spell check both C++ and Java
Status: RESOLVED DUPLICATE of bug 185695
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.3   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-22 20:58 EDT by Sergey Prigogin CLA
Modified: 2007-09-24 08:16 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Prigogin CLA 2007-09-22 20:58:01 EDT
I'm trying to implement spelling checker for CDT (see bug 190512). Unfortunately, org.eclipse.ui.workbench.texteditor.spellingEngine extension point does not allow spelling engine to be selected depending on the content type. If I define a CDT specific spelling engine:

<extension point="org.eclipse.ui.workbench.texteditor.spellingEngine">
  <engine
    preferencesClass="org.eclipse.cdt.internal.ui.SpellingPreferenceBlock"
    label="C++ spelling engine"
    class="org.eclipse.cdt.internal.ui.text.spelling.CSpellingEngine"
    default="true"
    id="org.eclipse.cdt.internal.ui.text.spelling.CSpellingEngine">
  </engine>
</extension>

users would have to choose between org.eclipse.jdt.internal.ui.text.spelling.DefaultSpellingEngine and org.eclipse.cdt.internal.ui.text.spelling.CSpellingEngine. The former supports javaSource, javaProperties and text context types, the latter supports cHeader, cSource, cxxHeader, cxxSource and text content types. There is no way to enable spell checking of javaSource and cxxSource at the same time. In a mixed C++/Java environment the user would have to select a different spelling engine in Preferences/General/Editors/Text Editors/Spelling when she switches from editing C++ to Java. This is unacceptable.

One possible way to remedy this situation is to move org.eclipse.jdt.internal.ui.text.spelling.DefaultSpellingEngine class from JDT to the platform and make it support an extension point that would allow plug-ins to contribute content type-specific spelling engines.

en_GB.dictionary and en_US.dictionary files should also be moved from JDT to the platform, so that they can be used by spelling engines outside of JDT.

Other candidates for moving from JDT to the platform are: org.eclipse.jdt.internal.ui.text.spelling.engine package and org.eclipse.jdt.internal.ui.text.spelling.TextSpellingEngine class.
Comment 1 Dani Megert CLA 2007-09-24 08:16:17 EDT
Note that you can decide to use your own (C++) spelling service even if it is not set to be the default one on the preference page.

*** This bug has been marked as a duplicate of bug 185695 ***