mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
Public API to update external headers, bug 255338.
This commit is contained in:
parent
fb52538f7d
commit
bda21f162b
6 changed files with 20 additions and 19 deletions
|
@ -8,7 +8,6 @@
|
|||
* Contributors:
|
||||
* Markus Schorn - initial API and implementation
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.cdt.core.index;
|
||||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
|
@ -68,10 +67,18 @@ public interface IIndexManager extends IPDOMManager {
|
|||
|
||||
/**
|
||||
* Constant for indicating to update translation units if their configuration
|
||||
* has changed.
|
||||
* has changed. The flag currently has no effect.
|
||||
*/
|
||||
public final static int UPDATE_CHECK_CONFIGURATION= 0x4;
|
||||
|
||||
/**
|
||||
* Constant for requesting to update the external files for a project, also. This flag works only
|
||||
* if it is used to update one or more projects. It shall be used together with {@link #UPDATE_ALL}
|
||||
* or {@link #UPDATE_CHECK_TIMESTAMPS}.
|
||||
* @since 5.1
|
||||
*/
|
||||
public final static int UPDATE_EXTERNAL_FILES_FOR_PROJECT= 0x8;
|
||||
|
||||
/**
|
||||
* Returns the index for the given project.
|
||||
* @param project the project to get the index for
|
||||
|
@ -183,9 +190,9 @@ public interface IIndexManager extends IPDOMManager {
|
|||
* the options supplied. The selection is defined by an array of translation
|
||||
* units, containers and projects. For containers and projects all recursively
|
||||
* nested translation units are considered.
|
||||
* Valid options are {@link #UPDATE_ALL} and {@link #UPDATE_CHECK_TIMESTAMPS}
|
||||
* @param tuSelection the translation units to update.
|
||||
* @param options one of {@link #UPDATE_ALL} or {@link #UPDATE_CHECK_TIMESTAMPS}.
|
||||
* @param options one of {@link #UPDATE_ALL} or {@link #UPDATE_CHECK_TIMESTAMPS} optionally
|
||||
* combined with {@link #UPDATE_EXTERNAL_FILES_FOR_PROJECT}.
|
||||
* @throws CoreException
|
||||
* @since 4.0
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007, 2008 Wind River Systems, Inc. and others.
|
||||
* Copyright (c) 2007, 2009 Wind River Systems, Inc. and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2005, 2008 QNX Software Systems and others.
|
||||
* Copyright (c) 2005, 2009 QNX Software Systems and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -138,8 +138,6 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
|||
}
|
||||
}
|
||||
|
||||
public static final int UPDATE_EXTERNAL_FILES_FOR_PROJECT = 0x10000; // must not collide with IIndexManager.UPDATE...
|
||||
|
||||
private static final String SETTINGS_FOLDER_NAME = ".settings"; //$NON-NLS-1$
|
||||
private static final QualifiedName dbNameProperty= new QualifiedName(CCorePlugin.PLUGIN_ID, "pdomName"); //$NON-NLS-1$
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007, 2008 Wind River Systems, Inc. and others.
|
||||
* Copyright (c) 2007, 2009 Wind River Systems, Inc. and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -21,13 +21,13 @@ import org.eclipse.cdt.core.dom.IPDOMManager;
|
|||
import org.eclipse.cdt.core.index.IIndex;
|
||||
import org.eclipse.cdt.core.index.IIndexFile;
|
||||
import org.eclipse.cdt.core.index.IIndexFileLocation;
|
||||
import org.eclipse.cdt.core.index.IIndexManager;
|
||||
import org.eclipse.cdt.core.index.IndexLocationFactory;
|
||||
import org.eclipse.cdt.core.model.CoreModel;
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
import org.eclipse.cdt.core.model.ICProject;
|
||||
import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||
import org.eclipse.cdt.internal.core.pdom.IndexerProgress;
|
||||
import org.eclipse.cdt.internal.core.pdom.PDOMManager;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
|
@ -97,7 +97,7 @@ public class PDOMUpdateTask implements IPDOMIndexerTask {
|
|||
elem.accept(collector);
|
||||
}
|
||||
}
|
||||
if (haveProject && (fUpdateOptions & PDOMManager.UPDATE_EXTERNAL_FILES_FOR_PROJECT) != 0) {
|
||||
if (haveProject && (fUpdateOptions & IIndexManager.UPDATE_EXTERNAL_FILES_FOR_PROJECT) != 0) {
|
||||
IIndex index= CCorePlugin.getIndexManager().getIndex(project);
|
||||
index.acquireReadLock();
|
||||
try {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007, 2008 Wind River Systems, Inc. and others.
|
||||
* Copyright (c) 2007, 2009 Wind River Systems, Inc. and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -12,12 +12,10 @@ package org.eclipse.cdt.internal.ui.actions;
|
|||
|
||||
import org.eclipse.cdt.core.index.IIndexManager;
|
||||
|
||||
import org.eclipse.cdt.internal.core.pdom.PDOMManager;
|
||||
|
||||
public class FreshenIndexAction extends AbstractUpdateIndexAction {
|
||||
|
||||
@Override
|
||||
protected int getUpdateOptions() {
|
||||
return IIndexManager.UPDATE_ALL | PDOMManager.UPDATE_EXTERNAL_FILES_FOR_PROJECT;
|
||||
return IIndexManager.UPDATE_ALL | IIndexManager.UPDATE_EXTERNAL_FILES_FOR_PROJECT;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007, 2008 Wind River Systems, Inc. and others.
|
||||
* Copyright (c) 2007, 2009 Wind River Systems, Inc. and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -12,12 +12,10 @@ package org.eclipse.cdt.internal.ui.actions;
|
|||
|
||||
import org.eclipse.cdt.core.index.IIndexManager;
|
||||
|
||||
import org.eclipse.cdt.internal.core.pdom.PDOMManager;
|
||||
|
||||
public class UpdateIndexWithModifiedFilesAction extends AbstractUpdateIndexAction {
|
||||
|
||||
@Override
|
||||
protected int getUpdateOptions() {
|
||||
return IIndexManager.UPDATE_CHECK_TIMESTAMPS | IIndexManager.UPDATE_CHECK_CONFIGURATION | PDOMManager.UPDATE_EXTERNAL_FILES_FOR_PROJECT;
|
||||
return IIndexManager.UPDATE_CHECK_TIMESTAMPS | IIndexManager.UPDATE_CHECK_CONFIGURATION | IIndexManager.UPDATE_EXTERNAL_FILES_FOR_PROJECT;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue