All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.scalafmt.interfaces.PositionException Maven / Gradle / Ivy

Go to download

Dependency-free, pure Java public interfaces to integrate with Scalafmt through a build tool or editor plugin.

There is a newer version: 3.8.4-RC3
Show newest version
package org.scalafmt.interfaces;

import java.nio.file.Path;

/**
 * An exception that happened at a position in a source file such as a parse error.
 */
abstract public class PositionException extends Exception {
    public PositionException(String message, Throwable cause) {
        super(message, cause);
    }

    @Override
    public synchronized Throwable fillInStackTrace() {
        return this;
    }

    /**
     * @return The file where the error occurred.
     */
    public abstract Path file();

    /**
     * @return The text contents of the file being formatted.
     */
    public abstract String code();

    /**
     * @return The fully formatted error message including line content and caret.
     */
    public abstract String longMessage();

    /**
     * @return Only the error message itself without line content and caret.
     */
    public abstract String shortMessage();

    public abstract int startLine();
    public abstract int startCharacter();
    public abstract int endLine();
    public abstract int endCharacter();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy