Skip to content

Commit 59555ec

Browse files
committed
Merge branch 'development' of https://github.com/fdorg/flashdevelop into development
2 parents bf0d024 + 29b81a4 commit 59555ec

File tree

3 files changed

+45
-18
lines changed

3 files changed

+45
-18
lines changed

External/Plugins/ASCompletion/Completion/ASComplete.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3951,7 +3951,6 @@ static internal void HandleCompletionInsert(ScintillaControl sci, int position,
39513951
// let the context handle the insertion
39523952
if (ASContext.Context.OnCompletionInsert(sci, position, text, trigger))
39533953
return;
3954-
39553954
// event inserted
39563955
if (item is EventItem)
39573956
{
@@ -3962,18 +3961,19 @@ static internal void HandleCompletionInsert(ScintillaControl sci, int position,
39623961
// default handling
39633962
if (ASContext.Context.Settings != null)
39643963
{
3964+
int textEndPosition = position + text.Length;
39653965
// was a fully qualified type inserted?
3966-
ASExpr expr = GetExpression(sci, position + text.Length);
3966+
ASExpr expr = GetExpression(sci, textEndPosition);
39673967
if (expr.Value == null) return;
3968-
3968+
ASResult type = GetExpressionType(sci, textEndPosition);
3969+
if (type.IsPackage) return;
39693970
ContextFeatures features = ASContext.Context.Features;
39703971

39713972
// add ; for imports
39723973
if (" \n\t".IndexOf(trigger) >= 0 && expr.WordBefore != null
39733974
&& (expr.WordBefore == features.importKey || expr.WordBefore == features.importKeyAlt))
39743975
{
3975-
sci.InsertText(sci.CurrentPos, ";");
3976-
sci.SetSel(sci.CurrentPos + 1, sci.CurrentPos + 1);
3976+
if (!sci.GetLine(sci.CurrentLine).Contains(";")) sci.InsertText(sci.CurrentPos, ";");
39773977
return;
39783978
}
39793979

External/Plugins/ProjectManager/Controls/OpenResourceForm.cs

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public class OpenResourceForm : SmartForm
2121
private System.Windows.Forms.Label infoLabel;
2222
private System.Windows.Forms.TextBox textBox;
2323
private System.Windows.Forms.ListBox listBox;
24+
private System.Windows.Forms.CheckBox cbInClasspathsOnly;
2425
private System.Windows.Forms.CheckBox checkBox;
2526
private System.Windows.Forms.Button refreshButton;
2627

@@ -46,6 +47,7 @@ private void InitializeComponent()
4647
this.infoLabel = new System.Windows.Forms.Label();
4748
this.textBox = new System.Windows.Forms.TextBox();
4849
this.listBox = new System.Windows.Forms.ListBox();
50+
this.cbInClasspathsOnly = new System.Windows.Forms.CheckBox();
4951
this.checkBox = new System.Windows.Forms.CheckBox();
5052
this.refreshButton = new System.Windows.Forms.Button();
5153
this.SuspendLayout();
@@ -64,31 +66,41 @@ private void InitializeComponent()
6466
this.textBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right)));
6567
this.textBox.Location = new System.Drawing.Point(12, 32);
6668
this.textBox.Name = "textBox";
67-
this.textBox.Size = new System.Drawing.Size(446, 22);
69+
this.textBox.Size = new System.Drawing.Size(466, 22);
6870
this.textBox.TabIndex = 1;
6971
this.textBox.TextChanged += new System.EventHandler(this.TextBoxTextChanged);
7072
this.textBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TextBoxKeyDown);
7173
//
7274
// refreshButton
7375
//
7476
this.refreshButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
75-
this.refreshButton.Location = new System.Drawing.Point(465, 30);
77+
this.refreshButton.Location = new System.Drawing.Point(485, 30);
7678
this.refreshButton.Name = "refreshButton";
7779
this.refreshButton.Size = new System.Drawing.Size(26, 23);
78-
this.refreshButton.TabIndex = 3;
80+
this.refreshButton.TabIndex = 4;
7981
this.refreshButton.Click += new EventHandler(RefreshButtonClick);
8082
//
83+
// cbInClasspathsOnly
84+
//
85+
this.cbInClasspathsOnly.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
86+
this.cbInClasspathsOnly.Location = new System.Drawing.Point(380, 9);
87+
this.cbInClasspathsOnly.Size = new System.Drawing.Size(26, 24);
88+
this.cbInClasspathsOnly.Text = "In Classpaths only";
89+
this.cbInClasspathsOnly.Name = "cbInClasspathsOnly";
90+
this.cbInClasspathsOnly.AutoSize = true;
91+
this.cbInClasspathsOnly.TabIndex = 2;
92+
this.cbInClasspathsOnly.Checked = false;
93+
this.cbInClasspathsOnly.CheckedChanged += new System.EventHandler(this.CbInClasspathsOnlyCheckedChanged);
94+
//
8195
// checkBox
8296
//
8397
this.checkBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
84-
this.checkBox.Location = new System.Drawing.Point(464, 9);
98+
this.checkBox.Location = new System.Drawing.Point(480, 9);
8599
this.checkBox.Size = new System.Drawing.Size(26, 24);
86-
this.checkBox.CheckAlign = ContentAlignment.MiddleRight;
87-
this.checkBox.TextAlign = ContentAlignment.MiddleLeft;
88100
this.checkBox.Text = "Code files only";
89101
this.checkBox.Name = "checkBox";
90102
this.checkBox.AutoSize = true;
91-
this.checkBox.TabIndex = 2;
103+
this.checkBox.TabIndex = 3;
92104
this.checkBox.Checked = false;
93105
this.checkBox.CheckedChanged += new EventHandler(this.CheckBoxCheckedChanged);
94106
//
@@ -99,8 +111,8 @@ private void InitializeComponent()
99111
this.listBox.FormattingEnabled = true;
100112
this.listBox.Location = new System.Drawing.Point(12, 62);
101113
this.listBox.Name = "listBox";
102-
this.listBox.Size = new System.Drawing.Size(478, 276);
103-
this.listBox.TabIndex = 4;
114+
this.listBox.Size = new System.Drawing.Size(498, 276);
115+
this.listBox.TabIndex = 5;
104116
this.listBox.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.ListBoxDrawItem);
105117
this.listBox.Resize += new System.EventHandler(this.ListBoxResize);
106118
this.listBox.DoubleClick += new System.EventHandler(this.ListBoxDoubleClick);
@@ -109,15 +121,16 @@ private void InitializeComponent()
109121
//
110122
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
111123
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
112-
this.ClientSize = new System.Drawing.Size(502, 340);
124+
this.ClientSize = new System.Drawing.Size(522, 340);
125+
this.Controls.Add(this.cbInClasspathsOnly);
113126
this.Controls.Add(this.listBox);
114127
this.Controls.Add(this.textBox);
115128
this.Controls.Add(this.refreshButton);
116129
this.Controls.Add(this.infoLabel);
117130
this.Controls.Add(this.checkBox);
118131
this.MaximizeBox = false;
119132
this.MinimizeBox = false;
120-
this.MinimumSize = new System.Drawing.Size(400, 300);
133+
this.MinimumSize = new System.Drawing.Size(480, 300);
121134
this.Name = "OpenResourceForm";
122135
this.ShowIcon = false;
123136
this.KeyPreview = true;
@@ -153,6 +166,7 @@ private void InitializeGraphics()
153166
private void InitializeLocalization()
154167
{
155168
this.infoLabel.Text = TextHelper.GetString("Label.SearchString");
169+
this.cbInClasspathsOnly.Text = TextHelper.GetString("Label.InClasspathsOnly");
156170
this.checkBox.Text = TextHelper.GetString("Label.CodeFilesOnly");
157171
this.Text = " " + TextHelper.GetString("Title.OpenResource");
158172
}
@@ -166,6 +180,15 @@ private void RefreshButtonClick(Object sender, EventArgs e)
166180
this.RefreshListBox();
167181
}
168182

183+
/// <summary>
184+
///
185+
/// </summary>
186+
private void CbInClasspathsOnlyCheckedChanged(Object sender, EventArgs e)
187+
{
188+
this.CreateFileList();
189+
this.RefreshListBox();
190+
}
191+
169192
/// <summary>
170193
///
171194
/// </summary>
@@ -377,15 +400,15 @@ public List<String> GetProjectFolders()
377400
{
378401
String projectFolder = Path.GetDirectoryName(PluginBase.CurrentProject.ProjectPath);
379402
List<String> folders = new List<String>();
380-
folders.Add(projectFolder);
403+
if (!cbInClasspathsOnly.Checked) folders.Add(projectFolder);
381404
if (!PluginMain.Settings.SearchExternalClassPath) return folders;
382405
foreach (String path in PluginBase.CurrentProject.SourcePaths)
383406
{
384407
if (Path.IsPathRooted(path)) folders.Add(path);
385408
else
386409
{
387410
String folder = Path.GetFullPath(Path.Combine(projectFolder, path));
388-
if (!folder.StartsWith(projectFolder)) folders.Add(folder);
411+
if (cbInClasspathsOnly.Checked || !folder.StartsWith(projectFolder)) folders.Add(folder);
389412
}
390413
}
391414
return folders;

PluginCore/PluginCore/Resources/en_US.resX

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5187,6 +5187,10 @@ Custom locales must be an extension of a default locale, e.g. en-US.</value>
51875187
<value>You are renaming a file. Do you also want to update the references?</value>
51885188
<comment>Added after 4.4.3</comment>
51895189
</data>
5190+
<data name="ProjectManager.Label.InClasspathsOnly" xml:space="preserve">
5191+
<value>In Classpaths only</value>
5192+
<comment>Added after 5.0.2</comment>
5193+
</data>
51905194
<data name="ProjectManager.Label.CodeFilesOnly" xml:space="preserve">
51915195
<value>Code files only</value>
51925196
<comment>Added after 4.4.3</comment>

0 commit comments

Comments
 (0)