Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

exposed modules from referenced projects

  • Loading branch information...
commit 875e7e2da4039e51babfc05214a0d656e8fe0398 1 parent 744cb14
@JPMoresmau authored
View
6 docs/cabal-dev.txt
@@ -5,5 +5,7 @@
- choosing a package matching a project name should add the project reference
- imports auto completion need exposed modules from reference projects
- - and all symbols in these modules
- - use usage database? or component list (exposed modules are in it)
+ - and all symbols in these modules (names in scope does it at least for a little bit)
+ - use usage database? or component list (exposed modules are in it)
+
+- ghci could use source folders instead of package database and changes in other project files could be reflected straight away
View
9 ...p.haskell.core/src/net/sf/eclipsefp/haskell/core/cabalmodel/PackageDescriptionStanza.java
@@ -621,6 +621,15 @@ public ModuleInclusionType getModuleInclusionType(final String module){
return ret;
}
+ public Set<String> listExposedModules(){
+ Set<String> ret=new HashSet<String>();
+ String s=getProperties().get( CabalSyntax.FIELD_EXPOSED_MODULES );
+ ret.addAll(PackageDescriptionLoader.parseList( s ));
+ for (PackageDescriptionStanza pds:getStanzas()){
+ ret.addAll( pds.listExposedModules() );
+ }
+ return ret;
+ }
public Map<String, String> getRealNames() {
return realNames;
View
21 ...lipsefp/haskell/ui/internal/editors/haskell/codeassist/HaskellContentAssistProcessor.java
@@ -48,12 +48,14 @@
import net.sf.eclipsefp.haskell.ui.internal.editors.haskell.imports.ImportsManager;
import net.sf.eclipsefp.haskell.ui.internal.preferences.editor.IEditorPreferenceNames;
import net.sf.eclipsefp.haskell.ui.internal.preferences.editor.ProposalScope;
+import net.sf.eclipsefp.haskell.ui.internal.scion.ScionManager;
import net.sf.eclipsefp.haskell.ui.internal.util.UITexts;
import net.sf.eclipsefp.haskell.util.FileUtil;
import net.sf.eclipsefp.haskell.util.HaskellText;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
@@ -769,6 +771,25 @@ private ICompletionProposal getCompletionProposal(final String s,final Documente
moduleGraphNames.addAll(pds.listAllModules());
}
exposedModules = new ArrayList<String>();
+
+ if (ScionManager.getCabalImplDetails().isSandboxed()){
+ try {
+ for (IProject p:file.getProject().getReferencedProjects()){
+ if (ResourceUtil.hasHaskellNature( p )){
+ IFile f=BuildWrapperPlugin.getCabalFile( p );
+ if (f!=null){
+ PackageDescription pd=PackageDescriptionLoader.load(f);
+ PackageDescriptionStanza pds=pd.getLibraryStanza();
+ if (pds!=null){
+ exposedModules.addAll(pds.listExposedModules());
+ }
+ }
+ }
+ }
+ } catch (CoreException ce){
+ HaskellUIPlugin.log( ce );
+ }
+ }
return filterModuleNames( offset );
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.