@@ -91,8 +91,8 @@ sealed partial class VsProjectAnalyzer : IDisposable {
91
91
92
92
private readonly TaskProvider _defaultTaskProvider = CreateDefaultTaskProvider ( ) ;
93
93
94
- internal static readonly string [ ] _emptyCompletionContextKeywords = new string [ ] {
95
- "var" , "function" , "const" , "let"
94
+ internal static readonly string [ ] _emptyCompletionContextKeywords = new string [ ] {
95
+ "var" , "function" , "const" , "let"
96
96
} ;
97
97
#if FALSE
98
98
private readonly UnresolvedImportSquiggleProvider _unresolvedSquiggles ;
@@ -157,10 +157,10 @@ private void CreateNewAnalyzer(AnalysisLimits limits) {
157
157
_analysisQueue = new AnalysisQueue ( this ) ;
158
158
}
159
159
_fullyLoaded = true ;
160
- }
161
-
162
- private bool ShouldEnqueue ( ) {
163
- return _analysisLevel != AnalysisLevel . None && _analysisLevel != AnalysisLevel . Preview ;
160
+ }
161
+
162
+ private bool ShouldEnqueue ( ) {
163
+ return _analysisLevel != AnalysisLevel . None && _analysisLevel != AnalysisLevel . Preview ;
164
164
}
165
165
166
166
#region Public API
@@ -260,7 +260,7 @@ public void RemoveBuffer(ITextBuffer buffer) {
260
260
}
261
261
262
262
BufferParser bufferParser ;
263
- if ( ! buffer . Properties . TryGetProperty < BufferParser > ( typeof ( BufferParser ) , out bufferParser ) ) {
263
+ if ( ! buffer . Properties . TryGetProperty < BufferParser > ( typeof ( BufferParser ) , out bufferParser ) ) {
264
264
return ;
265
265
}
266
266
@@ -325,8 +325,8 @@ private void AnalyzeFile(string path, bool reportErrors, ProjectItem originating
325
325
} else {
326
326
if ( ! reportErrors ) {
327
327
TaskProvider . Clear ( item . Entry , ParserTaskMoniker ) ;
328
- }
329
-
328
+ }
329
+
330
330
if ( ( _reparseDateTime != null && new FileInfo ( path ) . LastWriteTime > _reparseDateTime . Value )
331
331
|| ( reportErrors && ! item . ReportErrors ) ||
332
332
( item . Entry . Module == null || item . Entry . Unit == null ) ) {
@@ -381,21 +381,21 @@ public void AddPackageJson(string packageJsonPath) {
381
381
AddPackageJson ( packageJsonPath , ( string ) mainFile , dependencyList ) ;
382
382
}
383
383
}
384
- }
385
-
386
- private static List < string > GetDependencyListFromJson ( Dictionary < string , object > json , params string [ ] dependencyTypes ) {
387
- var allDependencies = new List < string > ( ) ;
388
- foreach ( var type in dependencyTypes ) {
389
- object dependencies ;
390
- json . TryGetValue ( type , out dependencies ) ;
391
- var dep = dependencies as Dictionary < string , object > ;
392
- if ( dep != null ) {
393
- allDependencies . AddRange ( dep . Keys . ToList ( ) ) ;
394
- }
395
- }
396
- return allDependencies ;
397
- }
398
-
384
+ }
385
+
386
+ private static List < string > GetDependencyListFromJson ( Dictionary < string , object > json , params string [ ] dependencyTypes ) {
387
+ var allDependencies = new List < string > ( ) ;
388
+ foreach ( var type in dependencyTypes ) {
389
+ object dependencies ;
390
+ json . TryGetValue ( type , out dependencies ) ;
391
+ var dep = dependencies as Dictionary < string , object > ;
392
+ if ( dep != null ) {
393
+ allDependencies . AddRange ( dep . Keys . ToList ( ) ) ;
394
+ }
395
+ }
396
+ return allDependencies ;
397
+ }
398
+
399
399
public void AddPackageJson ( string path , string mainFile , List < string > dependencies ) {
400
400
if ( ! _fullyLoaded ) {
401
401
lock ( _loadingDeltas ) {
@@ -1194,22 +1194,23 @@ private static CompletionAnalysis TrySpecialCompletions(ITextSnapshot snapshot,
1194
1194
if ( range != null ) {
1195
1195
start = range . Value . Start ;
1196
1196
}
1197
- }
1198
-
1199
- // Get the classifiers from beginning of the line to the beginning of snapSpan.
1200
- // The contents of snapSpan differ depending on what is determined in
1201
- // CompletionSource.GetApplicableSpan.
1202
- //
1203
- // In the case of:
1204
- // var myIdentifier<cursor>
1205
- // the applicable span will be "myIdentifier", so GetClassificationSpans will operate on "var "
1206
- //
1207
- // In the case of comments and string literals, the applicable span will be empty,
1197
+ }
1198
+
1199
+ // Get the classifiers from beginning of the line to the beginning of snapSpan.
1200
+ // The contents of snapSpan differ depending on what is determined in
1201
+ // CompletionSource.GetApplicableSpan.
1202
+ //
1203
+ // In the case of:
1204
+ // var myIdentifier<cursor>
1205
+ // the applicable span will be "myIdentifier", so GetClassificationSpans will operate on "var "
1206
+ //
1207
+ // In the case of comments and string literals, the applicable span will be empty,
1208
1208
// so snapSpan.Start will occur at the current cursor position.
1209
1209
var tokens = classifier . GetClassificationSpans ( new SnapshotSpan ( start . GetContainingLine ( ) . Start , snapSpan . Start ) ) ;
1210
1210
if ( tokens . Count > 0 ) {
1211
1211
// Check for context-sensitive intellisense
1212
1212
var lastClass = tokens [ tokens . Count - 1 ] ;
1213
+
1213
1214
if ( lastClass . ClassificationType == classifier . Provider . Comment ||
1214
1215
lastClass . ClassificationType == classifier . Provider . StringLiteral ||
1215
1216
( lastClass . ClassificationType == classifier . Provider . Keyword &&
@@ -1221,8 +1222,8 @@ private static CompletionAnalysis TrySpecialCompletions(ITextSnapshot snapshot,
1221
1222
}
1222
1223
1223
1224
return null ;
1224
- }
1225
-
1225
+ }
1226
+
1226
1227
private static CompletionAnalysis GetNormalCompletionContext ( ITextSnapshot snapshot , ITrackingSpan applicableSpan , ITrackingPoint point ) {
1227
1228
var span = applicableSpan . GetSpan ( snapshot ) ;
1228
1229
@@ -1290,8 +1291,8 @@ private void OnErrorRemoved(string path) {
1290
1291
1291
1292
private void ClearParserTasks ( IProjectEntry entry ) {
1292
1293
if ( entry != null ) {
1293
- TaskProvider . Clear ( entry , ParserTaskMoniker ) ;
1294
-
1294
+ TaskProvider . Clear ( entry , ParserTaskMoniker ) ;
1295
+
1295
1296
bool changed ;
1296
1297
lock ( _hasParseErrors ) {
1297
1298
changed = _hasParseErrors . Remove ( entry ) ;
0 commit comments