mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Spellchecker: WI-27124 reload dictionary on externals changes
- toSystemDependentName should be instead of toSystemIndependentName
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user