mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -28,6 +28,9 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @see com.intellij.psi.PsiLanguageInjectionHost
|
||||
*/
|
||||
public interface MultiHostInjector {
|
||||
|
||||
ExtensionPointName<MultiHostInjector> MULTIHOST_INJECTOR_EP_NAME = ExtensionPointName.create("com.intellij.multiHostInjector");
|
||||
|
||||
@@ -60,4 +60,23 @@ public abstract class LiteralTextEscaper<T extends PsiLanguageInjectionHost> {
|
||||
|
||||
public abstract boolean isOneLine();
|
||||
|
||||
public static <T extends PsiLanguageInjectionHost> LiteralTextEscaper<T> createSimple(T element) {
|
||||
return new LiteralTextEscaper<T>(element) {
|
||||
@Override
|
||||
public boolean decode(@NotNull TextRange rangeInsideHost, @NotNull StringBuilder outChars) {
|
||||
outChars.append(rangeInsideHost.substring(myHost.getText()));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffsetInHost(int offsetInDecoded, @NotNull TextRange rangeInsideHost) {
|
||||
return rangeInsideHost.getStartOffset() + offsetInDecoded;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOneLine() {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,6 @@ public abstract class PathReferenceManager {
|
||||
* @param endingSlashNotAllowed true if paths like "/foo/" should not be resolved.
|
||||
* @param relativePathsAllowed true if the folder of the file containing the PsiElement should be used as "root".
|
||||
* Otherwise, web application root will be used.
|
||||
* @param suitableFileTypes
|
||||
*@param additionalProviders additional providers to process. @return created references or an empty array.
|
||||
*/
|
||||
@NotNull
|
||||
|
||||
@@ -72,7 +72,7 @@ public class ProgramRunnerUtil {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!RunManagerImpl.canRunConfiguration(configuration, executor) || (showSettings && RunManagerImpl.isEditBeforeRun(configuration))) {
|
||||
if (!RunManagerImpl.canRunConfiguration(configuration, executor) || (showSettings && configuration.isEditBeforeRun())) {
|
||||
if (!RunDialog.editConfiguration(project, configuration, "Edit configuration", executor)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -761,10 +761,6 @@ public class RunManagerImpl extends RunManagerEx implements JDOMExternalizable,
|
||||
setActiveConfiguration(tempConfiguration);
|
||||
}
|
||||
|
||||
public static boolean isEditBeforeRun(@NotNull final RunnerAndConfigurationSettings configuration) {
|
||||
return configuration.isEditBeforeRun();
|
||||
}
|
||||
|
||||
Collection<RunnerAndConfigurationSettings> getStableConfigurations() {
|
||||
final Map<Integer, RunnerAndConfigurationSettings> result =
|
||||
new LinkedHashMap<Integer, RunnerAndConfigurationSettings>(myConfigurations);
|
||||
|
||||
+1
-1
@@ -359,7 +359,7 @@ public class FileReference implements FileReferenceOwner, PsiPolyVariantReferenc
|
||||
@Override
|
||||
public PsiFileSystemItem resolve() {
|
||||
ResolveResult[] resolveResults = multiResolve(false);
|
||||
return resolveResults.length == 1 ? (PsiFileSystemItem)resolveResults[0].getElement() : null;
|
||||
return resolveResults.length == 1 ? (PsiFileSystemItem)resolveResults[0].getElement() : null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
+4
-1
@@ -242,7 +242,10 @@ public class MultiHostRegistrarImpl implements MultiHostRegistrar, ModificationT
|
||||
finally {
|
||||
viewProvider.setPatchingLeaves(false);
|
||||
}
|
||||
assert parsedNode.getText().equals(documentText) : exceptionContext("After patch: doc:\n'" + documentText + "'\n---PSI:\n'" + parsedNode.getText() + "'\n---chars:\n'"+outChars+"'");
|
||||
if (!parsedNode.getText().equals(documentText)) {
|
||||
throw new AssertionError(exceptionContext(
|
||||
"After patch: doc:\n'" + documentText + "'\n---PSI:\n'" + parsedNode.getText() + "'\n---chars:\n'" + outChars + "'"));
|
||||
}
|
||||
|
||||
virtualFile.setContent(null, documentWindow.getText(), false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user