public PsiReference @NotNull [] getReferencesByElement(@NotNull PsiElement element,
                                                         @NotNull String text,
                                                         int offset,
                                                         final boolean soft,
                                                         final Module @NotNull ... forModules) {
    return new FileReferenceSet(text, element, offset, this, true, myEndingSlashNotAllowed) {


      @Override
      protected boolean isSoft() {
        return soft;
      }

      @Override
      public boolean isAbsolutePathReference() {
        return true;
      }

      @Override
      public boolean couldBeConvertedTo(boolean relative) {
        return !relative;
      }

      @Override
      public boolean absoluteUrlNeedsStartSlash() {
        final String s = getPathString();
        return !s.isEmpty() && s.charAt(0) == '/';
      }

      @Override
      public @NotNull Collection<PsiFileSystemItem> computeDefaultContexts() {
        if (forModules.length > 0) {
          Set<PsiFileSystemItem> rootsForModules = new LinkedHashSet<>();
          for (Module forModule : forModules) {
            rootsForModules.addAll(getRoots(forModule, true));
          }
          return rootsForModules;
        }

        return getRoots(ModuleUtilCore.findModuleForPsiElement(getElement()), true);
      }

      @Override
      public FileReference createFileReference(final TextRange range, final int index, final String text) {
        return FilePathReferenceProvider.this.createFileReference(this, range, index, text);
      }

      @Override
      protected Condition<PsiFileSystemItem> getReferenceCompletionFilter() {
        return element1 -> isPsiElementAccepted(element1);
      }
    }.getAllReferences();
  }
public PsiReference @NotNull [] getReferencesByElement(@NotNull PsiElement element,
                                                         @NotNull String text,
                                                         int offset,
                                                         final boolean soft,
                                                         final Module @NotNull ... forModules)