1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 17:26:01 +02:00

Bug 406783 - [spell-check] Support variables for CDT user dictionary.

Simply copied the respective code from JDT SpellCheckEngine,
which was introduced with the fix for bug 70410 on 9-Jul-2007 ,
http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=d235827d8379f62fd5c488aabdec635fbb5005a2

Change-Id: I7139f6288112dd311d9cc72e15cc67f70cb9d013
Reviewed-on: https://git.eclipse.org/r/12377
Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com>
Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
This commit is contained in:
Martin Oberhuber 2013-04-30 03:03:27 -07:00 committed by Sergey Prigogin
parent 1c02252146
commit 41edb9360b

View file

@ -22,10 +22,13 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.Map.Entry;
import java.util.Set;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.variables.IStringVariableManager;
import org.eclipse.core.variables.VariablesPlugin;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
@ -339,7 +342,19 @@ public class SpellCheckEngine implements ISpellCheckEngine, IPropertyChangeListe
fUserDictionary= null;
}
final String filePath= SpellingPreferences.getSpellingUserDictionary();
String filePath= SpellingPreferences.getSpellingUserDictionary();
VariablesPlugin variablesPlugin= VariablesPlugin.getDefault();
if (variablesPlugin == null)
return;
IStringVariableManager variableManager= variablesPlugin.getStringVariableManager();
try {
filePath= variableManager.performStringSubstitution(filePath);
} catch (CoreException e) {
CUIPlugin.log(e);
return;
}
if (filePath.length() > 0) {
try {
File file= new File(filePath);