allow to turn off suggestion to create a file when creating a directory with file-like name (IDEA-118250)

This commit is contained in:
peter
2014-01-13 19:58:46 +01:00
parent a0be495846
commit 5d81e8d215
2 changed files with 5 additions and 1 deletions
@@ -28,6 +28,7 @@ import com.intellij.openapi.fileTypes.UnknownFileType;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.InputValidatorEx;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.PsiDirectory;
import com.intellij.psi.PsiFileSystemItem;
@@ -104,7 +105,7 @@ public class CreateDirectoryOrPackageHandler implements InputValidatorEx {
}
boolean createFile = false;
if (StringUtil.countChars(subDirName, '.') == 1) {
if (StringUtil.countChars(subDirName, '.') == 1 && Registry.is("ide.suggest.file.when.creating.filename.like.directory")) {
FileType fileType = findFileTypeBoundToName(subDirName);
if (fileType != null) {
String message = "The name you entered looks like a file name. Do you want to create a file named " + subDirName + " instead?";
@@ -202,6 +202,9 @@ psi.incremental.reparse.depth.limit=1000
psi.deferIconLoading=true
psi.track.invalidation=true
ide.suggest.file.when.creating.filename.like.directory=true
ide.suggest.file.when.creating.filename.like.directory.description=When creating a directory named foo.txt, suggest to create a file with such a name instead
find.search.in.project.files=false
structureView.coalesceTime=500