50
50
import ts .eclipse .ide .jsdt .internal .ui .editor .contentassist .TypeScriptCompletionProcessor ;
51
51
import ts .eclipse .ide .jsdt .internal .ui .editor .contentassist .TypeScriptJavadocCompletionProcessor ;
52
52
import ts .eclipse .ide .jsdt .internal .ui .editor .format .TypeScriptContentFormatter ;
53
+ import ts .eclipse .ide .jsdt .internal .ui .text .TypeScriptCodeScanner ;
53
54
import ts .eclipse .ide .jsdt .internal .ui .text .jsx .IJSXPartitions ;
54
55
import ts .eclipse .ide .jsdt .internal .ui .text .jsx .JSXScanner ;
55
56
import ts .eclipse .ide .jsdt .ui .actions .ITypeScriptEditorActionDefinitionIds ;
64
65
*/
65
66
public class TypeScriptSourceViewerConfiguration extends JavaScriptSourceViewerConfiguration {
66
67
68
+ /**
69
+ * The TypeScript source code scanner.
70
+ *
71
+ */
72
+ private AbstractJavaScanner fCodeScanner ;
73
+
67
74
/**
68
75
* The JSX source scanner.
69
76
*
@@ -73,6 +80,7 @@ public class TypeScriptSourceViewerConfiguration extends JavaScriptSourceViewerC
73
80
public TypeScriptSourceViewerConfiguration (IColorManager colorManager , IPreferenceStore preferenceStore ,
74
81
ITextEditor editor , String partitioning ) {
75
82
super (colorManager , preferenceStore , editor , partitioning );
83
+ fCodeScanner = new TypeScriptCodeScanner (colorManager , preferenceStore );
76
84
jsxScanner = new JSXScanner (colorManager , preferenceStore );
77
85
78
86
}
@@ -336,17 +344,36 @@ public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceVie
336
344
337
345
}
338
346
347
+ /**
348
+ * Returns the TypeScript source code scanner for this configuration.
349
+ *
350
+ * @return the TypeScript source code scanner
351
+ */
352
+ @ Override
353
+ protected RuleBasedScanner getCodeScanner () {
354
+ return fCodeScanner ;
355
+ }
356
+
357
+ /**
358
+ * Returns the JSX source code scanner for this configuration.
359
+ *
360
+ * @return the JSX source code scanner
361
+ */
339
362
protected RuleBasedScanner getJSXScanner () {
340
363
return jsxScanner ;
341
364
}
342
365
343
366
public boolean affectsTextPresentation (final PropertyChangeEvent event ) {
344
- return super .affectsTextPresentation (event ) || jsxScanner .affectsBehavior (event );
367
+ return super .affectsTextPresentation (event ) || fCodeScanner .affectsBehavior (event )
368
+ || jsxScanner .affectsBehavior (event );
345
369
}
346
370
347
371
@ Override
348
372
public void handlePropertyChangeEvent (final PropertyChangeEvent event ) {
349
373
super .handlePropertyChangeEvent (event );
374
+ if (fCodeScanner .affectsBehavior (event )) {
375
+ fCodeScanner .adaptToPreferenceChange (event );
376
+ }
350
377
if (jsxScanner .affectsBehavior (event )) {
351
378
jsxScanner .adaptToPreferenceChange (event );
352
379
}
0 commit comments