Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorAlain Magloire2004-08-22 18:18:44 -0400
committerAlain Magloire2004-08-22 18:18:44 -0400
commit9bf3b2ef780c72a70be9556494b28b69283e4254 (patch)
tree6eff3e72a8c3d3a5723d320e9dbb1ebd09ce7fbb /build
parent1ffaa3cf2349d533ccd58b9615e29e9bc8ec76f5 (diff)
downloadorg.eclipse.cdt-9bf3b2ef780c72a70be9556494b28b69283e4254.tar.gz
org.eclipse.cdt-9bf3b2ef780c72a70be9556494b28b69283e4254.tar.xz
org.eclipse.cdt-9bf3b2ef780c72a70be9556494b28b69283e4254.zip
Move the MakefileDocumentProvider to use Eclipse-3.0
TextFileBuffer management this will allow us to open external files also
Diffstat (limited to 'build')
-rw-r--r--build/org.eclipse.cdt.make.ui/plugin.xml22
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileDocumentFactory.java30
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileDocumentProvider.java241
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileDocumentSetupParticipant.java51
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileStorageDocumentProvider.java48
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/PartiallySynchronizedDocument.java97
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileCodeScanner.java2
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileReconcilingStrategy.java14
8 files changed, 372 insertions, 133 deletions
diff --git a/build/org.eclipse.cdt.make.ui/plugin.xml b/build/org.eclipse.cdt.make.ui/plugin.xml
index a484723c110..ed83327becc 100644
--- a/build/org.eclipse.cdt.make.ui/plugin.xml
+++ b/build/org.eclipse.cdt.make.ui/plugin.xml
@@ -423,6 +423,8 @@
</action>
</actionSet>
</extension>
+
+ <!-- Makefile Editor extensions. -->
<extension
id="org.eclipse.cdt.make.editor"
name="MakefileEditor"
@@ -437,6 +439,26 @@
</editor>
</extension>
<extension
+ id="org.eclipse.cdt.make.ui.MakefileDocumentFactory"
+ name="%MakefileDocumentFactory.name"
+ point="org.eclipse.core.filebuffers.documentCreation">
+ <factory
+ extensions="*"
+ class="org.eclipse.cdt.make.internal.ui.editor.MakefileDocumentFactory">
+ </factory>
+ </extension>
+ <extension
+ id="org.eclipse.cdt.make.ui.MakefileDocumentSetupParticipant"
+ name="%MakefileDocumentSetupParticipant.name"
+ point="org.eclipse.core.filebuffers.documentSetup">
+ <participant
+ extensions="*"
+ class="org.eclipse.cdt.make.internal.ui.editor.MakefileDocumentSetupParticipant">
+ </participant>
+ </extension>
+
+
+ <extension
point="org.eclipse.ui.startup">
<startup
class="org.eclipse.cdt.make.internal.ui.MakeStartup">
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileDocumentFactory.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileDocumentFactory.java
new file mode 100644
index 00000000000..b438aa63679
--- /dev/null
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileDocumentFactory.java
@@ -0,0 +1,30 @@
+/**********************************************************************
+ * Copyright (c) 2002,2003,2004 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ ***********************************************************************/
+
+package org.eclipse.cdt.make.internal.ui.editor;
+
+import org.eclipse.jface.text.IDocument;
+
+/**
+ * MakefileDocumentFactory
+ */
+public class MakefileDocumentFactory {
+ public MakefileDocumentFactory() {
+ }
+
+ /*
+ * @see org.eclipse.core.filebuffers.IDocumentFactory#createDocument()
+ */
+ public IDocument createDocument() {
+ return new PartiallySynchronizedDocument();
+ }
+
+}
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileDocumentProvider.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileDocumentProvider.java
index a9b3b5fb75c..a87326b59f8 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileDocumentProvider.java
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileDocumentProvider.java
@@ -10,168 +10,157 @@
*******************************************************************************/
package org.eclipse.cdt.make.internal.ui.editor;
-import java.io.IOException;
-import java.io.StringReader;
import java.util.Iterator;
import org.eclipse.cdt.make.core.MakeCorePlugin;
import org.eclipse.cdt.make.core.makefile.IMakefile;
-import org.eclipse.cdt.make.internal.ui.MakeUIPlugin;
-import org.eclipse.cdt.make.internal.ui.text.makefile.MakefilePartitionScanner;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.jface.text.rules.DefaultPartitioner;
+import org.eclipse.jface.text.ISynchronizable;
import org.eclipse.jface.text.source.IAnnotationModel;
import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.editors.text.FileDocumentProvider;
-
-/**
- */
-public class MakefileDocumentProvider extends FileDocumentProvider implements IMakefileDocumentProvider {
-
- private static MakefilePartitionScanner scanner = null;
-
- /**
- * Bundle of all required informations to allow working copy management.
- */
- protected class MakefileInfo extends FileInfo {
-
- IMakefile fCopy;
-
- public MakefileInfo(IDocument document, IAnnotationModel model, FileSynchronizer fileSynchronizer, IMakefile copy) {
- super(document, model, fileSynchronizer);
- fCopy = copy;
+import org.eclipse.ui.editors.text.ForwardingDocumentProvider;
+import org.eclipse.ui.editors.text.TextFileDocumentProvider;
+import org.eclipse.ui.texteditor.IDocumentProvider;
+import org.eclipse.ui.texteditor.ResourceMarkerAnnotationModel;
+
+public class MakefileDocumentProvider extends TextFileDocumentProvider implements IMakefileDocumentProvider {
+
+ IMakefile fMakefile;
+
+ protected class MakefileAnnotationModel extends ResourceMarkerAnnotationModel /*implements IProblemRequestor */{
+ /**
+ * @param resource
+ */
+ public MakefileAnnotationModel(IResource resource) {
+ super(resource);
}
- public void setModificationStamp(long timeStamp) {
- fModificationStamp = timeStamp;
+ /**
+ * @param makefile
+ */
+ public void setMakefile(IMakefile makefile) {
+ fMakefile = makefile;
}
}
/**
- * Constructor for MakefileDocumentProvider.
+ * Remembers a IMakefile for each element.
*/
- public MakefileDocumentProvider() {
- super();
+ protected class MakefileFileInfo extends FileInfo {
+ public IMakefile fCopy;
}
- /**
- * @see org.eclipse.ui.texteditor.AbstractDocumentProvider#createDocument(Object)
- */
- protected IDocument createDocument(Object element) throws CoreException {
- IDocument document = super.createDocument(element);
- if (document != null) {
- IDocumentPartitioner partitioner = createPartitioner();
- partitioner.connect(document);
- document.setDocumentPartitioner(partitioner);
- }
- return document;
- }
-
- private IDocumentPartitioner createPartitioner() {
- return new DefaultPartitioner(getPartitionScanner(), MakefilePartitionScanner.TYPES);
- }
-
- private MakefilePartitionScanner getPartitionScanner() {
- if (scanner == null)
- scanner = new MakefilePartitionScanner();
- return scanner;
- }
-
- /*
- * @see AbstractDocumentProvider#createElementInfo(Object)
- */
- protected ElementInfo createElementInfo(Object element) throws CoreException {
- if (element instanceof IFileEditorInput) {
-
- IFileEditorInput input = (IFileEditorInput) element;
- IMakefile makefile = createMakefile(input.getFile());
- if (makefile == null) {
- return super.createElementInfo(element);
- }
- try {
- refreshFile(input.getFile());
- } catch (CoreException x) {
- handleCoreException(x, MakeUIPlugin.getResourceString("MakeDocumentProvider.exception.createElementInfo")); //$NON-NLS-1$
- }
-
- IDocument d = null;
- IStatus s = null;
-
- try {
- d = createDocument(element);
- } catch (CoreException x) {
- s = x.getStatus();
- d = createEmptyDocument();
- }
-
- IAnnotationModel m = createAnnotationModel(element);
- FileSynchronizer f = new FileSynchronizer(input);
- f.install();
-
- FileInfo info = new MakefileInfo(d, m, f, makefile);
- info.fModificationStamp = computeModificationStamp(input.getFile());
- info.fStatus = s;
- info.fEncoding = getPersistedEncoding(input);
-
- return info;
- }
-
- return super.createElementInfo(element);
+ public MakefileDocumentProvider() {
+ IDocumentProvider provider= new TextFileDocumentProvider(new MakefileStorageDocumentProvider());
+ provider= new ForwardingDocumentProvider(MakefileDocumentSetupParticipant.MAKEFILE_PARTITIONING, new MakefileDocumentSetupParticipant(), provider);
+ setParentDocumentProvider(provider);
}
/**
- * @param file
- * @return
*/
private IMakefile createMakefile(IFile file) {
return MakeCorePlugin.getDefault().createMakefile(file);
}
- /*
- * @see AbstractDocumentProvider#doSaveDocument(IProgressMonitor, Object, IDocument, boolean)
- */
- protected void doSaveDocument(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite) throws CoreException {
-
- // Update the makefile directives tree;
- ElementInfo elementInfo= getElementInfo(element);
- if (elementInfo instanceof MakefileInfo) {
- MakefileInfo info= (MakefileInfo) elementInfo;
- String content = document.get();
- StringReader reader = new StringReader(content);
- try {
- info.fCopy.parse(info.fCopy.getFileName(), reader);
- } catch (IOException e) {
- }
- }
- super.doSaveDocument(monitor, element, document, overwrite);
- }
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.editors.text.TextFileDocumentProvider#createAnnotationModel(org.eclipse.core.resources.IFile)
+ */
+ protected IAnnotationModel createAnnotationModel(IFile file) {
+ return new MakefileAnnotationModel(file);
+ }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.make.internal.ui.editor.IMakefileDocumentProvider#shutdown()
+ /*
+ * @see org.eclipse.ui.editors.text.TextFileDocumentProvider#createFileInfo(java.lang.Object)
*/
- public void shutdown() {
- Iterator e = getConnectedElements();
- while (e.hasNext()) {
- disconnect(e.next());
+ protected FileInfo createFileInfo(Object element) throws CoreException {
+ if (!(element instanceof IFileEditorInput))
+ return null;
+
+ IFileEditorInput input= (IFileEditorInput) element;
+ IMakefile original= createMakefile(input.getFile());
+ if (original == null)
+ return null;
+
+ FileInfo info= super.createFileInfo(element);
+ if (!(info instanceof MakefileFileInfo)) {
+ return null;
}
+
+ MakefileFileInfo makefileInfo= (MakefileFileInfo) info;
+ setUpSynchronization(makefileInfo);
+
+// IProblemRequestor requestor= cuInfo.fModel instanceof IProblemRequestor ? (IProblemRequestor) cuInfo.fModel : null;
+
+ //original.becomeWorkingCopy(requestor, getProgressMonitor());
+ makefileInfo.fCopy = original;
+
+ if (makefileInfo.fModel instanceof MakefileAnnotationModel) {
+ MakefileAnnotationModel model= (MakefileAnnotationModel) makefileInfo.fModel;
+ model.setMakefile(makefileInfo.fCopy);
+ }
+
+// if (requestor instanceof IProblemRequestorExtension) {
+// IProblemRequestorExtension extension= (IProblemRequestorExtension) requestor;
+// extension.setIsActive(isHandlingTemporaryProblems());
+// }
+
+ return makefileInfo;
}
-
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.editors.text.TextFileDocumentProvider#disposeFileInfo(java.lang.Object, org.eclipse.ui.editors.text.TextFileDocumentProvider.FileInfo)
+ */
+ protected void disposeFileInfo(Object element, FileInfo info) {
+ if (info instanceof MakefileFileInfo) {
+ MakefileFileInfo makefileInfo= (MakefileFileInfo) info;
+ if (makefileInfo.fCopy != null) {
+ //makefileInfo.fCopy.dispose();
+ makefileInfo.fCopy = null;
+ }
+ }
+ super.disposeFileInfo(element, info);
+ }
+
+ /*
+ * @see org.eclipse.ui.editors.text.TextFileDocumentProvider#createEmptyFileInfo()
+ */
+ protected FileInfo createEmptyFileInfo() {
+ return new MakefileFileInfo();
+ }
+
/*
- * @see org.eclipse.cdt.make.internal.ui.editor.ICompilationUnitDocumentProvider#getWorkingCopy(java.lang.Object)
+ * @see org.eclipse.cdt.make.internal.ui.IMakefileDocumentProvider#getWorkingCopy(java.lang.Object)
*/
public IMakefile getWorkingCopy(Object element) {
-
- ElementInfo elementInfo = getElementInfo(element);
- if (elementInfo instanceof MakefileInfo) {
- MakefileInfo info = (MakefileInfo) elementInfo;
+ FileInfo fileInfo= getFileInfo(element);
+ if (fileInfo instanceof MakefileFileInfo) {
+ MakefileFileInfo info= (MakefileFileInfo) fileInfo;
return info.fCopy;
}
return null;
}
+ /*
+ * @see org.eclipse.cdt.make.internal.ui.IMakefileDocumentProvider#shutdown()
+ */
+ public void shutdown() {
+ Iterator e= getConnectedElementsIterator();
+ while (e.hasNext())
+ disconnect(e.next());
+ }
+
+
+ private void setUpSynchronization(MakefileFileInfo antInfo) {
+ IDocument document= antInfo.fTextFileBuffer.getDocument();
+ IAnnotationModel model= antInfo.fModel;
+
+ if (document instanceof ISynchronizable && model instanceof ISynchronizable) {
+ Object lock= ((ISynchronizable) document).getLockObject();
+ ((ISynchronizable) model).setLockObject(lock);
+ }
+ }
+
}
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileDocumentSetupParticipant.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileDocumentSetupParticipant.java
new file mode 100644
index 00000000000..cf0fc9a93cc
--- /dev/null
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileDocumentSetupParticipant.java
@@ -0,0 +1,51 @@
+/**********************************************************************
+ * Copyright (c) 2002,2003,2004 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ ***********************************************************************/
+
+package org.eclipse.cdt.make.internal.ui.editor;
+
+import org.eclipse.cdt.make.internal.ui.text.makefile.MakefilePartitionScanner;
+import org.eclipse.core.filebuffers.IDocumentSetupParticipant;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IDocumentExtension3;
+import org.eclipse.jface.text.IDocumentPartitioner;
+import org.eclipse.jface.text.rules.DefaultPartitioner;
+
+/**
+ * MakefileDocumentSetupParticipant
+ * The document setup participant for Ant.
+ */
+public class MakefileDocumentSetupParticipant implements IDocumentSetupParticipant {
+
+ /**
+ * The name of the Makefiile partitioning.
+ */
+ public final static String MAKEFILE_PARTITIONING= "___makefile_partitioning"; //$NON-NLS-1$
+
+ public MakefileDocumentSetupParticipant() {
+ }
+
+ /*
+ * @see org.eclipse.core.filebuffers.IDocumentSetupParticipant#setup(org.eclipse.jface.text.IDocument)
+ */
+ public void setup(IDocument document) {
+ if (document instanceof IDocumentExtension3) {
+ IDocumentExtension3 extension3= (IDocumentExtension3) document;
+ IDocumentPartitioner partitioner = createDocumentPartitioner();
+ extension3.setDocumentPartitioner(MAKEFILE_PARTITIONING, partitioner);
+ partitioner.connect(document);
+ }
+ }
+
+ private IDocumentPartitioner createDocumentPartitioner() {
+ return new DefaultPartitioner(
+ new MakefilePartitionScanner(), MakefilePartitionScanner.TYPES);
+ }
+}
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileStorageDocumentProvider.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileStorageDocumentProvider.java
new file mode 100644
index 00000000000..3faff31db90
--- /dev/null
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileStorageDocumentProvider.java
@@ -0,0 +1,48 @@
+/**********************************************************************
+ * Copyright (c) 2002,2003,2004 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ ***********************************************************************/
+
+package org.eclipse.cdt.make.internal.ui.editor;
+
+import org.eclipse.cdt.make.internal.ui.text.makefile.MakefilePartitionScanner;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IDocumentExtension3;
+import org.eclipse.jface.text.IDocumentPartitioner;
+import org.eclipse.jface.text.rules.DefaultPartitioner;
+import org.eclipse.ui.editors.text.StorageDocumentProvider;
+
+/**
+ * MakefileStorageDocumentProvider
+ */
+public class MakefileStorageDocumentProvider extends StorageDocumentProvider {
+
+ /*
+ * @see org.eclipse.ui.editors.text.StorageDocumentProvider#setupDocument(java.lang.Object,
+ * org.eclipse.jface.text.IDocument)
+ */
+ protected void setupDocument(Object element, IDocument document) {
+ if (document != null) {
+ IDocumentPartitioner partitioner= createDocumentPartitioner();
+ if (document instanceof IDocumentExtension3) {
+ IDocumentExtension3 extension3= (IDocumentExtension3) document;
+ extension3.setDocumentPartitioner(MakefileDocumentSetupParticipant.MAKEFILE_PARTITIONING, partitioner);
+ } else {
+ document.setDocumentPartitioner(partitioner);
+ }
+ partitioner.connect(document);
+ }
+ }
+
+ private IDocumentPartitioner createDocumentPartitioner() {
+ return new DefaultPartitioner(
+ new MakefilePartitionScanner(), MakefilePartitionScanner.TYPES);
+ }
+
+}
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/PartiallySynchronizedDocument.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/PartiallySynchronizedDocument.java
new file mode 100644
index 00000000000..10771d1ccd6
--- /dev/null
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/PartiallySynchronizedDocument.java
@@ -0,0 +1,97 @@
+/**********************************************************************
+ * Copyright (c) 2002,2003,2004 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ ***********************************************************************/
+
+package org.eclipse.cdt.make.internal.ui.editor;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.ISynchronizable;
+
+/**
+ * PartiallySynchronizedDocument
+ * Document that can also be used by a background reconciler.
+ */
+public class PartiallySynchronizedDocument extends Document implements ISynchronizable {
+
+ private final Object fInternalLockObject= new Object();
+ private Object fLockObject;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocumentExtension#startSequentialRewrite(boolean)
+ */
+ synchronized public void startSequentialRewrite(boolean normalized) {
+ super.startSequentialRewrite(normalized);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocumentExtension#stopSequentialRewrite()
+ */
+ synchronized public void stopSequentialRewrite() {
+ super.stopSequentialRewrite();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#get()
+ */
+ synchronized public String get() {
+ return super.get();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#get(int, int)
+ */
+ synchronized public String get(int offset, int length) throws BadLocationException {
+ return super.get(offset, length);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#getChar(int)
+ */
+ synchronized public char getChar(int offset) throws BadLocationException {
+ return super.getChar(offset);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#replace(int, int, java.lang.String)
+ */
+ synchronized public void replace(int offset, int length, String text) throws BadLocationException {
+ super.replace(offset, length, text);
+ //TODO to be used for incremental parsing...not for 3.0
+// if (length == 0 && text != null) {
+// // Insert
+// } else if (text == null || text.length() == 0) {
+// // Remove
+// } else {
+// fAntModel.setReplaceHasOccurred();
+// }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.IDocument#set(java.lang.String)
+ */
+ synchronized public void set(String text) {
+ super.set(text);
+ }
+
+ /*
+ * @see org.eclipse.jface.text.ISynchronizable#setLockObject(java.lang.Object)
+ */
+ public void setLockObject(Object lockObject) {
+ fLockObject= lockObject;
+ }
+
+ /*
+ * @see org.eclipse.jface.text.ISynchronizable#getLockObject()
+ */
+ public Object getLockObject() {
+ return fLockObject == null ? fInternalLockObject : fLockObject;
+ }
+} \ No newline at end of file
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileCodeScanner.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileCodeScanner.java
index fb74a33af94..ad0188e2fe7 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileCodeScanner.java
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileCodeScanner.java
@@ -57,7 +57,7 @@ public class MakefileCodeScanner extends RuleBasedScanner {
List rules = new ArrayList();
// Add rule for single line comments.
- rules.add(new EndOfLineRule("#", comment, '\\')); //$NON-NLS-1$
+ rules.add(new EndOfLineRule("#", comment, '\\', true)); //$NON-NLS-1$
// Add generic whitespace rule.
rules.add(new WhitespaceRule(new IWhitespaceDetector() {
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileReconcilingStrategy.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileReconcilingStrategy.java
index 7c8b9ebce20..ed30dccf8c0 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileReconcilingStrategy.java
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileReconcilingStrategy.java
@@ -77,13 +77,15 @@ public class MakefileReconcilingStrategy implements IReconcilingStrategy {
private void reconcile() {
IMakefile makefile = fManager.getWorkingCopy(fEditor.getEditorInput());
- String content = fDocumentProvider.getDocument(fEditor.getEditorInput()).get();
- StringReader reader = new StringReader(content);
- try {
+ if (makefile != null) {
+ String content = fDocumentProvider.getDocument(fEditor.getEditorInput()).get();
+ StringReader reader = new StringReader(content);
+ try {
makefile.parse(makefile.getFileName(), reader);
- } catch (IOException e) {
+ } catch (IOException e) {
+ }
+
+ fOutliner.update();
}
-
- fOutliner.update();
}
}

Back to the top