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:
@@ -35,6 +35,8 @@
|
||||
|
||||
1.5 => plugins/Groovy/lib/groovy_rt.jar
|
||||
1.5 => lib/annotations.jar
|
||||
1.8 => lib/annotations-java8.jar
|
||||
1.8 => redist/annotations-java8.jar
|
||||
|
||||
1.6 => plugins/gradle/lib/gradle-jps-plugin.jar
|
||||
|
||||
|
||||
+1
-1
@@ -96,7 +96,7 @@ public abstract class PsiAwareLineWrapPositionStrategy implements LineWrapPositi
|
||||
TextRange textRange = element.getTextRange();
|
||||
int start = Math.max(textRange.getStartOffset(), startOffset);
|
||||
int end = Math.min(textRange.getEndOffset(), endOffset);
|
||||
int result = doCalculateWrapPosition(document, project, start, end, end, false, virtual);
|
||||
int result = doCalculateWrapPosition(document, project, start, end, maxPreferredOffset, false, virtual);
|
||||
if (result >= 0) {
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ import com.intellij.openapi.ui.popup.util.PopupUtil;
|
||||
import com.intellij.openapi.util.*;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.CharsetToolkit;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.wm.IdeFocusManager;
|
||||
import com.intellij.openapi.wm.IdeFrame;
|
||||
import com.intellij.util.Base64;
|
||||
@@ -419,33 +420,51 @@ public class HttpConfigurable implements PersistentStateComponent<HttpConfigurab
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isHttpProxyEnabledForUrl(@Nullable String url) {
|
||||
if (!USE_HTTP_PROXY) return false;
|
||||
URI uri = url != null ? VfsUtil.toUri(url) : null;
|
||||
return uri == null || !mySelector.isProxyException(uri.getHost());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public RequestConfig.Builder setProxy(@NotNull RequestConfig.Builder builder) {
|
||||
return setProxy(builder, USE_HTTP_PROXY);
|
||||
if (USE_HTTP_PROXY) {
|
||||
builder.setProxy(new HttpHost(PROXY_HOST, PROXY_PORT));
|
||||
}
|
||||
return builder;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public CredentialsProvider setProxyCredentials(@NotNull CredentialsProvider provider) {
|
||||
return setProxyCredentials(provider, USE_HTTP_PROXY);
|
||||
if (USE_HTTP_PROXY && PROXY_AUTHENTICATION) {
|
||||
String ntlmUserPassword = PROXY_LOGIN.replace('\\', '/') + ":" + getPlainProxyPassword();
|
||||
provider.setCredentials(new AuthScope(PROXY_HOST, PROXY_PORT, AuthScope.ANY_REALM, AuthSchemes.NTLM), new NTCredentials(ntlmUserPassword));
|
||||
provider.setCredentials(new AuthScope(PROXY_HOST, PROXY_PORT), new UsernamePasswordCredentials(PROXY_LOGIN, getPlainProxyPassword()));
|
||||
}
|
||||
return provider;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public RequestConfig.Builder setProxy(@NotNull RequestConfig.Builder builder, boolean useProxy) {
|
||||
if (useProxy) {
|
||||
builder.setProxy(new HttpHost(PROXY_HOST, PROXY_PORT));
|
||||
}
|
||||
|
||||
if (useProxy) setProxy(builder);
|
||||
return builder;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public CredentialsProvider setProxyCredentials(@NotNull CredentialsProvider provider, boolean useProxy) {
|
||||
if (useProxy && PROXY_AUTHENTICATION) {
|
||||
String ntlmUserPassword = PROXY_LOGIN.replace('\\', '/') + ":" + getPlainProxyPassword();
|
||||
provider.setCredentials(new AuthScope(PROXY_HOST, PROXY_PORT, AuthScope.ANY_REALM, AuthSchemes.NTLM), new NTCredentials(ntlmUserPassword));
|
||||
provider.setCredentials(new AuthScope(PROXY_HOST, PROXY_PORT), new UsernamePasswordCredentials(PROXY_LOGIN, getPlainProxyPassword()));
|
||||
}
|
||||
if (useProxy) setProxyCredentials(provider);
|
||||
return provider;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public RequestConfig.Builder setProxyIfEnabled(@NotNull RequestConfig.Builder builder, @Nullable String url) {
|
||||
if (isHttpProxyEnabledForUrl(url)) setProxy(builder);
|
||||
return builder;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public CredentialsProvider setProxyCredentialsIfEnabled(@NotNull CredentialsProvider provider, @Nullable String url) {
|
||||
if (isHttpProxyEnabledForUrl(url)) setProxyCredentials(provider);
|
||||
return provider;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ public abstract class AnnotateRevisionActionBase extends AnAction {
|
||||
if (fileRevision == null) return false;
|
||||
|
||||
VirtualFile file = getFile(e);
|
||||
if (file == null || file.isDirectory() || file.getFileType().isBinary()) return false;
|
||||
if (file == null) return false;
|
||||
|
||||
AbstractVcs vcs = getVcs(e);
|
||||
if (vcs == null) return false;
|
||||
|
||||
@@ -1104,7 +1104,13 @@ public class FileHistoryPanelImpl extends PanelWithActionsAndCloseButton {
|
||||
final Boolean nonLocal = e.getData(VcsDataKeys.VCS_NON_LOCAL_HISTORY_SESSION);
|
||||
if (Boolean.TRUE.equals(nonLocal)) return null;
|
||||
|
||||
return e.getData(VcsDataKeys.VCS_VIRTUAL_FILE);
|
||||
VirtualFile file = e.getData(VcsDataKeys.VCS_VIRTUAL_FILE);
|
||||
if (file == null || file.isDirectory()) return null;
|
||||
|
||||
VirtualFile localVirtualFile = getVirtualFile();
|
||||
if (localVirtualFile.getFileType().isBinary() && myFilePath.getFileType().isBinary()) return null;
|
||||
|
||||
return file;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -160,7 +160,7 @@ public class GithubConnection {
|
||||
.setSocketTimeout(timeout);
|
||||
|
||||
if (auth.isUseProxy()) {
|
||||
HttpConfigurable.getInstance().setProxy(builder);
|
||||
HttpConfigurable.getInstance().setProxyIfEnabled(builder, auth.getHost());
|
||||
}
|
||||
|
||||
return builder.build();
|
||||
@@ -184,7 +184,7 @@ public class GithubConnection {
|
||||
}
|
||||
|
||||
if (auth.isUseProxy()) {
|
||||
HttpConfigurable.getInstance().setProxyCredentials(provider);
|
||||
HttpConfigurable.getInstance().setProxyCredentialsIfEnabled(provider, auth.getHost());
|
||||
}
|
||||
|
||||
return provider;
|
||||
|
||||
+2
-2
@@ -91,7 +91,7 @@ public abstract class NewBaseRepositoryImpl extends BaseRepository {
|
||||
provider.setCredentials(BASIC_AUTH_SCOPE, new UsernamePasswordCredentials(getUsername(), getPassword()));
|
||||
}
|
||||
// Proxy authentication
|
||||
HttpConfigurable.getInstance().setProxyCredentials(provider, isUseProxy());
|
||||
if (isUseProxy()) HttpConfigurable.getInstance().setProxyCredentialsIfEnabled(provider, getUrl());
|
||||
|
||||
return provider;
|
||||
}
|
||||
@@ -102,7 +102,7 @@ public abstract class NewBaseRepositoryImpl extends BaseRepository {
|
||||
RequestConfig.Builder builder = RequestConfig.custom()
|
||||
.setConnectTimeout(3000)
|
||||
.setSocketTimeout(tasksSettings.CONNECTION_TIMEOUT);
|
||||
HttpConfigurable.getInstance().setProxy(builder, isUseProxy());
|
||||
if (isUseProxy()) HttpConfigurable.getInstance().setProxyIfEnabled(builder, getUrl());
|
||||
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import com.intellij.openapi.editor.LineWrapPositionStrategy;
|
||||
import com.intellij.openapi.editor.PsiAwareDefaultLineWrapPositionStrategy;
|
||||
import com.intellij.psi.TokenType;
|
||||
import com.intellij.psi.xml.XmlElementType;
|
||||
import com.intellij.psi.xml.XmlTokenType;
|
||||
|
||||
/**
|
||||
* {@link LineWrapPositionStrategy} for markup languages like XML, HTML etc.
|
||||
@@ -29,6 +30,6 @@ import com.intellij.psi.xml.XmlElementType;
|
||||
public class MarkupLineWrapPositionStrategy extends PsiAwareDefaultLineWrapPositionStrategy {
|
||||
|
||||
public MarkupLineWrapPositionStrategy() {
|
||||
super(true, XmlElementType.XML_TEXT, TokenType.WHITE_SPACE);
|
||||
super(true, XmlElementType.XML_TEXT, XmlTokenType.XML_COMMENT_CHARACTERS, TokenType.WHITE_SPACE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +57,23 @@ public class XmlEditorTest extends LightCodeInsightTestCase {
|
||||
"</svg>");
|
||||
}
|
||||
|
||||
public void testHardWrapInComment() throws Exception {
|
||||
configureFromFileText("a.xml",
|
||||
"<!-- Some very long and informative xml comment to trigger hard wrapping indeed. Too short? Dave, let me ask you something. Are hard wraps working? What do we live for? What ice-cream do you like? Who am I?????????????????????????????????????????????????????????????????????????????????????????????????<caret>-->");
|
||||
|
||||
CodeStyleSettings clone = CodeStyleSettingsManager.getInstance(getProject()).getCurrentSettings().clone();
|
||||
clone.WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN = true;
|
||||
try {
|
||||
CodeStyleSettingsManager.getInstance(getProject()).setTemporarySettings(clone);
|
||||
EditorTestUtil.performTypingAction(getEditor(), '?');
|
||||
}
|
||||
finally {
|
||||
CodeStyleSettingsManager.getInstance(getProject()).dropTemporarySettings();
|
||||
}
|
||||
checkResultByText("<!-- Some very long and informative xml comment to trigger hard wrapping indeed. Too short? Dave, let me ask you \n" +
|
||||
"something. Are hard wraps working? What do we live for? What ice-cream do you like? Who am I??????????????????????????????????????????????????????????????????????????????????????????????????-->");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected String getTestDataPath() {
|
||||
|
||||
Reference in New Issue
Block a user