Skip to content

Commit 3e01e0b

Browse files
committed
Merge branch 'development' of https://github.com/fdorg/flashdevelop into StringComparison_Ordinal
2 parents 8e86e12 + 77a41e2 commit 3e01e0b

File tree

21 files changed

+1062
-393
lines changed

21 files changed

+1062
-393
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ PluginCore/Bin
2323
/FlashDevelop/Bin/Debug/Settings/Recovery
2424
/FlashDevelop/Bin/Debug/Exceptions.log
2525
/FlashDevelop/Bin/Debug/Tools/fdbuild/fdbuild.exe
26+
FlashDevelop/Bin/Debug/Settings/Themes/CURRENT

CONTRIBUTING.md

Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
# AppMan entries
2+
3+
If you want to add your plugin, theme or extension to AppMan, you need to do a pull request to the appman.xml file adding a new entry inside the FD5 comments. Requirements for the offered plugins, themes or extensions are:
4+
5+
* Code needs to be opensource and reviewable in a public repository
6+
* The item needs to be packaged into a FDZ file and provide a MD5 checksum for verification
7+
* The FDZ needs to extract the files to the user app data directory
8+
9+
# Coding style
10+
11+
##### Use spaces instead of tabs with a width of 4
12+
13+
```c#
14+
public bool IsMember()
15+
{
16+
if (this.value > 2)
17+
{
18+
return false;
19+
}
20+
else return true;
21+
}
22+
```
23+
24+
##### Naming should be in English and clear
25+
26+
```c#
27+
private int memberProperty = 0;
28+
```
29+
30+
##### Use camelCase for private members and uppercase for public properties, methods and types:
31+
32+
```c#
33+
private int memberProperty = 0;
34+
35+
public string MemberName = "MemberName";
36+
37+
public bool IsMember()
38+
{
39+
return true;
40+
}
41+
```
42+
43+
##### Use types without explicit path:
44+
45+
```c#
46+
private void OnFormActivate(object sender, /*System.*/EventArgs e)
47+
{
48+
// Do something...
49+
}
50+
```
51+
52+
##### Do not use extensive extra empty lines and keep the code clean, not like:
53+
54+
```c#
55+
// Comment...
56+
private int MemberMethod(int value)
57+
{
58+
59+
60+
61+
// Comment for something...
62+
63+
64+
if (value > 2))
65+
{
66+
67+
//this.oldCode = 0;
68+
69+
70+
// Random notes here
71+
72+
73+
74+
return -1;
75+
}
76+
77+
78+
79+
// Something here too...
80+
else return value;
81+
82+
83+
84+
85+
//Little bit here too...
86+
}
87+
```
88+
89+
##### Use brackets and parenthesis for easier readability:
90+
91+
```c#
92+
if ((val1 > val2) && (val1 > val3))
93+
{
94+
if (val2 > val3)
95+
{
96+
doThing();
97+
}
98+
}
99+
```
100+
101+
##### Do not nest expressions without brackets:
102+
103+
```c#
104+
if (val1 > val2 && val1 > val3)
105+
106+
if (val2 > val3)
107+
108+
doThing();
109+
110+
```
111+
112+
##### Use can use one liners to shorten the code:
113+
114+
```c#
115+
if (val1 > val2 && val1 > val3)
116+
{
117+
if (val2 > val3) doThing();
118+
}
119+
```
120+
121+
##### Use explicit types:
122+
123+
```c#
124+
int myValue = 0;
125+
Point[] myPoints = new Point[]
126+
{
127+
new Point(1, 1),
128+
new Point(2, 2)
129+
}
130+
```
131+
132+
##### Code example:
133+
134+
```c#
135+
import System;
136+
137+
namespace MyNameSpace
138+
{
139+
class MyClass
140+
{
141+
// Comment here...
142+
private int memberProperty = 0;
143+
private int memberProperty2 = 1;
144+
private int memberProperty3 = 2;
145+
146+
// Comment here...
147+
public string MemberName = "MemberName";
148+
149+
// Comment here...
150+
public static bool IsMemberProperty = false;
151+
152+
// Comment here...
153+
public const int CONSTANT = 1;
154+
155+
/// <summary>
156+
/// Comment here...
157+
/// </summary>
158+
public bool IsMember()
159+
{
160+
return true;
161+
}
162+
163+
/// <summary>
164+
/// Comment here...
165+
/// </summary>
166+
public void MemberMethod(int value)
167+
{
168+
int temp = CONSTANT;
169+
if (value > 2)
170+
{
171+
this.memberProperty2 = temp;
172+
this.memberProperty3 = temp;
173+
}
174+
else this.memberProperty3 = value;
175+
}
176+
177+
/// <summary>
178+
/// Comment here...
179+
/// </summary>
180+
private int MemberMethodEx(int value)
181+
{
182+
int temp = CONSTANT;
183+
this.memberProperty3 = temp;
184+
switch (value)
185+
{
186+
case 1: return 1;
187+
case 2:
188+
{
189+
return -1;
190+
}
191+
default: return value;
192+
}
193+
}
194+
195+
/// <summary>
196+
/// Comment here...
197+
/// </summary>
198+
private void OnFormActivate(object sender, EventArgs e)
199+
{
200+
this.MemberMethod(null, null);
201+
}
202+
203+
}
204+
205+
}
206+
```
207+
208+
##### More generally, be consistent and keep the code clean!

External/Plugins/AS3Context/PluginMain.cs

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -265,25 +265,23 @@ public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority priority)
265265
else if (inMXML)
266266
{
267267
DataEvent de = e as DataEvent;
268-
if (de.Action == "XMLCompletion.Element")
268+
switch (de.Action)
269269
{
270-
de.Handled = MxmlComplete.HandleElement(de.Data);
271-
}
272-
if (de.Action == "XMLCompletion.Namespace")
273-
{
274-
de.Handled = MxmlComplete.HandleNamespace(de.Data);
275-
}
276-
else if (de.Action == "XMLCompletion.CloseElement")
277-
{
278-
de.Handled = MxmlComplete.HandleElementClose(de.Data);
279-
}
280-
else if (de.Action == "XMLCompletion.Attribute")
281-
{
282-
de.Handled = MxmlComplete.HandleAttribute(de.Data);
283-
}
284-
else if (de.Action == "XMLCompletion.AttributeValue")
285-
{
286-
de.Handled = MxmlComplete.HandleAttributeValue(de.Data);
270+
case "XMLCompletion.Element":
271+
de.Handled = MxmlComplete.HandleElement(de.Data);
272+
break;
273+
case "XMLCompletion.Namespace":
274+
de.Handled = MxmlComplete.HandleNamespace(de.Data);
275+
break;
276+
case "XMLCompletion.CloseElement":
277+
de.Handled = MxmlComplete.HandleElementClose(de.Data);
278+
break;
279+
case "XMLCompletion.Attribute":
280+
de.Handled = MxmlComplete.HandleAttribute(de.Data);
281+
break;
282+
case "XMLCompletion.AttributeValue":
283+
de.Handled = MxmlComplete.HandleAttributeValue(de.Data);
284+
break;
287285
}
288286
}
289287
}

0 commit comments

Comments
 (0)