-package org.jetbrains.debugger;
+package org.jetbrains.debugger
-import com.intellij.openapi.util.UserDataHolderEx;
-import com.intellij.util.Url;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-import org.jetbrains.debugger.sourcemap.SourceMap;
+import com.intellij.openapi.util.UserDataHolderEx
+import com.intellij.util.Url
+import org.jetbrains.debugger.sourcemap.SourceMap
-public interface Script extends UserDataHolderEx, HasUrl {
- enum Type {
- /** A native, internal JavaScript VM script */
+interface Script : UserDataHolderEx {
+ enum class Type {
+ /** A native, internal JavaScript VM script */
NATIVE,
- /** A script supplied by an extension */
+ /** A script supplied by an extension */
EXTENSION,
- /** A normal user script */
+ /** A normal user script */
NORMAL
}
- Type getType();
+ val type: Type
- @Nullable
- SourceMap getSourceMap();
+ var sourceMap: SourceMap?
- void setSourceMap(@Nullable SourceMap sourceMap);
+ val url: Url
- @Override
- @NotNull
- Url getUrl();
+ val functionName: String?
+ get() = null
- @Nullable
- String getFunctionName();
+ val line: Int
- int getLine();
+ val column: Int
- int getColumn();
-
- int getEndLine();
+ val endLine: Int
}
\ No newline at end of file
-package org.jetbrains.debugger;
-
-import com.intellij.openapi.util.UserDataHolderBase;
-import com.intellij.util.Url;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-import org.jetbrains.concurrency.Promise;
-import org.jetbrains.debugger.sourcemap.SourceMap;
-
-public abstract class ScriptBase extends UserDataHolderBase implements Script {
+package org.jetbrains.debugger
+
+import com.intellij.openapi.util.UserDataHolderBase
+import com.intellij.util.Url
+import org.jetbrains.concurrency.Promise
+import org.jetbrains.debugger.sourcemap.SourceMap
+
+abstract class ScriptBase(override val type: Script.Type,
+ override val url: Url,
+ override val line: Int,
+ override val column: Int,
+ override val endLine: Int) : UserDataHolderBase(), Script {
@SuppressWarnings("UnusedDeclaration")
- private volatile Promise<String> source;
-
- private final Url url;
- protected final int line;
- protected final int column;
- protected final int endLine;
-
- protected final Type type;
-
- private SourceMap sourceMap;
-
- protected ScriptBase(@NotNull Type type, @NotNull Url url, int line, int column, int endLine) {
- this.type = type;
- this.url = url;
- this.line = line;
- this.column = column;
- this.endLine = endLine;
- }
-
- @NotNull
- @Override
- public Url getUrl() {
- return url;
- }
-
- @Nullable
- @Override
- public String getFunctionName() {
- return null;
- }
-
- @Override
- @Nullable
- public SourceMap getSourceMap() {
- return sourceMap;
- }
-
- @Override
- public void setSourceMap(@Nullable SourceMap sourceMap) {
- this.sourceMap = sourceMap;
- }
-
- @Override
- public Type getType() {
- return type;
- }
-
- @Override
- public int getLine() {
- return line;
- }
-
- @Override
- public int getColumn() {
- return column;
- }
+ private @Volatile var source: Promise<String>? = null
- @Override
- public int getEndLine() {
- return endLine;
- }
+ override var sourceMap: SourceMap? = null
- @Override
- public String toString() {
- return "[url=" + getUrl() + ", lineRange=[" + getLine() + ';' + getEndLine() + "]]";
- }
+ override fun toString() = "[url=$url, lineRange=[$line;$endLine]]"
}
\ No newline at end of file