IDEA-127918 Unnecessary quotes are added to variable value copied to clipboard in debugger

This commit is contained in:
Egor.Ushakov
2014-08-08 18:54:30 +04:00
parent 433e77bfd8
commit 56b3a62049
3 changed files with 39 additions and 2 deletions
@@ -41,6 +41,7 @@ import com.intellij.xdebugger.frame.*;
import com.intellij.xdebugger.frame.presentation.XRegularValuePresentation;
import com.intellij.xdebugger.frame.presentation.XStringValuePresentation;
import com.intellij.xdebugger.frame.presentation.XValuePresentation;
import com.intellij.xdebugger.impl.ui.XValueTextProvider;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -50,7 +51,7 @@ import java.util.List;
/**
* @author egor
*/
public class JavaValue extends XNamedValue implements NodeDescriptorProvider {
public class JavaValue extends XNamedValue implements NodeDescriptorProvider, XValueTextProvider {
private static final Logger LOG = Logger.getInstance(JavaValue.class);
private final JavaValue myParent;
@@ -377,4 +378,9 @@ public class JavaValue extends XNamedValue implements NodeDescriptorProvider {
}
return evaluationExpression;
}
@Override
public String getValueText() {
return myValueDescriptor.getValueText();
}
}
@@ -0,0 +1,23 @@
/*
* Copyright 2000-2014 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.xdebugger.impl.ui;
/**
* @author egor
*/
public interface XValueTextProvider {
String getValueText();
}
@@ -22,6 +22,7 @@ import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.SmartList;
import com.intellij.xdebugger.frame.XFullValueEvaluator;
import com.intellij.xdebugger.impl.ui.XValueTextProvider;
import com.intellij.xdebugger.impl.ui.tree.XDebuggerTree;
import com.intellij.xdebugger.impl.ui.tree.nodes.HeadlessValueEvaluationCallback;
import com.intellij.xdebugger.impl.ui.tree.nodes.WatchMessageNode;
@@ -74,7 +75,14 @@ public abstract class XFetchValueActionBase extends AnAction {
XValueNodeImpl valueNode = (XValueNodeImpl)node;
XFullValueEvaluator fullValueEvaluator = valueNode.getFullValueEvaluator();
if (fullValueEvaluator == null) {
valueCollector.add(StringUtil.notNullize(valueNode.getRawValue()));
String rawValue;
if (valueNode.getValueContainer() instanceof XValueTextProvider) {
rawValue = ((XValueTextProvider)valueNode.getValueContainer()).getValueText();
}
else {
rawValue = valueNode.getRawValue();
}
valueCollector.add(StringUtil.notNullize(rawValue));
}
else {
new CopyValueEvaluationCallback(valueNode, valueCollector).startFetchingValue(fullValueEvaluator);