diff options
author | 2024-02-11 22:28:36 +0100 | |
---|---|---|
committer | 2024-02-11 22:28:36 +0100 | |
commit | 0b7b1b2b5a136e157b733e9d9c7e1d250efae15d (patch) | |
tree | 23bd350b9dd5966a69a8e4b1cc8066ed2e7090ff /subprojects/language/src | |
parent | refactor(language): scope shadowing (diff) | |
download | refinery-0b7b1b2b5a136e157b733e9d9c7e1d250efae15d.tar.gz refinery-0b7b1b2b5a136e157b733e9d9c7e1d250efae15d.tar.zst refinery-0b7b1b2b5a136e157b733e9d9c7e1d250efae15d.zip |
feat(language): filter content assist for imports
Diffstat (limited to 'subprojects/language/src')
-rw-r--r-- | subprojects/language/src/main/java/tools/refinery/language/resource/ProblemResourceDescriptionStrategy.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/subprojects/language/src/main/java/tools/refinery/language/resource/ProblemResourceDescriptionStrategy.java b/subprojects/language/src/main/java/tools/refinery/language/resource/ProblemResourceDescriptionStrategy.java index 7d90ea00..3080a78e 100644 --- a/subprojects/language/src/main/java/tools/refinery/language/resource/ProblemResourceDescriptionStrategy.java +++ b/subprojects/language/src/main/java/tools/refinery/language/resource/ProblemResourceDescriptionStrategy.java | |||
@@ -42,6 +42,7 @@ public class ProblemResourceDescriptionStrategy extends DefaultResourceDescripti | |||
42 | public static final String PREFERRED_NAME_TRUE = "true"; | 42 | public static final String PREFERRED_NAME_TRUE = "true"; |
43 | public static final String IMPORTS = DATA_PREFIX + "IMPORTS"; | 43 | public static final String IMPORTS = DATA_PREFIX + "IMPORTS"; |
44 | public static final String IMPORTS_SEPARATOR = "|"; | 44 | public static final String IMPORTS_SEPARATOR = "|"; |
45 | public static final String MODULE_KIND = DATA_PREFIX + "MODULE_KIND"; | ||
45 | public static final String COLOR_RELATION = DATA_PREFIX + "COLOR_RELATION"; | 46 | public static final String COLOR_RELATION = DATA_PREFIX + "COLOR_RELATION"; |
46 | public static final String COLOR_RELATION_TRUE = "true"; | 47 | public static final String COLOR_RELATION_TRUE = "true"; |
47 | 48 | ||
@@ -135,13 +136,14 @@ public class ProblemResourceDescriptionStrategy extends DefaultResourceDescripti | |||
135 | 136 | ||
136 | protected Map<String, String> getUserData(EObject eObject) { | 137 | protected Map<String, String> getUserData(EObject eObject) { |
137 | var builder = ImmutableMap.<String, String>builder(); | 138 | var builder = ImmutableMap.<String, String>builder(); |
138 | if (eObject instanceof Problem) { | 139 | if (eObject instanceof Problem problem) { |
139 | builder.put(SHADOWING_KEY, SHADOWING_KEY_PROBLEM); | 140 | builder.put(SHADOWING_KEY, SHADOWING_KEY_PROBLEM); |
140 | var explicitImports = importCollector.getDirectImports(eObject.eResource()); | 141 | var explicitImports = importCollector.getDirectImports(eObject.eResource()); |
141 | var importsString = explicitImports.toList().stream() | 142 | var importsString = explicitImports.toList().stream() |
142 | .map(importEntry -> importEntry.uri().toString()) | 143 | .map(importEntry -> importEntry.uri().toString()) |
143 | .collect(Collectors.joining(IMPORTS_SEPARATOR)); | 144 | .collect(Collectors.joining(IMPORTS_SEPARATOR)); |
144 | builder.put(IMPORTS, importsString); | 145 | builder.put(IMPORTS, importsString); |
146 | builder.put(MODULE_KIND, problem.getKind().getName()); | ||
145 | } else if (eObject instanceof Node) { | 147 | } else if (eObject instanceof Node) { |
146 | builder.put(SHADOWING_KEY, SHADOWING_KEY_NODE); | 148 | builder.put(SHADOWING_KEY, SHADOWING_KEY_NODE); |
147 | } else if (eObject instanceof Relation relation) { | 149 | } else if (eObject instanceof Relation relation) { |