mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
sourcemaps: ability to resolve sources relative to generated file
This commit is contained in:
@@ -169,6 +169,9 @@ public final class UrlImpl implements Url {
|
||||
return true;
|
||||
}
|
||||
if (!(o instanceof UrlImpl)) {
|
||||
if (o instanceof LocalFileUrl && isInLocalFileSystem()) {
|
||||
return o.getPath().equals(path);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -120,12 +120,23 @@ public final class Urls {
|
||||
|
||||
// must not be used in NodeJS
|
||||
public static Url newFromVirtualFile(@NotNull VirtualFile file) {
|
||||
String path = file.getPath();
|
||||
if (file.isInLocalFileSystem()) {
|
||||
return new UrlImpl(file.getFileSystem().getProtocol(), null, path);
|
||||
return new UrlImpl(file.getFileSystem().getProtocol(), null, file.getPath());
|
||||
}
|
||||
else {
|
||||
return parseUrl(file.getUrl(), false);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean equalsIgnoreParameters(@NotNull Url url, @NotNull VirtualFile file) {
|
||||
if (file.isInLocalFileSystem()) {
|
||||
return url.isInLocalFileSystem() && url.getPath().equals(file.getPath());
|
||||
}
|
||||
else if (url.isInLocalFileSystem()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Url fileUrl = parseUrl(file.getUrl(), false);
|
||||
return fileUrl != null && fileUrl.equalsIgnoreParameters(url);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user