Skip to content

Commit dc5cbc5

Browse files
committed
Merge pull request #872 from SlavaRa/feature/refactor_2
Remove unused local variables
2 parents e3cec95 + c91f734 commit dc5cbc5

File tree

40 files changed

+13
-95
lines changed

40 files changed

+13
-95
lines changed

External/Plugins/AS2Context/Context.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,6 @@ public override ClassModel CurrentClass
284284
{
285285
if (cFile.FileName.Length > 0)
286286
{
287-
string prevClassName = cClass.Name;
288287
UpdateCurrentFile(true);
289288
}
290289
// update "this" and "super" special vars

External/Plugins/AS3Context/MxmlComplete.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,6 @@ private static List<ICompletionListItem> GetTagAttributeValues(ClassModel tagCla
392392
string setterType = null;
393393
while (tmpClass != null && !tmpClass.IsVoid())
394394
{
395-
string className = tmpClass.Name;
396-
397395
foreach (MemberModel member in tmpClass.Members)
398396
if ((member.Flags & FlagType.Dynamic) > 0 && (member.Flags & mask) > 0
399397
&& (member.Access & acc) > 0)
@@ -612,7 +610,6 @@ private static List<ICompletionListItem> GetAutoCompletionValuesFromType(string
612610
tmpClass.ResolveExtends();
613611

614612
List<ICompletionListItem> result = null;
615-
var validTypes = new Dictionary<string, bool>();
616613
while (tmpClass != null && !tmpClass.IsVoid())
617614
{
618615
foreach (MemberModel member in tmpClass.Members)
@@ -833,7 +830,6 @@ private static ASResult ResolveAttribute(ClassModel model, string word)
833830
ClassModel curClass = mxmlContext.model.GetPublicClass();
834831
ClassModel tmpClass = model;
835832
Visibility acc = context.TypesAffinity(curClass, tmpClass);
836-
List<string> excludes = new List<string>();
837833
tmpClass.ResolveExtends();
838834

839835
while (tmpClass != null && !tmpClass.IsVoid())
@@ -879,7 +875,6 @@ public int Compare(ICompletionListItem a, ICompletionListItem b)
879875
string b1;
880876
if (a.Label.Equals(b.Label, StringComparison.OrdinalIgnoreCase))
881877
{
882-
int c = String.Compare("a", "b");
883878
if (a is HtmlAttributeItem && b is HtmlTagItem) return 1;
884879
else if (b is HtmlAttributeItem && a is HtmlTagItem) return -1;
885880
}

External/Plugins/ASClassWizard/Wizards/ClassBrowser.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ private void ClassBrowser_Load(object sender, EventArgs e)
104104
/// </summary>
105105
private void filterBox_TextChanged(Object sender, EventArgs e)
106106
{
107-
string text = this.filterBox.Text;
108107
this.itemList.BeginUpdate();
109108
this.itemList.Items.Clear();
110109

External/Plugins/ASCompletion/Completion/ASComplete.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,6 @@ private static void AutoCloseBrace(ScintillaControl Sci, int line)
11031103

11041104
// find where to include the closing brace
11051105
int startIndent = indent;
1106-
int newIndent = indent + Sci.TabWidth;
11071106
int count = Sci.LineCount;
11081107
int lastLine = line;
11091108
int position;
@@ -1219,10 +1218,6 @@ static private bool HandleDeclarationCompletion(ScintillaControl Sci, string tai
12191218
List<string> support = features.GetDeclarationKeywords(Sci.GetLine(line), insideClass);
12201219
if (support.Count == 0) return true;
12211220

1222-
// current model
1223-
FileModel cFile = ASContext.Context.CurrentModel;
1224-
ClassModel cClass = ASContext.Context.CurrentClass;
1225-
12261221
// does it need indentation?
12271222
int tab = 0;
12281223
int tempLine = line-1;
@@ -2216,7 +2211,6 @@ static private bool HandleColonCompletion(ScintillaControl Sci, string tail, boo
22162211

22172212
// list visible classes
22182213
MemberList known = new MemberList();
2219-
ClassModel cClass = ASContext.Context.CurrentClass;
22202214
known.Merge(ASContext.Context.GetVisibleExternalElements());
22212215

22222216
// show
@@ -3912,7 +3906,6 @@ static private string MemberTooltipText(MemberModel member, ClassModel inClass)
39123906
string foundIn = "";
39133907
if (inClass != ClassModel.VoidClass)
39143908
{
3915-
string package = inClass.InFile.Package;
39163909
foundIn = "\n[COLOR=#666666:MULTIPLY]in " + MemberModel.FormatType(inClass.QualifiedName) + "[/COLOR]";
39173910
}
39183911
if ((ft & (FlagType.Getter | FlagType.Setter)) > 0)

External/Plugins/ASCompletion/Completion/ASGenerator.cs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,7 +1476,7 @@ private static void ChangeMethodDecl(ScintillaControl Sci, MemberModel member, C
14761476
AddLookupPosition();
14771477
lookupPosition = -1;
14781478

1479-
DockContent dc = ASContext.MainForm.OpenEditableDocument(funcResult.InClass.InFile.FileName, true);
1479+
ASContext.MainForm.OpenEditableDocument(funcResult.InClass.InFile.FileName, true);
14801480
Sci = ASContext.CurSciControl;
14811481

14821482
FileModel fileModel = new FileModel();
@@ -1522,7 +1522,7 @@ private static void ChangeConstructorDecl(ScintillaControl Sci, MemberModel memb
15221522
AddLookupPosition();
15231523
lookupPosition = -1;
15241524

1525-
DockContent dc = ASContext.MainForm.OpenEditableDocument(funcResult.Type.InFile.FileName, true);
1525+
ASContext.MainForm.OpenEditableDocument(funcResult.Type.InFile.FileName, true);
15261526
Sci = ASContext.CurSciControl;
15271527

15281528
FileModel fileModel = new FileModel(funcResult.Type.InFile.FileName);
@@ -1715,7 +1715,7 @@ private static void AddInterfaceDefJob(ClassModel inClass, ScintillaControl Sci,
17151715
template = TemplateUtils.GetTemplate("ISetter");
17161716
}
17171717

1718-
DockContent dc = ASContext.MainForm.OpenEditableDocument(aType.InFile.FileName, true);
1718+
ASContext.MainForm.OpenEditableDocument(aType.InFile.FileName, true);
17191719
Sci = ASContext.CurSciControl;
17201720

17211721
MemberModel latest = GetLatestMemberForFunction(aType, Visibility.Default, new MemberModel());
@@ -1955,7 +1955,6 @@ private static void GenerateToString(ClassModel inClass, ScintillaControl Sci, M
19551955
StringBuilder membersString = new StringBuilder();
19561956
StringBuilder oneMembersString;
19571957
int len = 0;
1958-
int indent = Sci.GetLineIndentation(Sci.CurrentLine);
19591958
foreach (MemberModel m in members)
19601959
{
19611960
if (((m.Flags & FlagType.Variable) > 0 || (m.Flags & FlagType.Getter) > 0)
@@ -2508,7 +2507,7 @@ private static void GenerateFunctionJob(GeneratorJobType job, ScintillaControl S
25082507
AddLookupPosition();
25092508
lookupPosition = -1;
25102509

2511-
DockContent dc = ASContext.MainForm.OpenEditableDocument(funcResult.RelClass.InFile.FileName, true);
2510+
ASContext.MainForm.OpenEditableDocument(funcResult.RelClass.InFile.FileName, true);
25122511
Sci = ASContext.CurSciControl;
25132512
isOtherClass = true;
25142513

@@ -2660,8 +2659,6 @@ private static void GenerateClass(ScintillaControl Sci, String className, ClassM
26602659
public static void GenerateExtractVariable(ScintillaControl Sci, string NewName)
26612660
{
26622661
FileModel cFile;
2663-
IASContext context = ASContext.Context;
2664-
Int32 pos = Sci.CurrentPos;
26652662

26662663
string expression = Sci.SelText.Trim(new char[] { '=', ' ', '\t', '\n', '\r', ';', '.' });
26672664
expression = expression.TrimEnd(new char[] { '(', '[', '{', '<' });
@@ -2766,8 +2763,6 @@ public static void GenerateExtractMethod(ScintillaControl Sci, string NewName)
27662763
Sci.SelectionEnd);
27672764
Sci.CurrentPos = Sci.SelectionEnd;
27682765

2769-
Int32 pos = Sci.CurrentPos;
2770-
27712766
int lineStart = Sci.LineFromPosition(Sci.SelectionStart);
27722767
int lineEnd = Sci.LineFromPosition(Sci.SelectionEnd);
27732768
int firstLineIndent = Sci.GetLineIndentation(lineStart);
@@ -2793,8 +2788,6 @@ public static void GenerateExtractMethod(ScintillaControl Sci, string NewName)
27932788
ASFileParser parser = new ASFileParser();
27942789
parser.ParseSrc(cFile, Sci.Text);
27952790

2796-
bool isAs3 = cFile.Context.Settings.LanguageId == "AS3";
2797-
27982791
FoundDeclaration found = GetDeclarationAtLine(Sci, lineStart);
27992792
if (found == null || found.member == null)
28002793
{
@@ -4244,14 +4237,12 @@ private static string GetSuperCall(MemberModel member, List<string> typesUsed, C
42444237
/// Generates all the missing imports in the given types list
42454238
/// </summary>
42464239
/// <param name="typesUsed">Types to import if needed</param>
4247-
/// <param name="fromFile">Resolve types to import from this other file</param>
42484240
/// <param name="atLine">Current line in editor</param>
42494241
/// <returns>Inserted characters count</returns>
42504242
private static int AddImportsByName(List<string> typesUsed, int atLine)
42514243
{
42524244
int length = 0;
42534245
IASContext context = ASContext.Context;
4254-
FileModel inFile = context.CurrentModel;
42554246
List<string> addedTypes = new List<string>();
42564247
string cleanType = null;
42574248
foreach (string type in typesUsed)

External/Plugins/ASCompletion/Context/ASContext.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,6 @@ static public IASContext GetLanguageContext(string lang)
344344
/// <param name="classpath">Additional classpath</param>
345345
static public void SetLanguageClassPath(ContextSetupInfos setup)
346346
{
347-
string lang = setup.Lang.ToLower();
348347
foreach (RegisteredContext reg in allContexts)
349348
{
350349
if (reg.Language == setup.Lang) reg.Context.Setup(setup);

External/Plugins/ASCompletion/Model/ClassModel.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,6 @@ static public string ClassDeclaration(ClassModel ofClass, bool qualified)
439439
else
440440
{
441441
// modifiers
442-
FlagType ft = ofClass.Flags;
443442
Visibility acc = ofClass.Access;
444443
string modifiers = "";
445444
if ((ofClass.Flags & FlagType.Intrinsic) > 0)

External/Plugins/AirProperties/Managers/AndroidManifestManager.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ public string GetManifestXml()
159159
{
160160
SetUsesSdk();
161161

162-
string xml = backDoc.OuterXml;
163162
var builder = new StringBuilder();
164163
var settings = new XmlWriterSettings()
165164
{

External/Plugins/AirProperties/PluginMain.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ private void AddToolBarItems(ToolStrip toolStrip)
206206
public void UpdateMenuItems()
207207
{
208208
Boolean pluginActive = false;
209-
ToolStrip mainToolStrip = (ToolStrip)PluginBase.MainForm.ToolStrip;
210209
if (this.pluginMenuItem == null || this.pmMenuButton == null) return;
211210
if (PluginBase.CurrentProject != null)
212211
{

External/Plugins/BasicCompletion/PluginMain.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,6 @@ public List<ICompletionListItem> GetCompletionListItems(String lang, String file
420420
/// </summary>
421421
private void SciControlCharAdded(ScintillaControl sci, Int32 value)
422422
{
423-
ITabbedDocument doc = DocumentManager.FindDocument(sci);
424423
if (this.isSupported && !settingObject.DisableAutoCompletion)
425424
{
426425
String lang = sci.ConfigurationLanguage;
@@ -452,7 +451,6 @@ private void SciControlCharAdded(ScintillaControl sci, Int32 value)
452451
/// </summary>
453452
private void SciControlTextChanged(ScintillaControl sci, Int32 position, Int32 length, Int32 linesAdded)
454453
{
455-
ITabbedDocument doc = DocumentManager.FindDocument(sci);
456454
if (this.isSupported)
457455
{
458456
this.updateTimer.Stop();

0 commit comments

Comments
 (0)