Bug 204370

Summary: Unable to spell check both C++ and Java
Product: [Eclipse Project] Platform Reporter: Sergey Prigogin <eclipse.sprigogin>
Component: TextAssignee: Platform-Text-Inbox <platform-text-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: aleherb+eclipse, cdtdoug, thatnitind
Version: 3.3   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

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 ***