Load module annotations in IDE
#KT-22759 Fixed
This commit is contained in:
@@ -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"
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user