blob: 0ce1e436d44d68354dbeaa924a6b551f1c94b00a [file] [log] [blame]
/*=============================================================================#
# Copyright (c) 2009, 2019 Stephan Wahlbrink and others.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
# which is available at https://www.apache.org/licenses/LICENSE-2.0.
#
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
#
# Contributors:
# Stephan Wahlbrink <sw@wahlbrink.eu> - initial API and implementation
#=============================================================================*/
package org.eclipse.statet.r.core.model;
import java.util.List;
import java.util.Set;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.statet.ltk.model.core.IModelManager;
import org.eclipse.statet.ltk.model.core.elements.ISourceUnit;
import org.eclipse.statet.ltk.model.core.elements.ISourceUnitModelInfo;
import org.eclipse.statet.r.core.RProject;
import org.eclipse.statet.r.core.rsource.ast.SourceComponent;
public interface IRModelManager extends IModelManager {
/**
* Returns the frame for the project scope containing all main element definition in the
* project.
*
* @param rProject the R project
* @return the R frame
* @throws CoreException
*/
IRFrame getProjectFrame(RProject rProject) throws CoreException;
/**
* Returns the package names of R package projects in the workspace.
*
* @return set with all package names
*/
Set<String> getPkgNames();
IRFrame getPkgProjectFrame(String pkgName) throws CoreException;
IRModelInfo reconcile(IRSourceUnit su, ISourceUnitModelInfo modelInfo,
List<? extends RChunkElement> chunks, List<? extends SourceComponent> inlineNodes,
int level, IProgressMonitor monitor);
/**
* Find source units with references to the specified name in the specified project.
*
* Note: The returned source units are already {@link ISourceUnit#connect(IProgressMonitor) connected}.
* The caller is responsible to disconnect, if they are no longer required.
*
* @param rProject the R project
* @param name the name of the R element
* @param monitor
* @return list of referencing source units
* @throws CoreException
*/
List<ISourceUnit> findReferencingSourceUnits(RProject rProject, RElementName name,
IProgressMonitor monitor) throws CoreException;
}