Merge remote-tracking branch 'origin/master'

This commit is contained in:
Vladimir.Orlov
2016-01-28 15:29:42 +03:00
38 changed files with 532 additions and 312 deletions
@@ -22,7 +22,6 @@
package com.intellij.compiler.impl;
import com.intellij.compiler.CompilerConfiguration;
import com.intellij.compiler.CompilerMessageImpl;
import com.intellij.compiler.CompilerWorkspaceConfiguration;
import com.intellij.compiler.ProblemsView;
import com.intellij.compiler.progress.CompilerTask;
@@ -37,25 +36,21 @@ import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ModuleRootManager;
import com.intellij.openapi.roots.ProjectFileIndex;
import com.intellij.openapi.roots.ProjectRootManager;
import com.intellij.openapi.util.UserDataHolderBase;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.VirtualFileManager;
import com.intellij.pom.Navigatable;
import com.intellij.util.containers.HashMap;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.*;
import java.util.UUID;
public class CompileContextImpl extends UserDataHolderBase implements CompileContextEx {
private static final Logger LOG = Logger.getInstance("#com.intellij.compiler.impl.CompileContextImpl");
private final Project myProject;
private final CompilerTask myBuildSession;
private final Map<CompilerMessageCategory, Collection<CompilerMessage>> myMessages = new EnumMap<CompilerMessageCategory, Collection<CompilerMessage>>(CompilerMessageCategory.class);
private final MessagesContainer myMessages;
private final boolean myShouldUpdateProblemsView;
private CompileScope myCompileScope;
private final boolean myMake;
@@ -63,9 +58,6 @@ public class CompileContextImpl extends UserDataHolderBase implements CompileCon
private final boolean myIsAnnotationProcessorsEnabled;
private boolean myRebuildRequested;
private String myRebuildReason;
private final Map<VirtualFile, Module> myRootToModuleMap = new HashMap<VirtualFile, Module>();
private final Map<Module, Set<VirtualFile>> myModuleToRootsMap = new HashMap<Module, Set<VirtualFile>>();
private final Set<VirtualFile> myGeneratedTestRoots = new HashSet<VirtualFile>();
private final ProjectFileIndex myProjectFileIndex; // cached for performance reasons
private final ProjectCompileScope myProjectCompileScope;
private final long myStartCompilationStamp;
@@ -76,6 +68,7 @@ public class CompileContextImpl extends UserDataHolderBase implements CompileCon
@NotNull CompileScope compileScope,
boolean isMake, boolean isRebuild) {
myProject = project;
myMessages = new MessagesContainer(project);
myBuildSession = compilerSession;
myCompileScope = compileScope;
myMake = isMake;
@@ -117,37 +110,17 @@ public class CompileContextImpl extends UserDataHolderBase implements CompileCon
@Override
public CompilerMessage[] getMessages(CompilerMessageCategory category) {
Collection<CompilerMessage> collection = myMessages.get(category);
if (collection == null) {
return CompilerMessage.EMPTY_ARRAY;
}
return collection.toArray(new CompilerMessage[collection.size()]);
return myMessages.getMessages(category).toArray(CompilerMessage.EMPTY_ARRAY);
}
@Override
public void addMessage(CompilerMessageCategory category, String message, String url, int lineNum, int columnNum) {
final CompilerMessageImpl msg = new CompilerMessageImpl(myProject, category, message, findFileByUrl(url), lineNum, columnNum, null);
addMessage(msg);
addMessage(category, message, url, lineNum, columnNum, null);
}
@Override
public void addMessage(CompilerMessageCategory category, String message, String url, int lineNum, int columnNum,
Navigatable navigatable) {
final CompilerMessageImpl msg = new CompilerMessageImpl(myProject, category, message, findFileByUrl(url), lineNum, columnNum, navigatable);
addMessage(msg);
}
@Nullable
private static VirtualFile findFileByUrl(@Nullable String url) {
if (url == null) {
return null;
}
VirtualFile file = VirtualFileManager.getInstance().findFileByUrl(url);
if (file == null) {
// groovy stubs may be placed in completely random directories which aren't refreshed automatically
return VirtualFileManager.getInstance().refreshAndFindFileByUrl(url);
}
return file;
public void addMessage(CompilerMessageCategory category, String message, String url, int lineNum, int columnNum, Navigatable navigatable) {
myMessages.addMessage(category, message, url, lineNum, columnNum, navigatable);
}
@Override
@@ -155,13 +128,7 @@ public class CompileContextImpl extends UserDataHolderBase implements CompileCon
if (ApplicationManager.getApplication().isUnitTestMode()) {
LOG.info("addMessage: " + msg + " this=" + this);
}
Collection<CompilerMessage> messages = myMessages.get(msg.getCategory());
if (messages == null) {
messages = new LinkedHashSet<CompilerMessage>();
myMessages.put(msg.getCategory(), messages);
}
if (messages.add(msg)) {
if (myMessages.addMessage(msg)) {
myBuildSession.addMessage(msg);
}
if (myShouldUpdateProblemsView && msg.getCategory() == CompilerMessageCategory.ERROR) {
@@ -171,17 +138,7 @@ public class CompileContextImpl extends UserDataHolderBase implements CompileCon
@Override
public int getMessageCount(CompilerMessageCategory category) {
if (category != null) {
Collection<CompilerMessage> collection = myMessages.get(category);
return collection != null ? collection.size() : 0;
}
int count = 0;
for (Collection<CompilerMessage> collection : myMessages.values()) {
if (collection != null) {
count += collection.size();
}
}
return count;
return myMessages.getMessageCount(category);
}
@Override
@@ -226,59 +183,9 @@ public class CompileContextImpl extends UserDataHolderBase implements CompileCon
LOG.assertTrue(!module.isDisposed());
return module;
}
for (final VirtualFile root : myRootToModuleMap.keySet()) {
if (VfsUtilCore.isAncestor(root, file, false)) {
final Module mod = myRootToModuleMap.get(root);
if (mod != null) {
LOG.assertTrue(!mod.isDisposed());
}
return mod;
}
}
return null;
}
private final Map<Module, VirtualFile[]> myModuleToRootsCache = new HashMap<Module, VirtualFile[]>();
@Override
public VirtualFile[] getSourceRoots(Module module) {
VirtualFile[] cachedRoots = myModuleToRootsCache.get(module);
if (cachedRoots != null) {
if (areFilesValid(cachedRoots)) {
return cachedRoots;
}
else {
myModuleToRootsCache.remove(module); // clear cache for this module and rebuild list of roots
}
}
Set<VirtualFile> additionalRoots = myModuleToRootsMap.get(module);
VirtualFile[] moduleRoots = ModuleRootManager.getInstance(module).getSourceRoots();
if (additionalRoots == null || additionalRoots.isEmpty()) {
myModuleToRootsCache.put(module, moduleRoots);
return moduleRoots;
}
final VirtualFile[] allRoots = new VirtualFile[additionalRoots.size() + moduleRoots.length];
System.arraycopy(moduleRoots, 0, allRoots, 0, moduleRoots.length);
int index = moduleRoots.length;
for (final VirtualFile additionalRoot : additionalRoots) {
allRoots[index++] = additionalRoot;
}
myModuleToRootsCache.put(module, allRoots);
return allRoots;
}
private static boolean areFilesValid(VirtualFile[] files) {
for (VirtualFile file : files) {
if (!file.isValid()) {
return false;
}
}
return true;
}
@Override
public VirtualFile getModuleOutputDirectory(Module module) {
return CompilerPaths.getModuleOutputDirectory(module, false);
@@ -294,6 +201,11 @@ public class CompileContextImpl extends UserDataHolderBase implements CompileCon
return myMake;
}
@Override
public boolean isAutomake() {
return false;
}
@Override
public boolean isRebuild() {
return myIsRebuild;
@@ -309,22 +221,6 @@ public class CompileContextImpl extends UserDataHolderBase implements CompileCon
myCompileScope = new CompositeScope(myCompileScope, additionalScope);
}
@Override
public boolean isInTestSourceContent(@NotNull final VirtualFile fileOrDir) {
if (myProjectFileIndex.isInTestSourceContent(fileOrDir)) {
return true;
}
return VfsUtilCore.isUnder(fileOrDir, myGeneratedTestRoots);
}
@Override
public boolean isInSourceContent(@NotNull final VirtualFile fileOrDir) {
if (myProjectFileIndex.isInSourceContent(fileOrDir)) {
return true;
}
return VfsUtilCore.isUnder(fileOrDir, myRootToModuleMap.keySet());
}
public UUID getSessionId() {
return mySessionId;
}
@@ -22,7 +22,10 @@
package com.intellij.compiler.impl;
import com.intellij.CommonBundle;
import com.intellij.compiler.*;
import com.intellij.compiler.CompilerWorkspaceConfiguration;
import com.intellij.compiler.ModuleCompilerUtil;
import com.intellij.compiler.ModuleSourceSet;
import com.intellij.compiler.ProblemsView;
import com.intellij.compiler.progress.CompilerTask;
import com.intellij.compiler.server.BuildManager;
import com.intellij.compiler.server.DefaultMessageHandler;
@@ -489,27 +492,10 @@ public class CompileDriver {
if (!outputs.isEmpty()) {
final ProgressIndicator indicator = compileContext.getProgressIndicator();
indicator.setText("Synchronizing output directories...");
CompilerUtil.refreshOutputDirectories(outputs, _status == ExitStatus.CANCELLED);
CompilerUtil.refreshOutputDirectories(outputs, false);
indicator.setText("");
}
}
if (compileContext.isAnnotationProcessorsEnabled() && !myProject.isDisposed()) {
final Set<File> genSourceRoots = new THashSet<File>(FileUtil.FILE_HASHING_STRATEGY);
final CompilerConfiguration config = CompilerConfiguration.getInstance(myProject);
for (Module module : affectedModules) {
if (!module.isDisposed() && config.getAnnotationProcessingConfiguration(module).isEnabled()) {
final String path = CompilerPaths.getAnnotationProcessorsGenerationPath(module);
if (path != null) {
genSourceRoots.add(new File(path));
}
}
}
if (!genSourceRoots.isEmpty()) {
// refresh generates source roots asynchronously; needed for error highlighting update
LocalFileSystem.getInstance().refreshIoFiles(genSourceRoots, true, true, null);
}
}
}
SwingUtilities.invokeLater(new Runnable() {
public void run() {
@@ -0,0 +1,94 @@
/*
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.compiler.impl;
import com.intellij.compiler.CompilerMessageImpl;
import com.intellij.openapi.compiler.CompilerMessage;
import com.intellij.openapi.compiler.CompilerMessageCategory;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.VirtualFileManager;
import com.intellij.pom.Navigatable;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.*;
/**
* @author Eugene Zhuravlev
* Date: 27-Jan-16
*/
public class MessagesContainer {
private final Project myProject;
private final Map<CompilerMessageCategory, Collection<CompilerMessage>> myMessages = new EnumMap<CompilerMessageCategory, Collection<CompilerMessage>>(CompilerMessageCategory.class);
public MessagesContainer(Project project) {
myProject = project;
}
@NotNull
public Collection<CompilerMessage> getMessages(CompilerMessageCategory category) {
final Collection<CompilerMessage> collection = myMessages.get(category);
if (collection == null) {
return Collections.emptyList();
}
return Collections.unmodifiableCollection(collection);
}
public CompilerMessage addMessage(CompilerMessageCategory category, String message, String url, int lineNum, int columnNum, Navigatable navigatable) {
final CompilerMessageImpl msg =
new CompilerMessageImpl(myProject, category, message, findFileByUrl(url), lineNum, columnNum, navigatable);
addMessage(msg);
return msg;
}
public boolean addMessage(CompilerMessage msg) {
Collection<CompilerMessage> messages = myMessages.get(msg.getCategory());
if (messages == null) {
messages = new LinkedHashSet<CompilerMessage>();
myMessages.put(msg.getCategory(), messages);
}
return messages.add(msg);
}
@Nullable
private static VirtualFile findFileByUrl(@Nullable String url) {
if (url == null) {
return null;
}
VirtualFile file = VirtualFileManager.getInstance().findFileByUrl(url);
if (file == null) {
// groovy stubs may be placed in completely random directories which aren't refreshed automatically
return VirtualFileManager.getInstance().refreshAndFindFileByUrl(url);
}
return file;
}
public int getMessageCount(CompilerMessageCategory category) {
if (category != null) {
Collection<CompilerMessage> collection = myMessages.get(category);
return collection != null ? collection.size() : 0;
}
int count = 0;
for (Collection<CompilerMessage> collection : myMessages.values()) {
if (collection != null) {
count += collection.size();
}
}
return count;
}
}
@@ -18,21 +18,21 @@ package com.intellij.compiler.server;
import com.intellij.compiler.CompilerMessageImpl;
import com.intellij.compiler.ProblemsView;
import com.intellij.notification.Notification;
import com.intellij.openapi.compiler.CompilationStatusListener;
import com.intellij.openapi.compiler.CompilerManager;
import com.intellij.openapi.compiler.CompilerMessageCategory;
import com.intellij.openapi.compiler.CompilerTopics;
import com.intellij.openapi.compiler.*;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.MessageType;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.VirtualFileManager;
import com.intellij.problems.Problem;
import com.intellij.problems.WolfTheProblemSolver;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jps.api.CmdlineRemoteProto;
import org.jetbrains.jps.api.GlobalOptions;
import javax.swing.*;
import java.util.Collections;
import java.util.UUID;
@@ -46,12 +46,14 @@ class AutoMakeMessageHandler extends DefaultMessageHandler {
private final Project myProject;
private final WolfTheProblemSolver myWolf;
private volatile boolean myUnprocessedFSChangesDetected = false;
private final AutomakeCompileContext myContext;
public AutoMakeMessageHandler(Project project) {
super(project);
myProject = project;
myBuildStatus = CmdlineRemoteProto.Message.BuilderMessage.BuildEvent.Status.SUCCESS;
myWolf = WolfTheProblemSolver.getInstance(project);
myContext = new AutomakeCompileContext(project);
}
public boolean unprocessedFSChangesDetected() {
@@ -69,9 +71,27 @@ class AutoMakeMessageHandler extends DefaultMessageHandler {
}
switch (event.getEventType()) {
case BUILD_COMPLETED:
myContext.getProgressIndicator().stop();
if (event.hasCompletionStatus()) {
myBuildStatus = event.getCompletionStatus();
final CmdlineRemoteProto.Message.BuilderMessage.BuildEvent.Status status = event.getCompletionStatus();
myBuildStatus = status;
if (status == CmdlineRemoteProto.Message.BuilderMessage.BuildEvent.Status.CANCELED) {
myContext.getProgressIndicator().cancel();
}
}
final int errors = myContext.getMessageCount(CompilerMessageCategory.ERROR);
final int warnings = myContext.getMessageCount(CompilerMessageCategory.WARNING);
//noinspection SSBasedInspection
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
if (myProject.isDisposed()) {
return;
}
final CompilationStatusListener publisher = myProject.getMessageBus().syncPublisher(CompilerTopics.COMPILATION_STATUS);
publisher.automakeCompilationFinished(errors, warnings, myContext);
}
});
return;
case FILES_GENERATED:
@@ -112,14 +132,29 @@ class AutoMakeMessageHandler extends DefaultMessageHandler {
view.setProgress(message.getText());
}
}
else if (kind == CmdlineRemoteProto.Message.BuilderMessage.CompileMessage.Kind.ERROR) {
informWolf(myProject, message);
else {
final CompilerMessageCategory category = convertToCategory(kind);
if (category != null) { // only process supported kinds of messages
final String sourceFilePath = message.hasSourceFilePath() ? message.getSourceFilePath() : null;
final String url = sourceFilePath != null ? VirtualFileManager.constructUrl(LocalFileSystem.PROTOCOL, FileUtil.toSystemIndependentName(sourceFilePath)) : null;
final long line = message.hasLine() ? message.getLine() : -1;
final long column = message.hasColumn() ? message.getColumn() : -1;
final CompilerMessage msg = myContext.createAndAddMessage(category, message.getText(), url, (int)line, (int)column, null);
if (kind == CmdlineRemoteProto.Message.BuilderMessage.CompileMessage.Kind.ERROR) {
informWolf(myProject, message);
ProblemsView.SERVICE.getInstance(myProject).addMessage(msg, sessionId);
}
}
}
}
final String sourceFilePath = message.hasSourceFilePath() ? message.getSourceFilePath() : null;
final VirtualFile vFile = sourceFilePath != null? LocalFileSystem.getInstance().findFileByPath(FileUtil.toSystemIndependentName(sourceFilePath)) : null;
final long line = message.hasLine() ? message.getLine() : -1;
final long column = message.hasColumn() ? message.getColumn() : -1;
ProblemsView.SERVICE.getInstance(myProject).addMessage(new CompilerMessageImpl(myProject, CompilerMessageCategory.ERROR, message.getText(), vFile, (int)line, (int)column, null), sessionId);
@Nullable
private static CompilerMessageCategory convertToCategory(CmdlineRemoteProto.Message.BuilderMessage.CompileMessage.Kind kind) {
switch(kind) {
case ERROR: return CompilerMessageCategory.ERROR;
case INFO: return CompilerMessageCategory.INFORMATION;
case WARNING: return CompilerMessageCategory.WARNING;
default: return null;
}
}
@@ -0,0 +1,143 @@
/*
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.compiler.server;
import com.intellij.compiler.CompilerConfiguration;
import com.intellij.compiler.impl.MessagesContainer;
import com.intellij.compiler.impl.ProjectCompileScope;
import com.intellij.openapi.compiler.*;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.progress.EmptyProgressIndicator;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ProjectRootManager;
import com.intellij.openapi.util.UserDataHolderBase;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.pom.Navigatable;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* @author Eugene Zhuravlev
* Date: 27-Jan-16
*/
final class AutomakeCompileContext extends UserDataHolderBase implements CompileContext {
private final Project myProject;
private final ProjectCompileScope myScope;
private final MessagesContainer myMessages;
private final EmptyProgressIndicator myIndicator;
private final boolean myAnnotationProcessingEnabled;
public AutomakeCompileContext(Project project) {
myProject = project;
myScope = new ProjectCompileScope(project);
myMessages = new MessagesContainer(project);
myIndicator = new EmptyProgressIndicator();
myAnnotationProcessingEnabled = CompilerConfiguration.getInstance(project).isAnnotationProcessorsEnabled();
}
@Override
public Project getProject() {
return myProject;
}
@Override
public CompileScope getCompileScope() {
return getProjectCompileScope();
}
@Override
public CompileScope getProjectCompileScope() {
return myScope;
}
@Override
public boolean isMake() {
return true;
}
@Override
public boolean isAutomake() {
return true;
}
public void addMessage(CompilerMessageCategory category, String message, @Nullable String url, int lineNum, int columnNum) {
addMessage(category, message, url, lineNum, columnNum, null);
}
@Override
public void addMessage(CompilerMessageCategory category, String message, @Nullable String url, int lineNum, int columnNum, Navigatable navigatable) {
createAndAddMessage(category, message, url, lineNum, columnNum, navigatable);
}
@Override
public CompilerMessage[] getMessages(CompilerMessageCategory category) {
return myMessages.getMessages(category).toArray(CompilerMessage.EMPTY_ARRAY);
}
public CompilerMessage createAndAddMessage(CompilerMessageCategory category, String message, @Nullable String url, int lineNum, int columnNum, Navigatable navigatable) {
return myMessages.addMessage(category, message, url, lineNum, columnNum, navigatable);
}
@Override
public int getMessageCount(CompilerMessageCategory category) {
return myMessages.getMessageCount(category);
}
@NotNull
@Override
public ProgressIndicator getProgressIndicator() {
return myIndicator;
}
@Override
public void requestRebuildNextTime(String message) {
}
@Override
public boolean isRebuildRequested() {
return false;
}
@Nullable
@Override
public String getRebuildReason() {
return null;
}
@Override
public Module getModuleByFile(VirtualFile file) {
return ProjectRootManager.getInstance(myProject).getFileIndex().getModuleForFile(file);
}
public VirtualFile getModuleOutputDirectory(final Module module) {
return CompilerPaths.getModuleOutputDirectory(module, false);
}
public VirtualFile getModuleOutputDirectoryForTests(final Module module) {
return CompilerPaths.getModuleOutputDirectory(module, true);
}
@Override
public boolean isRebuild() {
return false;
}
@Override
public boolean isAnnotationProcessorsEnabled() {
return myAnnotationProcessingEnabled;
}
}
@@ -42,6 +42,7 @@ import com.intellij.openapi.application.ModalityState;
import com.intellij.openapi.application.PathManager;
import com.intellij.openapi.compiler.CompilationStatusListener;
import com.intellij.openapi.compiler.CompileContext;
import com.intellij.openapi.compiler.CompilerPaths;
import com.intellij.openapi.compiler.CompilerTopics;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.EditorFactory;
@@ -1504,22 +1505,50 @@ public class BuildManager implements Disposable {
});
conn.subscribe(CompilerTopics.COMPILATION_STATUS, new CompilationStatusListener() {
private final Set<String> myRootsToRefresh = new THashSet<String>(FileUtil.PATH_HASHING_STRATEGY);
@Override
public void automakeCompilationFinished(int errors, int warnings, CompileContext compileContext) {
if (!compileContext.getProgressIndicator().isCanceled()) {
refreshSources(compileContext);
}
}
@Override
public void compilationFinished(boolean aborted, int errors, int warnings, CompileContext compileContext) {
final String[] roots;
refreshSources(compileContext);
}
private void refreshSources(CompileContext compileContext) {
if (project.isDisposed()) {
return;
}
final Set<String> candidates = new THashSet<String>(FileUtil.PATH_HASHING_STRATEGY);
synchronized (myRootsToRefresh) {
roots = ArrayUtil.toStringArray(myRootsToRefresh);
candidates.addAll(myRootsToRefresh);
myRootsToRefresh.clear();
}
if (roots.length != 0) {
if (compileContext.isAnnotationProcessorsEnabled()) {
// annotation processors may have re-generated code
final CompilerConfiguration config = CompilerConfiguration.getInstance(project);
for (Module module : compileContext.getCompileScope().getAffectedModules()) {
if (config.getAnnotationProcessingConfiguration(module).isEnabled()) {
final String path = CompilerPaths.getAnnotationProcessorsGenerationPath(module);
if (path != null) {
candidates.add(path);
}
}
}
}
if (!candidates.isEmpty()) {
ApplicationManager.getApplication().executeOnPooledThread(new Runnable() {
@Override
public void run() {
if (project.isDisposed()) {
return;
}
final List<File> rootFiles = new ArrayList<File>(roots.length);
for (String root : roots) {
final List<File> rootFiles = new ArrayList<File>(candidates.size());
for (String root : candidates) {
rootFiles.add(new File(root));
}
// this will ensure that we'll be able to obtain VirtualFile for existing roots
@@ -18,20 +18,11 @@ package com.intellij.openapi.compiler.ex;
import com.intellij.openapi.compiler.CompileContext;
import com.intellij.openapi.compiler.CompileScope;
import com.intellij.openapi.compiler.CompilerMessage;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.NotNull;
public interface CompileContextEx extends CompileContext {
void addMessage(CompilerMessage message);
/**
* the same as FileIndex.isInTestSourceContent(), but takes into account generated output dirs
*/
boolean isInTestSourceContent(@NotNull VirtualFile fileOrDir);
boolean isInSourceContent(@NotNull VirtualFile fileOrDir);
void addScope(CompileScope additionalScope);
}
+2 -3
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<module relativePaths="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
@@ -161,5 +161,4 @@
<option name="useAlternate" value="false" />
</LanguageOptions>
</component>
</module>
</module>
@@ -16,6 +16,9 @@
package com.intellij.openapi.compiler;
public class CompilationStatusAdapter implements CompilationStatusListener {
public void automakeCompilationFinished(int errors, int warnings, CompileContext compileContext) {
}
public void compilationFinished(boolean aborted, int errors, int warnings, final CompileContext compileContext) {
}
@@ -31,7 +31,12 @@ public interface CompilationStatusListener extends EventListener {
* @param warnings warning count
* @param compileContext context for the finished compilation
*/
void compilationFinished(boolean aborted, int errors, int warnings, final CompileContext compileContext);
default void compilationFinished(boolean aborted, int errors, int warnings, final CompileContext compileContext){
}
void fileGenerated(String outputRoot, String relativePath);
default void automakeCompilationFinished(int errors, int warnings, final CompileContext compileContext) {
}
default void fileGenerated(String outputRoot, String relativePath) {
}
}
@@ -114,13 +114,6 @@ public interface CompileContext extends UserDataHolder {
*/
Module getModuleByFile(VirtualFile file);
/**
* Returns the source roots for the specified module.
*
* @return module's source roots as well as source roots for generated sources that are attributed to the module
*/
VirtualFile[] getSourceRoots(Module module);
/**
* Returns the output directory for the specified module.
*
@@ -147,6 +140,8 @@ public interface CompileContext extends UserDataHolder {
*/
boolean isMake();
boolean isAutomake();
boolean isRebuild();
Project getProject();
@@ -112,6 +112,9 @@ public class CompilerPaths {
@Nullable
public static VirtualFile getModuleOutputDirectory(final Module module, boolean forTestClasses) {
final CompilerModuleExtension compilerModuleExtension = CompilerModuleExtension.getInstance(module);
if (compilerModuleExtension == null) {
return null;
}
VirtualFile outPath;
if (forTestClasses) {
final VirtualFile path = compilerModuleExtension.getCompilerOutputPathForTests();
@@ -144,6 +147,9 @@ public class CompilerPaths {
final String outPathUrl;
final Application application = ApplicationManager.getApplication();
final CompilerModuleExtension extension = CompilerModuleExtension.getInstance(module);
if (extension == null) {
return null;
}
if (forTestClasses) {
if (application.isDispatchThread()) {
final String url = extension.getCompilerOutputUrlForTests();
@@ -94,10 +94,6 @@ public class DummyCompileContext implements CompileContext {
return false;
}
public VirtualFile[] getSourceRoots(Module module) {
return VirtualFile.EMPTY_ARRAY;
}
public VirtualFile getModuleOutputDirectory(final Module module) {
return ApplicationManager.getApplication().runReadAction(new Computable<VirtualFile>() {
public VirtualFile compute() {
@@ -121,6 +117,11 @@ public class DummyCompileContext implements CompileContext {
return false; // stub implementation
}
@Override
public boolean isAutomake() {
return false;
}
public boolean isRebuild() {
return false;
}
@@ -16,7 +16,10 @@
package com.intellij.debugger.settings;
import com.intellij.debugger.impl.DebuggerUtilsEx;
import com.intellij.openapi.components.*;
import com.intellij.openapi.components.PersistentStateComponent;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.components.State;
import com.intellij.openapi.components.Storage;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.InvalidDataException;
import com.intellij.openapi.util.WriteExternalException;
@@ -36,7 +39,10 @@ import java.util.Map;
@State(
name = "DebuggerSettings",
defaultStateAsResource = true,
storages = @Storage(file = StoragePathMacros.APP_CONFIG + "/other.xml")
storages = {
@Storage(file = "debugger.xml"),
@Storage(file = "other.xml", deprecated = true)
}
)
public class DebuggerSettings implements Cloneable, PersistentStateComponent<Element> {
private static final Logger LOG = Logger.getInstance(DebuggerSettings.class);
@@ -165,7 +165,7 @@ fun getExportableComponentsMap(onlyExisting: Boolean,
}
}
@Suppress("DEPRECATED_SYMBOL_WITH_MESSAGE")
@Suppress("DEPRECATION")
ApplicationManager.getApplication().getComponents(ExportableApplicationComponent::class.java).forEach(processor)
ServiceBean.loadServicesFromBeans(ExportableComponent.EXTENSION_POINT, ExportableComponent::class.java).forEach(processor)
@@ -189,43 +189,41 @@ fun getExportableComponentsMap(onlyExisting: Boolean,
result.keys.removeAll(::isSkipFile)
}
ServiceManagerImpl.processAllImplementationClasses(ApplicationManager.getApplication() as ApplicationImpl, object : PairProcessor<Class<*>, PluginDescriptor> {
override fun process(aClass: Class<*>, pluginDescriptor: PluginDescriptor?): Boolean {
val stateAnnotation = StoreUtil.getStateSpec(aClass)
if (stateAnnotation == null || stateAnnotation.name.isNullOrEmpty() || ExportableComponent::class.java.isAssignableFrom(aClass)) {
return true
}
val storage = sortStoragesByDeprecated(stateAnnotation.storages).firstOrNull() ?: return true
if (!(storage.roamingType != RoamingType.DISABLED && storage.storageClass == StateStorage::class && storage.scheme == StorageScheme.DEFAULT && !storage.file.isNullOrEmpty())) {
return true
}
var additionalExportFile: File? = null
var additionalExportPath = stateAnnotation.additionalExportFile
if (additionalExportPath.isNotEmpty()) {
// backward compatibility - path can contain macro
if (additionalExportPath[0] != '$') {
additionalExportPath = "$ROOT_CONFIG/$additionalExportPath"
}
additionalExportFile = File(storageManager.expandMacros(additionalExportPath))
if (isSkipFile(additionalExportFile)) {
additionalExportFile = null
}
}
val file = File(storageManager.expandMacros(storage.file))
val isFileIncluded = !isSkipFile(file)
if (isFileIncluded || additionalExportFile != null) {
val files = if (additionalExportFile == null) listOf(file) else if (isFileIncluded) listOf(file, additionalExportFile) else listOf(additionalExportFile)
val item = ExportableItem(files, if (computePresentableNames) getComponentPresentableName(stateAnnotation, aClass, pluginDescriptor) else "", storage.roamingType)
result.putValue(file, item)
if (additionalExportFile != null) {
result.putValue(additionalExportFile, item)
}
}
return true
ServiceManagerImpl.processAllImplementationClasses(ApplicationManager.getApplication() as ApplicationImpl, PairProcessor<Class<*>, PluginDescriptor> { aClass, pluginDescriptor ->
val stateAnnotation = StoreUtil.getStateSpec(aClass)
if (stateAnnotation == null || stateAnnotation.name.isNullOrEmpty() || ExportableComponent::class.java.isAssignableFrom(aClass)) {
return@PairProcessor true
}
val storage = sortStoragesByDeprecated(stateAnnotation.storages).firstOrNull() ?: return@PairProcessor true
if (!(storage.roamingType != RoamingType.DISABLED && storage.storageClass == StateStorage::class && storage.scheme == StorageScheme.DEFAULT && !storage.file.isNullOrEmpty())) {
return@PairProcessor true
}
var additionalExportFile: File? = null
var additionalExportPath = stateAnnotation.additionalExportFile
if (additionalExportPath.isNotEmpty()) {
// backward compatibility - path can contain macro
if (additionalExportPath[0] != '$') {
additionalExportPath = "$ROOT_CONFIG/$additionalExportPath"
}
additionalExportFile = File(storageManager.expandMacros(additionalExportPath))
if (isSkipFile(additionalExportFile)) {
additionalExportFile = null
}
}
val file = File(storageManager.expandMacros(storage.file))
val isFileIncluded = !isSkipFile(file)
if (isFileIncluded || additionalExportFile != null) {
val files = if (additionalExportFile == null) listOf(file) else if (isFileIncluded) listOf(file, additionalExportFile) else listOf(additionalExportFile)
val item = ExportableItem(files, if (computePresentableNames) getComponentPresentableName(stateAnnotation, aClass, pluginDescriptor) else "", storage.roamingType)
result.putValue(file, item)
if (additionalExportFile != null) {
result.putValue(additionalExportFile, item)
}
}
true
})
return result
}
@@ -242,12 +240,24 @@ private fun getComponentPresentableName(state: State, aClass: Class<*>, pluginDe
}
val defaultName = state.name
val resourceBundleName = (if (pluginDescriptor is IdeaPluginDescriptor && "com.intellij" != pluginDescriptor.pluginId.idString) {
pluginDescriptor.resourceBundleBaseName
fun trimDefaultName() = defaultName.removeSuffix("Settings")
var resourceBundleName: String?
if (pluginDescriptor is IdeaPluginDescriptor && "com.intellij" != pluginDescriptor.pluginId.idString) {
resourceBundleName = pluginDescriptor.resourceBundleBaseName
if (resourceBundleName == null) {
if (pluginDescriptor.vendor == "JetBrains") {
resourceBundleName = OptionsBundle.PATH_TO_BUNDLE
}
else {
return trimDefaultName()
}
}
}
else {
OptionsBundle.PATH_TO_BUNDLE
}) ?: return defaultName
resourceBundleName = OptionsBundle.PATH_TO_BUNDLE
}
var classLoader = pluginDescriptor?.pluginClassLoader ?: aClass.classLoader
if (classLoader != null) {
@@ -261,7 +271,7 @@ private fun getComponentPresentableName(state: State, aClass: Class<*>, pluginDe
return messageOrDefault(classLoader, "org.jetbrains.plugins.ruby.RBundle", defaultName)
}
}
return defaultName
return trimDefaultName()
}
private fun messageOrDefault(classLoader: ClassLoader, bundleName: String, defaultName: String): String {
@@ -29,7 +29,7 @@ import java.util.List;
@State(
name = "DefaultColorSchemesManager",
defaultStateAsResource = true,
storages = @Storage(file = StoragePathMacros.APP_CONFIG + "/other.xml")
storages = @Storage(file = "other.xml", roamingType = RoamingType.DISABLED)
)
public class DefaultColorSchemesManager implements PersistentStateComponent<Element> {
private final List<DefaultColorsScheme> mySchemes;
@@ -13,20 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.psi.codeStyle;
import com.intellij.openapi.components.State;
import com.intellij.openapi.components.Storage;
import com.intellij.openapi.components.StoragePathMacros;
@State(
name = "CodeStyleSettingsManager",
storages = {
@Storage(
file = StoragePathMacros.APP_CONFIG + "/other.xml"
)}
storages = {
@Storage(file = "code.style.schemes"),
@Storage(file = "other.xml", deprecated = true)
}
)
public class AppCodeStyleSettingsManager extends CodeStyleSettingsManager{
public class AppCodeStyleSettingsManager extends CodeStyleSettingsManager {
}
@@ -15,14 +15,17 @@
*/
package com.intellij.refactoring;
import com.intellij.openapi.components.*;
import com.intellij.openapi.components.PersistentStateComponent;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.components.State;
import com.intellij.openapi.components.Storage;
import com.intellij.util.xmlb.XmlSerializerUtil;
@State(
name = "BaseRefactoringSettings",
storages = {
@Storage(file = StoragePathMacros.APP_CONFIG + "/baseRefactoring.xml"),
@Storage(file = StoragePathMacros.APP_CONFIG + "/other.xml", deprecated = true)
@Storage(file = "baseRefactoring.xml"),
@Storage(file = "other.xml", deprecated = true)
}
)
public class RefactoringSettings implements PersistentStateComponent<RefactoringSettings> {
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,11 +16,6 @@
package com.intellij.tools;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.Nullable;
import java.util.List;
/**
@@ -1,3 +1,18 @@
/*
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.ui;
import javax.swing.*;
@@ -19,7 +34,7 @@ public class SizedIcon implements Icon {
public void paintIcon(Component c, Graphics g, int x, int y) {
int dx = myWidth - myDelegate.getIconWidth();
int dy = myWidth - myDelegate.getIconHeight();
int dy = myHeight - myDelegate.getIconHeight();
if (dx > 0 || dy > 0) {
myDelegate.paintIcon(c, g, x + dx/2, y + dy/2);
}
@@ -318,9 +318,11 @@ exportable.HttpConfigurable.presentable.name=HTTP Proxy
exportable.KeymapManager.presentable.name=Key maps
exportable.UsageViewSettings.presentable.name=Usage View
exportable.BaseRefactoringSettings.presentable.name=Refactoring
exportable.PropertiesRefactoringSettings.presentable.name=Refactoring: Properties
exportable.DuplocatorSettings.presentable.name=Duplocator
exportable.MultiLanguageDuplocatorSettings.presentable.name=Duplocator
exportable.CodeStyleSchemeSettings.presentable.name=Code Style
exportable.CodeStyleSettingsManager.presentable.name=Code Style
exportable.InspectionProfileManager.presentable.name=Inspection profiles
exportable.TodoConfiguration.presentable.name=Todo
exportable.UISettings.presentable.name=UI Settings
@@ -328,6 +330,7 @@ exportable.FileTypeManager.presentable.name=File types
exportable.EditorColorsManager.presentable.name=Color schemes
exportable.ShortcutPromoterManager.presentable.name=Shortcut Promoter
exportable.XDebuggerSettings.presentable.name=Debugger
exportable.DebuggerSettings.presentable.name=Debugger: Java
exportable.WebBrowsersConfiguration.presentable.name=Web Browsers
exportable.TextDiffSettings.presentable.name=Text Diff
exportable.PathMacrosImpl.presentable.name=Path Macros
@@ -339,4 +342,6 @@ exportable.ExternalDiffSettings.presentable.name=External Diff
exportable.ExportableFileTemplateSettings.presentable.name=File templates
exportable.ProjectManager.presentable.name=Default project
exportable.com.intellij.ide.ui.customization.CustomActionsSchema.presentable.name=Menus and toolbars customization
exportable.ActionMacroManager.presentable.name=Macros
exportable.ActionMacroManager.presentable.name=Macros
exportable.ImportFilteringUsageViewSetting.presentable.name=Usage View: Imports
exportable.XPathView.XPathViewPlugin.presentable.name=XPath Viewer
@@ -132,8 +132,7 @@
<applicationService serviceInterface="com.intellij.ui.mac.MacMessagesEmulation"
serviceImplementation="com.intellij.ui.messages.JBMacMessages"/>
<applicationService serviceInterface="com.intellij.psi.codeStyle.AppCodeStyleSettingsManager"
serviceImplementation="com.intellij.psi.codeStyle.AppCodeStyleSettingsManager"/>
<applicationService serviceImplementation="com.intellij.psi.codeStyle.AppCodeStyleSettingsManager"/>
<applicationService serviceInterface="com.intellij.psi.impl.source.resolve.reference.impl.providers.FileInfoManager"
serviceImplementation="com.intellij.psi.impl.source.resolve.reference.impl.providers.FileInfoManager"/>
@@ -15,7 +15,10 @@
*/
package com.intellij.usages;
import com.intellij.openapi.components.*;
import com.intellij.openapi.components.PersistentStateComponent;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.components.State;
import com.intellij.openapi.components.Storage;
import com.intellij.util.xmlb.XmlSerializerUtil;
import com.intellij.util.xmlb.annotations.Transient;
import org.jetbrains.annotations.NonNls;
@@ -25,8 +28,8 @@ import java.io.File;
@State(
name = "UsageViewSettings",
storages = {
@Storage(file = StoragePathMacros.APP_CONFIG + "/usageView.xml"),
@Storage(file = StoragePathMacros.APP_CONFIG + "/other.xml", deprecated = true)
@Storage(file = "usageView.xml"),
@Storage(file = "other.xml", deprecated = true)
}
)
public class UsageViewSettings implements PersistentStateComponent<UsageViewSettings> {
@@ -15,7 +15,10 @@
*/
package com.intellij.usages.impl;
import com.intellij.openapi.components.*;
import com.intellij.openapi.components.PersistentStateComponent;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.components.State;
import com.intellij.openapi.components.Storage;
import com.intellij.util.xmlb.XmlSerializerUtil;
/**
@@ -24,9 +27,9 @@ import com.intellij.util.xmlb.XmlSerializerUtil;
@State(
name = "ImportFilteringUsageViewSetting",
storages = {
@Storage(
file = StoragePathMacros.APP_CONFIG + "/other.xml"
)}
@Storage(file = "usageView.xml"),
@Storage(file = "other.xml", deprecated = true)
}
)
public class ImportFilteringUsageViewSetting implements PersistentStateComponent<ImportFilteringUsageViewSetting> {
public static ImportFilteringUsageViewSetting getInstance() {
@@ -674,7 +674,6 @@ ide.mac.yosemite.laf.description=Replaces Aqua LaF to enhanced IntelliJ LaF
dart.server.vm.options=
dart.server.additional.arguments=
dart.server.driven.resolution=true
dart.projects.without.pubspec=false
editor.breadcrumbs.highlight.on.hover=false
@@ -26,7 +26,7 @@ import com.intellij.openapi.vcs.history.VcsHistoryProvider;
import com.intellij.openapi.vcs.history.VcsHistoryProviderBackgroundableProxy;
import com.intellij.openapi.vcs.history.VcsHistorySession;
import com.intellij.openapi.vcs.history.impl.CachedRevisionsContents;
import com.intellij.openapi.vcs.history.impl.VcsHistoryDialog;
import com.intellij.openapi.vcs.history.impl.VcsSelectionHistoryDialog;
import com.intellij.openapi.vcs.impl.BackgroundableActionEnabledHandler;
import com.intellij.openapi.vcs.impl.ProjectLevelVcsManagerImpl;
import com.intellij.openapi.vcs.impl.VcsBackgroundableActions;
@@ -89,16 +89,16 @@ public class SelectedBlockHistoryAction extends AbstractVcsAction {
reportError(preloadException[0]);
}
if (session == null) return;
final VcsHistoryDialog vcsHistoryDialog =
new VcsHistoryDialog(project,
context.getSelectedFiles()[0],
context.getEditor(),
provider,
session,
activeVcs,
Math.min(selectionStart, selectionEnd),
Math.max(selectionStart, selectionEnd),
selection.getDialogTitle(), cachedRevisionsContents);
final VcsSelectionHistoryDialog vcsHistoryDialog =
new VcsSelectionHistoryDialog(project,
context.getSelectedFiles()[0],
context.getEditor(),
provider,
session,
activeVcs,
Math.min(selectionStart, selectionEnd),
Math.max(selectionStart, selectionEnd),
selection.getDialogTitle(), cachedRevisionsContents);
vcsHistoryDialog.show();
}
@@ -62,7 +62,7 @@ import java.util.List;
import static com.intellij.util.ObjectUtils.notNull;
public class VcsHistoryDialog extends FrameWrapper implements DataProvider {
public class VcsSelectionHistoryDialog extends FrameWrapper implements DataProvider {
private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.vcs.history.impl.VcsHistoryDialog");
private static final VcsRevisionNumber LOCAL_REVISION_NUMBER = new VcsRevisionNumber() {
@@ -143,16 +143,16 @@ public class VcsHistoryDialog extends FrameWrapper implements DataProvider {
private boolean myIsDuringUpdate = false;
private boolean myIsDisposed = false;
public VcsHistoryDialog(@NotNull Project project,
@NotNull VirtualFile file,
@NotNull Editor editor,
@NotNull VcsHistoryProvider vcsHistoryProvider,
@NotNull VcsHistorySession session,
@NotNull AbstractVcs vcs,
int selectionStart,
int selectionEnd,
@NotNull String title,
@NotNull CachedRevisionsContents cachedContents) {
public VcsSelectionHistoryDialog(@NotNull Project project,
@NotNull VirtualFile file,
@NotNull Editor editor,
@NotNull VcsHistoryProvider vcsHistoryProvider,
@NotNull VcsHistorySession session,
@NotNull AbstractVcs vcs,
int selectionStart,
int selectionEnd,
@NotNull String title,
@NotNull CachedRevisionsContents cachedContents) {
super(project);
myProject = project;
myFile = file;
@@ -230,8 +230,8 @@ public class VcsHistoryDialog extends FrameWrapper implements DataProvider {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
if (!VcsHistoryDialog.this.getFrame().isShowing()) return;
PopupUtil.showBalloonForComponent(VcsHistoryDialog.this.getFrame(), canNoLoadMessage(e), MessageType.ERROR, true, myProject);
if (!VcsSelectionHistoryDialog.this.getFrame().isShowing()) return;
PopupUtil.showBalloonForComponent(VcsSelectionHistoryDialog.this.getFrame(), canNoLoadMessage(e), MessageType.ERROR, true, myProject);
}
});
}
@@ -15,7 +15,10 @@
*/
package com.intellij.xdebugger.impl.settings;
import com.intellij.openapi.components.*;
import com.intellij.openapi.components.ComponentSerializationUtil;
import com.intellij.openapi.components.PersistentStateComponent;
import com.intellij.openapi.components.State;
import com.intellij.openapi.components.Storage;
import com.intellij.openapi.util.JDOMUtil;
import com.intellij.util.SmartList;
import com.intellij.util.xmlb.SkipDefaultValuesSerializationFilters;
@@ -38,8 +41,8 @@ import java.util.*;
@State(
name = "XDebuggerSettings",
storages = {
@Storage(file = StoragePathMacros.APP_CONFIG + "/debugger.xml"),
@Storage(file = StoragePathMacros.APP_CONFIG + "/other.xml", deprecated = true)
@Storage(file = "debugger.xml"),
@Storage(file = "other.xml", deprecated = true)
}
)
public class XDebuggerSettingManagerImpl extends XDebuggerSettingsManager implements PersistentStateComponent<XDebuggerSettingManagerImpl.SettingsState> {
@@ -19,7 +19,10 @@ import com.intellij.ide.passwordSafe.PasswordSafe;
import com.intellij.ide.passwordSafe.PasswordSafeException;
import com.intellij.ide.passwordSafe.config.PasswordSafeSettings;
import com.intellij.ide.passwordSafe.impl.PasswordSafeImpl;
import com.intellij.openapi.components.*;
import com.intellij.openapi.components.PersistentStateComponent;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.components.State;
import com.intellij.openapi.components.Storage;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.ThreeState;
@@ -35,8 +38,8 @@ import static org.jetbrains.plugins.github.util.GithubAuthData.AuthType;
@SuppressWarnings("MethodMayBeStatic")
@State(
name = "GithubSettings",
storages = {@Storage(
file = StoragePathMacros.APP_CONFIG + "/github_settings.xml")})
storages = {@Storage(file = "github_settings.xml")}
)
public class GithubSettings implements PersistentStateComponent<GithubSettings.State> {
private static final Logger LOG = GithubUtil.LOG;
private static final String GITHUB_SETTINGS_PASSWORD_KEY = "GITHUB_SETTINGS_PASSWORD_KEY";
@@ -52,3 +52,5 @@ gradle.integrations.maven.notification.not_updated_repository.text=\
The following repositories used in your gradle projects were not indexed yet: <br>{0}<br><br> \
If you want to use dependency completion for these repositories artifacts,<br> \
<b><a href=\"#open\">Open Repositories List</a></b>, select required repositories and press \"Update\" button
exportable.GradleSystemRunningSettings.presentable.name=Gradle: System Running
+2
View File
@@ -42,6 +42,8 @@
<depends>JUnit</depends>
<depends optional="true" config-file="gradle-maven-integration.xml">org.jetbrains.idea.maven</depends>
<resource-bundle>i18n.GradleBundle</resource-bundle>
<extensionPoints>
<extensionPoint name="projectResolve" interface="org.jetbrains.plugins.gradle.service.project.GradleProjectResolverExtension"/>
<extensionPoint name="taskManager" interface="org.jetbrains.plugins.gradle.service.task.GradleTaskManagerExtension"/>
@@ -16,7 +16,10 @@
package org.jetbrains.plugins.gradle.settings;
import com.google.common.base.Objects;
import com.intellij.openapi.components.*;
import com.intellij.openapi.components.PersistentStateComponent;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.components.State;
import com.intellij.openapi.components.Storage;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -27,7 +30,7 @@ import org.jetbrains.annotations.Nullable;
@State(
name = "GradleSystemRunningSettings",
storages = {
@Storage(file = StoragePathMacros.APP_CONFIG + "/gradle.run.settings.xml")
@Storage(file = "gradle.run.settings.xml")
}
)
public class GradleSystemRunningSettings implements PersistentStateComponent<GradleSystemRunningSettings.MyState> {
@@ -51,7 +51,6 @@ public class HgProjectConfigurable implements SearchableConfigurable {
}
public void apply() throws ConfigurationException {
myPanel.validate();
myPanel.saveSettings();
if (myPanel.getProjectSettings().isCheckIncomingOutgoing()) {
myProject.getMessageBus().syncPublisher(HgVcs.INCOMING_OUTGOING_CHECK_TOPIC).show();
@@ -15,7 +15,6 @@ package org.zmlx.hg4idea.ui;
import com.intellij.dvcs.branch.DvcsSyncSettings;
import com.intellij.dvcs.ui.DvcsBundle;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
@@ -25,7 +24,6 @@ import org.zmlx.hg4idea.HgProjectSettings;
import org.zmlx.hg4idea.HgVcs;
import org.zmlx.hg4idea.HgVcsMessages;
import org.zmlx.hg4idea.repo.HgRepositoryManager;
import org.zmlx.hg4idea.util.HgUtil;
import org.zmlx.hg4idea.util.HgVersion;
import javax.swing.*;
@@ -105,16 +103,6 @@ public class HgConfigurationProjectPanel {
return myMainPanel;
}
public void validate() throws ConfigurationException {
String hgExecutable;
hgExecutable = getCurrentPath();
if (!HgUtil.isExecutableValid(hgExecutable)) {
throw new ConfigurationException(
HgVcsMessages.message("hg4idea.configuration.executable.error", hgExecutable)
);
}
}
private void createUIComponents() {
myPathSelector = new HgSetExecutablePathPanel(myProjectSettings);
}
@@ -15,19 +15,20 @@
*/
package com.intellij.lang.properties.refactoring;
import com.intellij.openapi.components.*;
import com.intellij.openapi.components.PersistentStateComponent;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.components.State;
import com.intellij.openapi.components.Storage;
import com.intellij.util.xmlb.XmlSerializerUtil;
@State(
name = "PropertiesRefactoringSettings",
storages = {
@Storage(
file = StoragePathMacros.APP_CONFIG + "/other.xml"
)}
@Storage(file = "baseRefactoring.xml"),
@Storage(file = "other.xml", deprecated = true)
}
)
public class PropertiesRefactoringSettings implements PersistentStateComponent<PropertiesRefactoringSettings> {
public boolean RENAME_SEARCH_IN_COMMENTS = false;
public static PropertiesRefactoringSettings getInstance() {
@@ -21,7 +21,10 @@ import com.intellij.codeInsight.hint.HintUtil;
import com.intellij.codeInsight.template.impl.DefaultLiveTemplatesProvider;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.components.*;
import com.intellij.openapi.components.ApplicationComponent;
import com.intellij.openapi.components.PersistentStateComponent;
import com.intellij.openapi.components.State;
import com.intellij.openapi.components.Storage;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.ScrollType;
import com.intellij.openapi.editor.markup.RangeHighlighter;
@@ -49,9 +52,9 @@ import java.util.List;
@State(
name = "XPathView.XPathViewPlugin",
storages = {
@Storage(
file = StoragePathMacros.APP_CONFIG + "/other.xml"
)}
@Storage(file = "xpath.xml"),
@Storage(file = "other.xml", deprecated = true)
}
)
public class XPathAppComponent implements ApplicationComponent, PersistentStateComponent<Config>, DefaultLiveTemplatesProvider {
private static final String ACTION_FIND_NEXT = "FindNext";
+1 -2
View File
@@ -69,8 +69,7 @@
<hectorComponentProvider implementation="com.intellij.codeInsight.daemon.impl.ImportPopupHectorComponentProvider"/>
<usageFilteringRuleProvider implementation="com.intellij.usages.impl.ImportUsageFilteringRuleProvider"/>
<applicationService serviceInterface="com.intellij.usages.impl.ImportFilteringUsageViewSetting"
serviceImplementation="com.intellij.usages.impl.ImportFilteringUsageViewSetting"/>
<applicationService serviceImplementation="com.intellij.usages.impl.ImportFilteringUsageViewSetting"/>
<bundledColorScheme path="/colorSchemes/monokai"/>
<bundledColorScheme path="/colorSchemes/twilight"/>
+1 -2
View File
@@ -343,8 +343,7 @@
<usageFilteringRuleProvider implementation="com.intellij.usages.impl.ImportUsageFilteringRuleProvider"/>
<applicationService serviceInterface="com.intellij.usages.impl.ImportFilteringUsageViewSetting"
serviceImplementation="com.intellij.usages.impl.ImportFilteringUsageViewSetting"/>
<applicationService serviceImplementation="com.intellij.usages.impl.ImportFilteringUsageViewSetting"/>
<!-- this depends on TemplateLanguageConfigurable which isn't registered in LangExtensions, so it should go here as well -->
<errorQuickFixProvider implementation="com.intellij.psi.templateLanguages.TemplateLanguageErrorQuickFixProvider"/>