Permalink
Browse files

locals in autocomplete

  • Loading branch information...
1 parent 7d15eda commit b06f49148013b74eafa2425288321d44111f28a9 @JPMoresmau committed Dec 18, 2012
Showing with 572 additions and 339 deletions.
  1. +2 −2 net.sf.eclipsefp.haskell-feature/feature.xml
  2. +1 −1 net.sf.eclipsefp.haskell.browser/META-INF/MANIFEST.MF
  3. +8 −0 net.sf.eclipsefp.haskell.browser/src/net/sf/eclipsefp/haskell/browser/items/Constructor.java
  4. +116 −108 net.sf.eclipsefp.haskell.browser/src/net/sf/eclipsefp/haskell/browser/items/Declaration.java
  5. +39 −33 net.sf.eclipsefp.haskell.browser/src/net/sf/eclipsefp/haskell/browser/items/Documented.java
  6. +56 −48 net.sf.eclipsefp.haskell.browser/src/net/sf/eclipsefp/haskell/browser/items/Function.java
  7. +49 −41 net.sf.eclipsefp.haskell.browser/src/net/sf/eclipsefp/haskell/browser/items/HaskellPackage.java
  8. +62 −0 net.sf.eclipsefp.haskell.browser/src/net/sf/eclipsefp/haskell/browser/items/Local.java
  9. +44 −36 net.sf.eclipsefp.haskell.browser/src/net/sf/eclipsefp/haskell/browser/items/Module.java
  10. +1 −1 net.sf.eclipsefp.haskell.buildwrapper/META-INF/MANIFEST.MF
  11. +39 −0 net.sf.eclipsefp.haskell.buildwrapper/src/net/sf/eclipsefp/haskell/buildwrapper/BWFacade.java
  12. +16 −0 net.sf.eclipsefp.haskell.buildwrapper/src/net/sf/eclipsefp/haskell/buildwrapper/types/Location.java
  13. BIN net.sf.eclipsefp.haskell.ui/icons/obj16/localvariable_obj.gif
  14. +65 −53 net.sf.eclipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/browser/util/ImageCache.java
  15. +72 −16 ...et/sf/eclipsefp/haskell/ui/internal/editors/haskell/codeassist/HaskellContentAssistProcessor.java
  16. +1 −0 net.sf.eclipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/util/HaskellUIImages.java
  17. +1 −0 net.sf.eclipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/util/IImageNames.java
@@ -144,7 +144,7 @@ available at http://www.eclipse.org/legal/epl-v10.html.
id="net.sf.eclipsefp.haskell.browser"
download-size="0"
install-size="0"
- version="2.4.0"
+ version="2.4.1"
unpack="false"/>
<plugin
@@ -158,7 +158,7 @@ available at http://www.eclipse.org/legal/epl-v10.html.
id="net.sf.eclipsefp.haskell.buildwrapper"
download-size="0"
install-size="0"
- version="2.4.0"
+ version="2.4.1"
unpack="false"/>
<plugin
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-SymbolicName: net.sf.eclipsefp.haskell.browser; singleton:=true
-Bundle-Version: 2.4.0
+Bundle-Version: 2.4.1
Bundle-Localization: plugin
Bundle-Activator: net.sf.eclipsefp.haskell.browser.BrowserPlugin
Require-Bundle: org.eclipse.ui;bundle-version="3.2.0",
@@ -57,4 +57,12 @@ public String getTypeName() {
public void setTypeName(String typeName) {
this.typeName = typeName;
}
+
+ /* (non-Javadoc)
+ * @see net.sf.eclipsefp.haskell.browser.items.Documented#isType()
+ */
+ @Override
+ public boolean isType() {
+ return false;
+ }
}
@@ -1,108 +1,116 @@
-/**
- * (c) 2011, Alejandro Serrano
- * Released under the terms of the EPL.
- */
-package net.sf.eclipsefp.haskell.browser.items;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-
-import org.json.JSONArray;
-import org.json.JSONObject;
-
-/**
- * Represents one of the top level declarations in a module.
- *
- * @author Alejandro Serrano
- */
-public abstract class Declaration extends Documented {
- DeclarationType type;
- String name;
-
- /**
- * optional module info
- */
- private Module module;
-
- public DeclarationType getType() {
- return this.type;
- }
-
- protected void setType(DeclarationType type) {
- this.type = type;
- }
-
- public String getName() {
- return this.name;
- }
-
- protected void setName(String name) {
- this.name = name;
- }
-
- public static Collection<Declaration> fromJSON(JSONObject o) throws Exception {
- String type = o.getString("type");
-
- if (type.equals("data"))
- return Collections.<Declaration>singleton(new DataType(o));
- else if (type.equals("newtype"))
- return Collections.<Declaration>singleton(new NewType(o));
- else if (type.equals("class"))
- return Collections.<Declaration>singleton(new TypeClass(o));
- else if (type.equals("instance"))
- return Collections.<Declaration>singleton(new Instance(o));
- else if (type.equals("signature")){
- Collection<Declaration> ret = new ArrayList<Declaration>();
- JSONArray arr = o.optJSONArray("name");
- if (arr != null){
- for (int a = 0; a < arr.length(); a++){
- ret.add(new Function(arr.getString(a), o));
- }
- } else {
- String name = o.getString("name");
- ret.add(new Function(name, o));
- }
- return ret;
- } else if (type.equals("type"))
- return Collections.<Declaration>singleton(new TypeSynonym(o));
- else
- throw new Exception("Declaration of unknown type");
- }
-
- public static Declaration fromJSONSingleton(JSONObject o) throws Exception {
- String type = o.getString("type");
-
- if (type.equals("data"))
- return new DataType(o);
- else if (type.equals("newtype"))
- return new NewType(o);
- else if (type.equals("class"))
- return new TypeClass(o);
- else if (type.equals("instance"))
- return new Instance(o);
- else if (type.equals("signature")){
- JSONArray arr = o.optJSONArray("name");
- String name = null;
- if (arr != null){
- name = arr.getString(0);
- } else {
- name = o.getString("name");
- }
- return new Function(name, o);
- } else if (type.equals("type"))
- return new TypeSynonym(o);
- else
- throw new Exception("Declaration of unknown type");
- }
-
- public abstract String getShownName();
-
- public Module getModule() {
- return module;
- }
-
- public void setModule(Module module) {
- this.module = module;
- }
-}
+/**
+ * (c) 2011, Alejandro Serrano
+ * Released under the terms of the EPL.
+ */
+package net.sf.eclipsefp.haskell.browser.items;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+
+import org.json.JSONArray;
+import org.json.JSONObject;
+
+/**
+ * Represents one of the top level declarations in a module.
+ *
+ * @author Alejandro Serrano
+ */
+public abstract class Declaration extends Documented {
+ DeclarationType type;
+ String name;
+
+ /**
+ * optional module info
+ */
+ private Module module;
+
+ public DeclarationType getType() {
+ return this.type;
+ }
+
+ protected void setType(DeclarationType type) {
+ this.type = type;
+ }
+
+ public String getName() {
+ return this.name;
+ }
+
+ protected void setName(String name) {
+ this.name = name;
+ }
+
+ public static Collection<Declaration> fromJSON(JSONObject o) throws Exception {
+ String type = o.getString("type");
+
+ if (type.equals("data"))
+ return Collections.<Declaration>singleton(new DataType(o));
+ else if (type.equals("newtype"))
+ return Collections.<Declaration>singleton(new NewType(o));
+ else if (type.equals("class"))
+ return Collections.<Declaration>singleton(new TypeClass(o));
+ else if (type.equals("instance"))
+ return Collections.<Declaration>singleton(new Instance(o));
+ else if (type.equals("signature")){
+ Collection<Declaration> ret = new ArrayList<Declaration>();
+ JSONArray arr = o.optJSONArray("name");
+ if (arr != null){
+ for (int a = 0; a < arr.length(); a++){
+ ret.add(new Function(arr.getString(a), o));
+ }
+ } else {
+ String name = o.getString("name");
+ ret.add(new Function(name, o));
+ }
+ return ret;
+ } else if (type.equals("type"))
+ return Collections.<Declaration>singleton(new TypeSynonym(o));
+ else
+ throw new Exception("Declaration of unknown type");
+ }
+
+ public static Declaration fromJSONSingleton(JSONObject o) throws Exception {
+ String type = o.getString("type");
+
+ if (type.equals("data"))
+ return new DataType(o);
+ else if (type.equals("newtype"))
+ return new NewType(o);
+ else if (type.equals("class"))
+ return new TypeClass(o);
+ else if (type.equals("instance"))
+ return new Instance(o);
+ else if (type.equals("signature")){
+ JSONArray arr = o.optJSONArray("name");
+ String name = null;
+ if (arr != null){
+ name = arr.getString(0);
+ } else {
+ name = o.getString("name");
+ }
+ return new Function(name, o);
+ } else if (type.equals("type"))
+ return new TypeSynonym(o);
+ else
+ throw new Exception("Declaration of unknown type");
+ }
+
+ public abstract String getShownName();
+
+ public Module getModule() {
+ return module;
+ }
+
+ public void setModule(Module module) {
+ this.module = module;
+ }
+
+ /* (non-Javadoc)
+ * @see net.sf.eclipsefp.haskell.browser.items.Documented#isType()
+ */
+ @Override
+ public boolean isType() {
+ return true;
+ }
+}
@@ -1,33 +1,39 @@
-/**
- * (c) 2011, Alejandro Serrano
- * Released under the terms of the EPL.
- */
-package net.sf.eclipsefp.haskell.browser.items;
-
-import org.json.JSONObject;
-
-/**
- * Elements in tree that have documentation.
- *
- * @author Alejandro Serrano
- */
-public abstract class Documented {
- String doc;
-
- public abstract String getName();
- public abstract String getCompleteDefinition();
-
- public String getDoc() {
- return this.doc;
- }
-
- protected void setDoc(String doc) {
- this.doc = doc;
- }
-
- protected void setDoc(JSONObject o) {
- this.doc = o.optString("doc", "");
- if (this.doc.equals("null"))
- this.doc = "";
- }
-}
+/**
+ * (c) 2011, Alejandro Serrano
+ * Released under the terms of the EPL.
+ */
+package net.sf.eclipsefp.haskell.browser.items;
+
+import org.json.JSONObject;
+
+/**
+ * Elements in tree that have documentation.
+ *
+ * @author Alejandro Serrano
+ */
+public abstract class Documented {
+ String doc;
+
+ public abstract String getName();
+ public abstract String getCompleteDefinition();
+
+ public String getDoc() {
+ return this.doc;
+ }
+
+ protected void setDoc(String doc) {
+ this.doc = doc;
+ }
+
+ protected void setDoc(JSONObject o) {
+ this.doc = o.optString("doc", "");
+ if (this.doc.equals("null"))
+ this.doc = "";
+ }
+
+ /**
+ * do we represent a type?
+ * @return
+ */
+ public abstract boolean isType();
+}
Oops, something went wrong. Retry.

0 comments on commit b06f491

Please sign in to comment.