Spellchecker: WI-27124 reload dictionary on externals changes

- toSystemDependentName should be instead of toSystemIndependentName
This commit is contained in:
Olga Strizhenko
2017-09-12 18:52:43 +03:00
parent be6f6c3788
commit c4d46a112b
@@ -49,7 +49,7 @@ import java.io.InputStream;
import java.util.*;
import static com.intellij.openapi.util.io.FileUtil.isAncestor;
import static com.intellij.util.PathUtil.toSystemIndependentName;
import static com.intellij.openapi.util.io.FileUtilRt.toSystemDependentName;
public class SpellCheckerManager implements Disposable {
private static final Logger LOG = Logger.getInstance("#com.intellij.spellchecker.SpellCheckerManager");
@@ -78,7 +78,7 @@ public class SpellCheckerManager implements Disposable {
myVirtualFileListener = new VirtualFileListener() {
@Override
public void fileDeleted(@NotNull VirtualFileEvent event) {
final String path = toSystemIndependentName(event.getFile().getPath());
final String path = toSystemDependentName(event.getFile().getPath());
if (spellChecker.isDictionaryLoad(path)) {
spellChecker.removeDictionary(path);
restartInspections();
@@ -87,7 +87,7 @@ public class SpellCheckerManager implements Disposable {
@Override
public void fileCreated(@NotNull VirtualFileEvent event) {
final String path = toSystemIndependentName(event.getFile().getPath());
final String path = toSystemDependentName(event.getFile().getPath());
boolean customDic = FileUtilRt.extensionEquals(path, "dic") &&
settings.getDictionaryFoldersPaths().stream().anyMatch(dicFolderPath -> isAncestor(dicFolderPath, path, true));
if (customDic) {
@@ -98,7 +98,7 @@ public class SpellCheckerManager implements Disposable {
@Override
public void contentsChanged(@NotNull VirtualFileEvent event) {
final String path = toSystemIndependentName(event.getFile().getPath());
final String path = toSystemDependentName(event.getFile().getPath());
if (settings.getDisabledDictionariesPaths().contains(path)) return;
if (spellChecker.isDictionaryLoad(path)) {