-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#303 - redesign reference resolution
- Loading branch information
Showing
179 changed files
with
8,003 additions
and
6,691 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,69 @@ | ||
package com.reason; | ||
|
||
import org.jetbrains.annotations.*; | ||
|
||
import java.util.function.*; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public class Joiner { | ||
|
||
private Joiner() {} | ||
|
||
@NotNull | ||
public static <T> String join(@NotNull String separator, @Nullable Iterable<T> items) { | ||
return join(separator, items, Object::toString); | ||
} | ||
private Joiner() { | ||
} | ||
|
||
@NotNull | ||
public static <T> String join( | ||
@NotNull String separator, @Nullable Iterable<T> items, @NotNull Function<T, String> fn) { | ||
if (items == null) { | ||
return "<null>"; | ||
@NotNull | ||
public static <T> String join(@NotNull String separator, @Nullable Iterable<T> items) { | ||
return join(separator, items, Object::toString); | ||
} | ||
|
||
StringBuilder sb = new StringBuilder(); | ||
boolean first = true; | ||
for (T item : items) { | ||
if (!first) { | ||
sb.append(separator); | ||
} | ||
sb.append(fn.apply(item)); | ||
first = false; | ||
@NotNull | ||
public static <T> String join( | ||
@NotNull String separator, @Nullable Iterable<T> items, @NotNull Function<T, String> fn) { | ||
if (items == null) { | ||
return "<null>"; | ||
} | ||
|
||
StringBuilder sb = new StringBuilder(); | ||
boolean first = true; | ||
for (T item : items) { | ||
if (!first) { | ||
sb.append(separator); | ||
} | ||
sb.append(fn.apply(item)); | ||
first = false; | ||
} | ||
return sb.toString(); | ||
} | ||
return sb.toString(); | ||
} | ||
|
||
@NotNull | ||
public static String join(@NotNull String separator, @Nullable Object[] items) { | ||
if (items == null) { | ||
return "<null>"; | ||
@NotNull | ||
public static String join(@NotNull String separator, @Nullable Object[] items) { | ||
if (items == null) { | ||
return "<null>"; | ||
} | ||
|
||
StringBuilder sb = new StringBuilder(); | ||
boolean first = true; | ||
for (Object item : items) { | ||
if (!first) { | ||
sb.append(separator); | ||
} | ||
sb.append(item); | ||
first = false; | ||
} | ||
return sb.toString(); | ||
} | ||
|
||
StringBuilder sb = new StringBuilder(); | ||
boolean first = true; | ||
for (Object item : items) { | ||
if (!first) { | ||
sb.append(separator); | ||
} | ||
sb.append(item); | ||
first = false; | ||
@NotNull | ||
public static String joinFrom(@NotNull String separator, @Nullable Object[] items, int from) { | ||
if (items == null) { | ||
return "<null>"; | ||
} | ||
|
||
StringBuilder sb = new StringBuilder(); | ||
for (int i = from; i < items.length; i++) { | ||
if (i != from) { | ||
sb.append(separator); | ||
} | ||
sb.append(items[i]); | ||
} | ||
return sb.toString(); | ||
} | ||
return sb.toString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 0 additions & 12 deletions
12
jps-plugin/src/com/reason/lang/core/psi/PsiQualifiedElement.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.