X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/ui/text/PHPSourceViewerConfiguration.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/ui/text/PHPSourceViewerConfiguration.java index 7708050..2f9211a 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/ui/text/PHPSourceViewerConfiguration.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/ui/text/PHPSourceViewerConfiguration.java @@ -165,12 +165,14 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration { private AbstractJavaScanner fSinglelineCommentScanner; /** - * The Java string scanner - * - * @since 3.0 + * The PHP double quoted string scanner */ - private AbstractJavaScanner fStringScanner; - + private AbstractJavaScanner fStringDQScanner; + /** + * The PHP single quoted string scanner + */ + private AbstractJavaScanner fStringSQScanner; + /** * The Javadoc scanner * @@ -251,7 +253,7 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration { // fCodeScanner = (AbstractJavaScanner) fJavaTextTools.getCodeScanner(); // fMultilineCommentScanner = (AbstractJavaScanner) fJavaTextTools.getMultilineCommentScanner(); // fSinglelineCommentScanner = (AbstractJavaScanner) fJavaTextTools.getSinglelineCommentScanner(); - // fStringScanner = (AbstractJavaScanner) fJavaTextTools.getStringScanner(); + // fStringDQScanner = (AbstractJavaScanner) fJavaTextTools.getStringScanner(); // fJavaDocScanner = (AbstractJavaScanner) fJavaTextTools.getJavaDocScanner(); // fTextEditor = editor; // fXMLTextTools = XMLPlugin.getDefault().getXMLTextTools(); @@ -278,7 +280,8 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration { IPreferenceConstants.PHP_MULTILINE_COMMENT); fSinglelineCommentScanner = new SingleTokenPHPScanner(getColorManager(), fPreferenceStore, IPreferenceConstants.PHP_SINGLELINE_COMMENT); - fStringScanner = new SingleTokenPHPScanner(getColorManager(), fPreferenceStore, IPreferenceConstants.PHP_STRING); + fStringDQScanner = new SingleTokenPHPScanner(getColorManager(), fPreferenceStore, IPreferenceConstants.PHP_STRING_DQ); + fStringSQScanner = new SingleTokenPHPScanner(getColorManager(), fPreferenceStore, IPreferenceConstants.PHP_STRING_SQ); fJavaDocScanner = new PHPDocCodeScanner(getColorManager(), fPreferenceStore); } @@ -292,7 +295,7 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration { */ public boolean affectsTextPresentation(PropertyChangeEvent event) { return fCodeScanner.affectsBehavior(event) || fMultilineCommentScanner.affectsBehavior(event) - || fSinglelineCommentScanner.affectsBehavior(event) || fStringScanner.affectsBehavior(event) + || fSinglelineCommentScanner.affectsBehavior(event) || fStringDQScanner.affectsBehavior(event)|| fStringSQScanner.affectsBehavior(event) || fJavaDocScanner.affectsBehavior(event); } @@ -315,8 +318,10 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration { fMultilineCommentScanner.adaptToPreferenceChange(event); if (fSinglelineCommentScanner.affectsBehavior(event)) fSinglelineCommentScanner.adaptToPreferenceChange(event); - if (fStringScanner.affectsBehavior(event)) - fStringScanner.adaptToPreferenceChange(event); + if (fStringDQScanner.affectsBehavior(event)) + fStringDQScanner.adaptToPreferenceChange(event); + if (fStringSQScanner.affectsBehavior(event)) + fStringSQScanner.adaptToPreferenceChange(event); if (fJavaDocScanner.affectsBehavior(event)) fJavaDocScanner.adaptToPreferenceChange(event); } @@ -455,16 +460,23 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration { } /** - * Returns the Java string scanner for this configuration. + * Returns the PHP double quoted string scanner for this configuration. * - * @return the Java string scanner - * @since 2.0 + * @return the PHP double quoted string scanner */ - protected RuleBasedScanner getStringScanner() { - return fStringScanner; + protected RuleBasedScanner getStringDQScanner() { + return fStringDQScanner; } /** + * Returns the PHP single quoted string scanner for this configuration. + * + * @return the PHP single quoted string scanner + */ + protected RuleBasedScanner getStringSQScanner() { + return fStringSQScanner; + } + /** * Returns the HTML source code scanner for this configuration. * * @return the HTML source code scanner @@ -503,16 +515,6 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration { return null; } - // public IReconciler getReconciler(ISourceViewer sourceViewer) { - // if (getEditor() != null && getEditor().isEditable()) { - // JavaReconciler reconciler = new JavaReconciler(getEditor(), - // new JavaReconcilingStrategy(getEditor()), false); - // reconciler.setProgressMonitor(new NullProgressMonitor()); - // reconciler.setDelay(500); - // return reconciler; - // } - // return null; - // } /* * @see SourceViewerConfiguration#getConfiguredTextHoverStateMasks(ISourceViewer, String) * @since 2.1 @@ -815,12 +817,12 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration { phpReconciler.setDamager(phpDR, IPHPPartitions.PHP_PHPDOC_COMMENT); phpReconciler.setRepairer(phpDR, IPHPPartitions.PHP_PHPDOC_COMMENT); - phpDR = new DefaultDamagerRepairer(getStringScanner()); + phpDR = new DefaultDamagerRepairer(getStringDQScanner()); phpReconciler.setDamager(phpDR, IPHPPartitions.PHP_STRING_DQ); phpReconciler.setRepairer(phpDR, IPHPPartitions.PHP_STRING_DQ); - phpDR = new DefaultDamagerRepairer(getStringScanner()); + phpDR = new DefaultDamagerRepairer(getStringSQScanner()); phpReconciler.setDamager(phpDR, IPHPPartitions.PHP_STRING_SQ); - phpReconciler.setRepairer(phpDR, IPHPPartitions.PHP_STRING_SQ); + phpReconciler.setRepairer(phpDR, IPHPPartitions.PHP_STRING_SQ); phpDR = new DefaultDamagerRepairer(getSinglelineCommentScanner()); phpReconciler.setDamager(phpDR, IPHPPartitions.PHP_SINGLELINE_COMMENT); phpReconciler.setRepairer(phpDR, IPHPPartitions.PHP_SINGLELINE_COMMENT);