Browse Source

Disable code-completion inside string literals.

Fixed control size in HistoryViewDisplayBinding/InfoPanel.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2735 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 18 years ago
parent
commit
65820b499e
  1. 112
      src/AddIns/Misc/SubversionAddIn/Project/Resources/InfoPanel.xfrm
  2. 9
      src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/HistoryViewPanel.cs
  3. 192
      src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/InfoPanel.Designer.cs
  4. 54
      src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/InfoPanel.cs
  5. 120
      src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/InfoPanel.resx
  6. 11
      src/AddIns/Misc/SubversionAddIn/Project/SubversionAddIn.csproj
  7. 12
      src/Main/Base/Test/CSharpExpressionFinderTests.cs
  8. 13
      src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/CSharp/ExpressionFinder.cs

112
src/AddIns/Misc/SubversionAddIn/Project/Resources/InfoPanel.xfrm

@ -1,112 +0,0 @@ @@ -1,112 +0,0 @@
<Components version="1.0">
<System.Windows.Forms.UserControl>
<Name value="XmlUserControl1" />
<ClientSize value="{Width=608, Height=472}" />
<Controls>
<System.Windows.Forms.Panel>
<Name value="panel1" />
<Location value="{X=0,Y=0}" />
<Size value="{Width=608, Height=196}" />
<TabIndex value="0" />
<Dock value="Fill" />
<Controls>
<System.Windows.Forms.Label>
<Name value="label2" />
<Location value="{X=8,Y=0}" />
<Text value="&amp;Revision history:" />
<TextAlign value="BottomLeft" />
<Size value="{Width=592, Height=16}" />
<TabIndex value="1" />
<Anchor value="Top, Left, Right" />
</System.Windows.Forms.Label>
<System.Windows.Forms.ListView>
<Name value="revisionListView" />
<Size value="{Width=592, Height=171}" />
<TabIndex value="2" />
<FullRowSelect value="True" />
<GridLines value="True" />
<MultiSelect value="False" />
<View value="Details" />
<HideSelection value="False" />
<Location value="{X=8,Y=19}" />
<Anchor value="Top, Bottom, Left, Right" />
<Columns>
<System.Windows.Forms.ColumnHeader>
<Name value="columnHeader1" />
<Text value="Revision" />
</System.Windows.Forms.ColumnHeader>
<System.Windows.Forms.ColumnHeader>
<Name value="columnHeader2" />
<Width value="100" />
<Text value="Author" />
</System.Windows.Forms.ColumnHeader>
<System.Windows.Forms.ColumnHeader>
<Width value="120" />
<Text value="Date" />
<Name value="columnHeader3" />
</System.Windows.Forms.ColumnHeader>
<System.Windows.Forms.ColumnHeader>
<Width value="400" />
<Text value="Comment" />
<Name value="columnHeader4" />
</System.Windows.Forms.ColumnHeader>
</Columns>
</System.Windows.Forms.ListView>
</Controls>
</System.Windows.Forms.Panel>
<System.Windows.Forms.Splitter>
<Name value="splitter1" />
<Location value="{X=0,Y=196}" />
<Size value="{Width=608, Height=3}" />
<TabIndex value="4" />
<Dock value="Bottom" />
</System.Windows.Forms.Splitter>
<System.Windows.Forms.Panel>
<Name value="panel2" />
<Location value="{X=8,Y=205}" />
<Size value="{Width=499, Height=240}" />
<Dock value="Bottom" />
<TabIndex value="3" />
<Controls>
<System.Windows.Forms.ListView>
<Name value="changesListView" />
<Size value="{Width=483, Height=115}" />
<TabIndex value="6" />
<View value="Details" />
<Location value="{X=8,Y=114}" />
<Anchor value="Top, Bottom, Left, Right" />
<FullRowSelect value="true" />
<Columns>
<System.Windows.Forms.ColumnHeader>
<Width value="65" />
<Text value="Action" />
<Name value="actionColumnHeader" />
</System.Windows.Forms.ColumnHeader>
<System.Windows.Forms.ColumnHeader>
<Name value="pathColumnHeader" />
<Width value="70" />
<Text value="Path" />
</System.Windows.Forms.ColumnHeader>
<System.Windows.Forms.ColumnHeader>
<Name value="copyFromColumnHeader" />
<Width value="70" />
<Text value="Copy from" />
</System.Windows.Forms.ColumnHeader>
</Columns>
</System.Windows.Forms.ListView>
<System.Windows.Forms.RichTextBox>
<Name value="commentRichTextBox" />
<TabIndex value="5" />
<BackColor value="Color [Window]" />
<WordWrap value="False" />
<Text value="" />
<Anchor value="Top, Left, Right" />
<Location value="{X=8,Y=6}" />
<Size value="{Width=483, Height=102}" />
<ReadOnly value="True" />
</System.Windows.Forms.RichTextBox>
</Controls>
</System.Windows.Forms.Panel>
</Controls>
</System.Windows.Forms.UserControl>
</Components>

9
src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/HistoryViewPanel.cs

@ -45,20 +45,23 @@ namespace ICSharpCode.Svn @@ -45,20 +45,23 @@ namespace ICSharpCode.Svn
mainTab.Dock = DockStyle.Fill;
mainTab.Alignment = TabAlignment.Bottom;
Controls.Add(mainTab);
TabPage infoTabPage = new TabPage("Info");
infoPanel = new InfoPanel(viewContent);
infoPanel.Dock = DockStyle.Fill;
infoTabPage.Controls.Add(infoPanel);
mainTab.TabPages.Add(infoTabPage);
infoPanel.Dock = DockStyle.Fill;
TabPage diffTabPage = new TabPage("Diff");
diffPanel = new DiffPanel(viewContent);
diffPanel.Dock = DockStyle.Fill;
diffTabPage.Controls.Add(diffPanel);
mainTab.TabPages.Add(diffTabPage);
diffPanel.Dock = DockStyle.Fill;
/*
TabPage conflictTabPage = new TabPage("Conflicts");
Label todoLabel = new Label();
@ -67,8 +70,6 @@ namespace ICSharpCode.Svn @@ -67,8 +70,6 @@ namespace ICSharpCode.Svn
mainTab.TabPages.Add(conflictTabPage);
*/
Controls.Add(mainTab);
Thread logMessageThread = new Thread(new ThreadStart(GetLogMessages));
logMessageThread.Name = "svnLogMessage";
logMessageThread.IsBackground = true;

192
src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/InfoPanel.Designer.cs generated

@ -0,0 +1,192 @@ @@ -0,0 +1,192 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <author name="Daniel Grunwald"/>
// <version>$Revision$</version>
// </file>
namespace ICSharpCode.Svn
{
partial class InfoPanel
{
/// <summary>
/// Designer variable used to keep track of non-visual components.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Disposes resources used by the control.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing) {
if (components != null) {
components.Dispose();
}
}
base.Dispose(disposing);
}
/// <summary>
/// This method is required for Windows Forms designer support.
/// Do not change the method contents inside the source code editor. The Forms designer might
/// not be able to load this method if it was changed manually.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.revisionListView = new System.Windows.Forms.ListView();
this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
this.columnHeader3 = new System.Windows.Forms.ColumnHeader();
this.columnHeader4 = new System.Windows.Forms.ColumnHeader();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.changesListView = new System.Windows.Forms.ListView();
this.columnHeader5 = new System.Windows.Forms.ColumnHeader();
this.columnHeader6 = new System.Windows.Forms.ColumnHeader();
this.columnHeader7 = new System.Windows.Forms.ColumnHeader();
this.commentRichTextBox = new System.Windows.Forms.RichTextBox();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.SuspendLayout();
//
// label1
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label1.Location = new System.Drawing.Point(3, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(709, 23);
this.label1.TabIndex = 0;
this.label1.Text = "&Revision history:";
//
// revisionListView
//
this.revisionListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.revisionListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader1,
this.columnHeader2,
this.columnHeader3,
this.columnHeader4});
this.revisionListView.FullRowSelect = true;
this.revisionListView.GridLines = true;
this.revisionListView.HideSelection = false;
this.revisionListView.Location = new System.Drawing.Point(3, 26);
this.revisionListView.MultiSelect = false;
this.revisionListView.Name = "revisionListView";
this.revisionListView.Size = new System.Drawing.Size(709, 238);
this.revisionListView.TabIndex = 1;
this.revisionListView.UseCompatibleStateImageBehavior = false;
this.revisionListView.View = System.Windows.Forms.View.Details;
//
// columnHeader1
//
this.columnHeader1.Text = "Revision";
//
// columnHeader2
//
this.columnHeader2.Text = "Author";
this.columnHeader2.Width = 100;
//
// columnHeader3
//
this.columnHeader3.Text = "Date";
this.columnHeader3.Width = 120;
//
// columnHeader4
//
this.columnHeader4.Text = "Comment";
this.columnHeader4.Width = 400;
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Name = "splitContainer1";
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.label1);
this.splitContainer1.Panel1.Controls.Add(this.revisionListView);
this.splitContainer1.Panel1MinSize = 75;
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.changesListView);
this.splitContainer1.Panel2.Controls.Add(this.commentRichTextBox);
this.splitContainer1.Panel2MinSize = 150;
this.splitContainer1.Size = new System.Drawing.Size(715, 542);
this.splitContainer1.SplitterDistance = 267;
this.splitContainer1.TabIndex = 2;
//
// changesListView
//
this.changesListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.changesListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader5,
this.columnHeader6,
this.columnHeader7});
this.changesListView.FullRowSelect = true;
this.changesListView.Location = new System.Drawing.Point(3, 112);
this.changesListView.Name = "changesListView";
this.changesListView.Size = new System.Drawing.Size(709, 156);
this.changesListView.TabIndex = 1;
this.changesListView.UseCompatibleStateImageBehavior = false;
this.changesListView.View = System.Windows.Forms.View.Details;
//
// columnHeader5
//
this.columnHeader5.Text = "Action";
//
// columnHeader6
//
this.columnHeader6.Text = "Path";
//
// columnHeader7
//
this.columnHeader7.Text = "Copy from";
//
// commentRichTextBox
//
this.commentRichTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.commentRichTextBox.BackColor = System.Drawing.SystemColors.Window;
this.commentRichTextBox.Location = new System.Drawing.Point(3, 3);
this.commentRichTextBox.Name = "commentRichTextBox";
this.commentRichTextBox.ReadOnly = true;
this.commentRichTextBox.Size = new System.Drawing.Size(709, 103);
this.commentRichTextBox.TabIndex = 0;
this.commentRichTextBox.Text = "";
//
// InfoPanel
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.splitContainer1);
this.Name = "InfoPanel";
this.Size = new System.Drawing.Size(715, 542);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.ResumeLayout(false);
this.ResumeLayout(false);
}
private System.Windows.Forms.ColumnHeader columnHeader7;
private System.Windows.Forms.ColumnHeader columnHeader6;
private System.Windows.Forms.ColumnHeader columnHeader5;
private System.Windows.Forms.ListView changesListView;
private System.Windows.Forms.RichTextBox commentRichTextBox;
private System.Windows.Forms.ColumnHeader columnHeader4;
private System.Windows.Forms.ColumnHeader columnHeader3;
private System.Windows.Forms.ColumnHeader columnHeader2;
private System.Windows.Forms.ColumnHeader columnHeader1;
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.ListView revisionListView;
private System.Windows.Forms.Label label1;
}
}

54
src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/InfoPanel.cs

@ -1,19 +1,19 @@ @@ -1,19 +1,19 @@
// <file>
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <author name="Daniel Grunwald"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Threading;
using System.Windows.Forms;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.Gui.XmlForms;
using NSvn.Core;
namespace ICSharpCode.Svn
@ -21,25 +21,19 @@ namespace ICSharpCode.Svn @@ -21,25 +21,19 @@ namespace ICSharpCode.Svn
/// <summary>
/// Description of InfoPanel.
/// </summary>
public class InfoPanel : BaseSharpDevelopUserControl
public partial class InfoPanel : UserControl
{
IViewContent viewContent;
ListView revisionList, changesList;
public InfoPanel(IViewContent viewContent)
{
this.viewContent = viewContent;
SetupFromXmlStream(GetType().Assembly.GetManifestResourceStream("ICSharpCode.Svn.Resources.InfoPanel.xfrm"));
InitializeComponent();
revisionList = Get<ListView>("revision");
changesList = Get<ListView>("changes");
revisionList.SelectedIndexChanged += RevisionListViewSelectionChanged;
ControlDictionary["commentRichTextBox"].Enabled = false;
ControlDictionary["commentRichTextBox"].Font = ResourceService.DefaultMonospacedFont;
// Work around WinForms/XmlForms bug:
ControlDictionary["splitter1"].Height = 3;
revisionListView.SelectedIndexChanged += RevisionListViewSelectionChanged;
commentRichTextBox.Font = ResourceService.DefaultMonospacedFont;
commentRichTextBox.Enabled = false;
}
public void ShowError(Exception ex)
@ -58,7 +52,7 @@ namespace ICSharpCode.Svn @@ -58,7 +52,7 @@ namespace ICSharpCode.Svn
txt.Text += ex.ToString();
}
txt.Dock = DockStyle.Fill;
revisionList.Controls.Add(txt);
revisionListView.Controls.Add(txt);
}
int lastRevision = -1;
@ -74,24 +68,24 @@ namespace ICSharpCode.Svn @@ -74,24 +68,24 @@ namespace ICSharpCode.Svn
logMessage.Message
});
newItem.Tag = logMessage;
revisionList.Items.Add(newItem);
revisionListView.Items.Add(newItem);
}
void RevisionListViewSelectionChanged(object sender, EventArgs e)
{
changesList.Items.Clear();
if (revisionList.SelectedItems.Count == 0) {
ControlDictionary["commentRichTextBox"].Text = "";
ControlDictionary["commentRichTextBox"].Enabled = false;
changesListView.Items.Clear();
if (revisionListView.SelectedItems.Count == 0) {
commentRichTextBox.Text = "";
commentRichTextBox.Enabled = false;
return;
}
ControlDictionary["commentRichTextBox"].Enabled = true;
ListViewItem item = revisionList.SelectedItems[0];
commentRichTextBox.Enabled = true;
ListViewItem item = revisionListView.SelectedItems[0];
LogMessage logMessage = item.Tag as LogMessage;
ControlDictionary["commentRichTextBox"].Text = logMessage.Message;
commentRichTextBox.Text = logMessage.Message;
ChangedPathDictionary changes = logMessage.ChangedPaths;
if (changes == null) {
changesList.Items.Add("Loading...");
changesListView.Items.Add("Loading...");
if (!isLoadingChangedPaths) {
isLoadingChangedPaths = true;
loadChangedPathsItem = item;
@ -104,7 +98,7 @@ namespace ICSharpCode.Svn @@ -104,7 +98,7 @@ namespace ICSharpCode.Svn
foreach (DictionaryEntry entry in changes) {
string path = (string)entry.Key;
path = path.Replace('\\', '/');
SizeF size = g.MeasureString(path, changesList.Font);
SizeF size = g.MeasureString(path, changesListView.Font);
if (size.Width + 4 > pathWidth)
pathWidth = (int)size.Width + 4;
ChangedPath change = (ChangedPath)entry.Value;
@ -113,7 +107,7 @@ namespace ICSharpCode.Svn @@ -113,7 +107,7 @@ namespace ICSharpCode.Svn
copyFrom = string.Empty;
} else {
copyFrom = copyFrom + " : r" + change.CopyFromRevision;
size = g.MeasureString(copyFrom, changesList.Font);
size = g.MeasureString(copyFrom, changesListView.Font);
if (size.Width + 4 > copyFromWidth)
copyFromWidth = (int)size.Width + 4;
}
@ -122,11 +116,11 @@ namespace ICSharpCode.Svn @@ -122,11 +116,11 @@ namespace ICSharpCode.Svn
path,
copyFrom
});
changesList.Items.Add(newItem);
changesListView.Items.Add(newItem);
}
}
changesList.Columns[1].Width = pathWidth;
changesList.Columns[2].Width = copyFromWidth;
changesListView.Columns[1].Width = pathWidth;
changesListView.Columns[2].Width = copyFromWidth;
}
}
@ -182,7 +176,7 @@ namespace ICSharpCode.Svn @@ -182,7 +176,7 @@ namespace ICSharpCode.Svn
void ReceiveAllChangedPathsInvoked(LogMessage logMessage)
{
foreach (ListViewItem item in revisionList.Items) {
foreach (ListViewItem item in revisionListView.Items) {
LogMessage oldMessage = (LogMessage)item.Tag;
if (oldMessage.Revision == logMessage.Revision) {
item.Tag = logMessage;

120
src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/InfoPanel.resx

@ -0,0 +1,120 @@ @@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

11
src/AddIns/Misc/SubversionAddIn/Project/SubversionAddIn.csproj

@ -46,6 +46,10 @@ @@ -46,6 +46,10 @@
<None Include="ICSharpCode.Svn.addin">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<Compile Include="Src\Gui\HistoryViewDisplayBinding\InfoPanel.cs" />
<Compile Include="Src\Gui\HistoryViewDisplayBinding\InfoPanel.Designer.cs">
<DependentUpon>InfoPanel.cs</DependentUpon>
</Compile>
<Compile Include="Src\SvnClient.cs" />
<Compile Include="Src\InOperationDialog.cs">
<SubType>Form</SubType>
@ -54,7 +58,6 @@ @@ -54,7 +58,6 @@
<Compile Include="Configuration\AssemblyInfo.cs" />
<EmbeddedResource Include="Resources\ClientCertDialog.xfrm" />
<EmbeddedResource Include="Resources\ClientCertPassphraseDialog.xfrm" />
<EmbeddedResource Include="Resources\InfoPanel.xfrm" />
<EmbeddedResource Include="Resources\LoginDialog.xfrm" />
<EmbeddedResource Include="Resources\SslServerTrustDialog.xfrm" />
<EmbeddedResource Include="Resources\SubversionOptionsPanel.xfrm" />
@ -77,9 +80,6 @@ @@ -77,9 +80,6 @@
<Compile Include="Src\Gui\HistoryViewDisplayBinding\HistoryViewPanel.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Src\Gui\HistoryViewDisplayBinding\InfoPanel.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Src\Gui\ProjectBrowserVisitor\SvnProjectBrowserVisitor.cs" />
<Compile Include="Src\Gui\SubversionOptionsPanel.cs">
<SubType>UserControl</SubType>
@ -100,6 +100,9 @@ @@ -100,6 +100,9 @@
<EmbeddedResource Include="Src\Gui\HistoryViewDisplayBinding\DiffPanel.resx">
<DependentUpon>DiffPanel.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Src\Gui\HistoryViewDisplayBinding\InfoPanel.resx">
<DependentUpon>InfoPanel.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj">

12
src/Main/Base/Test/CSharpExpressionFinderTests.cs

@ -822,6 +822,18 @@ class Main { @@ -822,6 +822,18 @@ class Main {
Assert.AreEqual("\"hello, world!\"", result.Expression);
Assert.AreEqual(ExpressionContext.Default, result.Context);
}
[Test]
public void InsideStringLiteral()
{
const string program = @"using System;
class Main {
string a = ""hello, ";
ExpressionResult result = ef.FindExpression(program, program.Length);
Assert.IsNull(result.Expression);
Assert.AreEqual(ExpressionContext.Default, result.Context);
}
}
}

13
src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/CSharp/ExpressionFinder.cs

@ -308,6 +308,10 @@ namespace ICSharpCode.SharpDevelop.Dom.CSharp @@ -308,6 +308,10 @@ namespace ICSharpCode.SharpDevelop.Dom.CSharp
{
Init(text, offset);
Token token;
Location lastError = Location.Empty;
lexer.Errors.Error = delegate (int errorLine, int errorCol, string errorMsg) {
lastError = new Location(errorCol, errorLine);
};
while ((token = lexer.NextToken()) != null) {
if (token.kind == Tokens.EOF) break;
@ -315,7 +319,14 @@ namespace ICSharpCode.SharpDevelop.Dom.CSharp @@ -315,7 +319,14 @@ namespace ICSharpCode.SharpDevelop.Dom.CSharp
break;
}
ApplyToken(token);
if (targetPosition < token.EndLocation) {
if (targetPosition <= token.EndLocation) {
if (token.kind == Tokens.Literal) {
// do not return string literal as expression if offset was inside the literal,
// or if it was at the end of the literal when the literal was not terminated correctly.
if (targetPosition < token.EndLocation || lastError == token.Location) {
frame.lastExpressionStart = Location.Empty;
}
}
break;
}
lastToken = token.kind;

Loading…
Cancel
Save