Load module annotations in IDE

#KT-22759 Fixed
This commit is contained in:
Alexander Udalov
2018-01-25 17:53:57 +01:00
parent 890374a42a
commit 21e2a3c0b4
13 changed files with 193 additions and 10 deletions
@@ -16,6 +16,7 @@
package org.jetbrains.kotlin.name;
import kotlin.text.StringsKt;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -94,6 +95,16 @@ public final class ClassId {
return packageFqName.startsWith(segment);
}
/**
* @param string a string where packages are delimited by '/' and classes by '.', e.g. "kotlin/Map.Entry"
*/
@NotNull
public static ClassId fromString(@NotNull String string) {
String packageName = StringsKt.substringBeforeLast(string, '/', "").replace('/', '.');
String className = StringsKt.substringAfterLast(string, '/', string);
return new ClassId(new FqName(packageName), new FqName(className), false);
}
/**
* @return a string where packages are delimited by '/' and classes by '.', e.g. "kotlin/Map.Entry"
*/