Skip to content

Commit b611d64

Browse files
committed
Removed solution parsing for Client and Genio information.
Validations to text view window before executing operations. New fields in Change history tool window.
1 parent 9a60d3d commit b611d64

File tree

13 files changed

+103
-29
lines changed

13 files changed

+103
-29
lines changed

LastActiveProfile.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
<?xml version="1.0" encoding="utf-16"?>
2-
<string />
2+
<string>GIPDEV</string>

ManualCode/CodeFlowPackage.vsct

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,13 +260,13 @@
260260
<ButtonText>Change to VS2008 Plataform Toolset</ButtonText>
261261
</Strings>
262262
</Button>
263-
<Button guid="CodeFlowCommandSet" id="cmdidRefreshSolution" priority="0x0100" type="Button">
263+
<!--<Button guid="CodeFlowCommandSet" id="cmdidRefreshSolution" priority="0x0100" type="Button">
264264
<Parent guid="CodeFlowCommandSet" id="CodeFlowToolbarGroup" />
265265
<Icon guid="refreshSolutionImage" id="bmpPic1" />
266266
<Strings>
267267
<ButtonText>Refresh solution</ButtonText>
268268
</Strings>
269-
</Button>
269+
</Button>-->
270270
<Button guid="CodeFlowCommandSet" id="cmdidViewVersionsCommand" priority="0x0100" type="Button">
271271
<Parent guid="CodeFlowCommandSet" id="CodeFlowToolbarGroup" />
272272
<Icon guid="codeFlowVersionHistoryImage" id="bmpPic1" />

ManualCode/CommandHandler/CommandHandler.cs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,17 @@ public string GetCurrentViewText(out int cursorPos, out IWpfTextView textView)
2121
var componentModel = (IComponentModel)ServiceProvider.GlobalProvider.GetService(typeof(SComponentModel));
2222
var editor = componentModel.GetService<IVsEditorAdaptersFactoryService>();
2323
textManager.GetActiveView(1, null, out IVsTextView textViewCurrent);
24-
textView = editor.GetWpfTextView(textViewCurrent);
24+
cursorPos = -1;
25+
textView = null;
26+
if (textViewCurrent != null)
27+
{
28+
textView = editor.GetWpfTextView(textViewCurrent);
2529

26-
SnapshotPoint caretPosition = textView.Caret.Position.BufferPosition;
27-
cursorPos = caretPosition.Position;
28-
return textView.TextBuffer.CurrentSnapshot.GetText();
30+
SnapshotPoint caretPosition = textView.Caret.Position.BufferPosition;
31+
cursorPos = caretPosition.Position;
32+
return textView.TextBuffer.CurrentSnapshot.GetText();
33+
}
34+
return "";
2935
}
3036
public string GetCurrentSelection()
3137
{
@@ -64,6 +70,9 @@ public List<IManual> SearchForTags()
6470
public bool ImportAndEditCurrentTag()
6571
{
6672
string code = GetCurrentViewText(out int pos, out IWpfTextView textView);
73+
if (pos == -1 || textView == null)
74+
return false;
75+
6776
VSCodeManualMatcher vSCodeManualMatcher = new VSCodeManualMatcher(code, pos, PackageOperations.Instance.DTE.ActiveDocument.FullName);
6877
List<IManual> codeList = vSCodeManualMatcher.Match();
6978
if (codeList.Count == 1)

ManualCode/Forms/CommitForm.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,21 @@ private void btnMerge_Click(object sender, EventArgs e)
231231
if (diff is CodeNotFound)
232232
return;
233233

234-
IChange change = diff.Merge();
234+
IChange change = null;
235+
try
236+
{
237+
change = diff.Merge();
238+
}
239+
catch (Exception ex)
240+
{
241+
MessageBox.Show(String.Format(Properties.Resources.UnableToExecuteOperation, ex.Message),
242+
Properties.Resources.Export, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
243+
return;
244+
}
235245
if (change.HasDifference())
236246
{
237247
lstCode.SelectedItems[0].Text = change.GetDescription();
238-
lstCode.SelectedItems[0].SubItems[2].Text = change.Merged.ShortOneLineCode();
248+
lstCode.SelectedItems[0].SubItems[3].Text = change.Merged.ShortOneLineCode();
239249
lstCode.SelectedItems[0].ForeColor = lblMerged.ForeColor;
240250
lstCode.SelectedItems[0].ImageIndex = GetImageIndex(change);
241251
lstCode.SelectedItems[0].Tag = change;

ManualCode/Forms/ConflictForm.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,18 @@ private void btnMerge_Click(object sender, EventArgs e)
9999
ListViewItem item = lstConflicts.Items[lstConflicts.SelectedIndices[0]];
100100
IChange diff = (IChange)item.Tag;
101101

102-
IChange change = diff.Merge();
102+
103+
IChange change = null;
104+
try
105+
{
106+
change = diff.Merge();
107+
}
108+
catch (Exception ex)
109+
{
110+
MessageBox.Show(String.Format(Properties.Resources.UnableToExecuteOperation, ex.Message),
111+
Properties.Resources.Export, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
112+
return;
113+
}
103114
lstConflicts.SelectedItems[0].ImageIndex = GetImageIndex(change);
104115
lstConflicts.SelectedItems[0].Tag = change;
105116
lstConflicts.SelectedItems[0].Text = change.GetDescription();

ManualCode/GenioManual/Manual.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ private static IManual MergeCompare(IManual database, IManual local, bool saveRe
196196
}
197197
catch(Exception e)
198198
{
199-
throw e;
199+
throw new Exception(string.Format(Properties.Resources.ErrorMerge, e.Message));
200200
}
201201
}
202202
public static List<IManual> SearchDatabase(Profile profile, string texto, bool caseSensitive = false, bool wholeWord = false, string plataform = "")
@@ -240,7 +240,7 @@ public void ShowSVNLog(Profile profile)
240240
}
241241
catch (Exception e)
242242
{
243-
throw e;
243+
throw new Exception(string.Format(Properties.Resources.ErrorSVN, e.Message));
244244
}
245245
}
246246
public void Blame(Profile profile)
@@ -254,7 +254,7 @@ public void Blame(Profile profile)
254254
}
255255
catch (Exception e)
256256
{
257-
throw e;
257+
throw new Exception(string.Format(Properties.Resources.ErrorSVN, e.Message));
258258
}
259259
}
260260
protected string FormatComment(string extension, string str)

ManualCode/OptionsPageGrid.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ public class OptionsPageGrid : DialogPage
2323
private bool _fixIndexes;
2424
private int _maxTaskSolutionCommit;
2525

26-
[Category("Solution")]
27-
[DefaultValue(true)]
28-
[DisplayName("Solution parsing")]
29-
[Description("Parses solution for client, version and system. This allows more lightbulb suggestions.")]
30-
public bool ParseSolutionOnStartup
31-
{
32-
get => _parseSolutionOnStartup; set
33-
{
34-
_parseSolutionOnStartup = value;
35-
PackageOperations.Instance.ParseSolution = value;
36-
}
37-
}
26+
//[Category("Solution")]
27+
//[DefaultValue(true)]
28+
//[DisplayName("Solution parsing")]
29+
//[Description("Parses solution for client, version and system. This allows more lightbulb suggestions.")]
30+
//public bool ParseSolutionOnStartup
31+
//{
32+
// get => _parseSolutionOnStartup; set
33+
// {
34+
// _parseSolutionOnStartup = value;
35+
// PackageOperations.Instance.ParseSolution = value;
36+
// }
37+
//}
3838

3939
[Category("Solution")]
4040
[DefaultValue(false)]

ManualCode/Properties/Resources.Designer.cs

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ManualCode/Properties/Resources.resx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,4 +377,14 @@ Verify your profile</value>
377377
<data name="folder_Open_16xLG" type="System.Resources.ResXFileRef, System.Windows.Forms">
378378
<value>..\Resources\folder_Open_16xLG.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
379379
</data>
380+
<data name="ErrorMerge" xml:space="preserve">
381+
<value>An error occurred when trying to merge code.
382+
Please very that TortoiseMerge is installed or that another merge tool is specified in the extension options.
383+
{0}</value>
384+
</data>
385+
<data name="ErrorSVN" xml:space="preserve">
386+
<value>An error occurred when trying to merge code.
387+
Please very that TortoiseSVN is installed or that another merge tool is specified in the extension options.
388+
{0}</value>
389+
</data>
380390
</root>

ManualCode/SolutionOperations/GenioProjectProperties.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public GenioProjectProperties(Project genioProject, List<GenioProjectItem> proje
4646
public static ProjectLanguage GetProjectLanguage(Project proj)
4747
{
4848
ProjectLanguage lang;
49-
CodeModel model = proj.CodeModel;
49+
CodeModel model = proj?.CodeModel;
5050
if (model == null)
5151
return ProjectLanguage.Unknown;
5252
switch (model.Language)

0 commit comments

Comments
 (0)