@@ -17,30 +17,38 @@ namespace SPCode.UI.Components
17
17
{
18
18
enum ACType
19
19
{
20
+ /// <summary>
20
21
/// Top level objects, such as Functions, Variables, Types.
22
+ /// </summary>
21
23
Toplevel ,
22
-
24
+
25
+ /// <summary>
23
26
/// Class Methods and Fields. Also used for MethodMap list.
27
+ /// </summary>
24
28
Class ,
25
29
26
- /// Pre-processor statments.
30
+ /// <summary>
31
+ /// Pre-processor statements.
32
+ /// </summary>
27
33
PreProc ,
28
34
}
29
35
30
- /// @note
31
36
// AC stands for AutoComplete
32
37
// IS stands for IntelliSense and is often replaced with "Doc"/"Documentation"
33
38
//
34
39
// _smDef is the SMDefinition that contains all the symbols of the include directory and open file,
35
40
// currentSmDef contains only the current file symbols.
41
+
36
42
public partial class EditorElement
37
43
{
38
44
private bool _isAcOpen ;
39
45
private List < ACNode > _acEntries ;
40
46
41
- /// We use this just to keep track of the current isNodes for the equality check.
42
- /// Seems like that using this as ItemsSource for the MethodAutoCompleteBox causes it to not update the UI
47
+ /// <summary>
48
+ /// We use this just to keep track of the current isNodes for the equality check. <br></br>
49
+ /// Seems like that using this as ItemsSource for the MethodAutoCompleteBox causes it to not update the UI <br></br>
43
50
/// when ScrollIntoView is called.
51
+ /// </summary>
44
52
private readonly List < ACNode > _methodACEntries = new ( ) ;
45
53
46
54
private bool _isDocOpen ;
@@ -61,12 +69,16 @@ public partial class EditorElement
61
69
62
70
static private readonly SMDefinition . ISNodeEqualityComparer ISEqualityComparer = new ( ) ;
63
71
72
+ /// <summary>
64
73
/// Used to keep track of the current autocomplete type (ie. toplevel, class or preprocessor)
74
+ /// </summary>
65
75
private ACType _acType = ACType . Toplevel ;
66
76
67
77
private SMDefinition _smDef ;
68
78
79
+ /// <summary>
69
80
/// Matches either a function call ("PrintToChat(...)") or a method call ("arrayList.Push(...)")
81
+ /// </summary>
70
82
static private readonly Regex ISFindRegex = new (
71
83
@"\b(((?<class>[a-zA-Z_]([a-zA-Z0-9_]?)+)\.)?(?<method>[a-zA-Z_]([a-zA-Z0-9_]?)+)\()" ,
72
84
RegexOptions . Compiled | RegexOptions . ExplicitCapture ) ;
@@ -77,7 +89,9 @@ public partial class EditorElement
77
89
static private readonly Regex MultilineCommentRegex = new ( @"/\*.*?\*/" ,
78
90
RegexOptions . Compiled | RegexOptions . ExplicitCapture | RegexOptions . Singleline ) ;
79
91
80
- // Pre-processor statements
92
+ /// <summary>
93
+ /// Pre-processor statements
94
+ /// </summary>
81
95
static private readonly string [ ] PreProcArr =
82
96
{
83
97
"assert" , "define" , "else" , "elseif" , "endif" , "endinput" , "endscript" , "error" , "warning" , "if" ,
@@ -92,7 +106,7 @@ static private readonly IEnumerable<ACNode>
92
106
static private readonly Regex PreprocessorRegex = new ( "#\\ w+" , RegexOptions . Compiled ) ;
93
107
94
108
/// <summary>
95
- /// This is called only one time when the program first opens.
109
+ /// This is called only one time when the program first opens.
96
110
/// </summary>
97
111
public void LoadAutoCompletes ( )
98
112
{
@@ -128,7 +142,7 @@ public void LoadAutoCompletes()
128
142
}
129
143
130
144
/// <summary>
131
- /// This is called several times. Mostly when the caret position changes.
145
+ /// This is called several times. Mostly when the caret position changes.
132
146
/// </summary>
133
147
/// <param name="smDef"> The SMDefinition </param>
134
148
private void InterruptLoadAutoCompletes ( SMDefinition smDef )
@@ -395,7 +409,7 @@ bool ComputeAutoComplete(string text, int lineOffset, int quoteCount)
395
409
}
396
410
397
411
398
- if ( text . Length == 0 )
412
+ if ( text . Length == 0 || editor . SelectionLength > 0 )
399
413
return false ;
400
414
401
415
if ( ! IsValidFunctionChar ( text [ lineOffset - 1 ] ) &&
0 commit comments