UNPKG

vscode-chrome-debug-core

Version:

A library for building VS Code debug adapters for targets that support the Chrome Remote Debug Protocol

46 lines (45 loc) 2.59 kB
import { Protocol as Crdp } from 'devtools-protocol'; import { ITarget } from './chromeConnection'; import { IPathMapping } from '../debugAdapterInterfaces'; /** * Takes the path component of a target url (starting with '/') and applies pathMapping */ export declare function applyPathMappingsToTargetUrlPath(scriptUrlPath: string, pathMapping: IPathMapping): string; export declare function applyPathMappingsToTargetUrl(scriptUrl: string, pathMapping: IPathMapping): string; /** * Maps a url from target to an absolute local path, if it exists. * If not given an absolute path (with file: prefix), searches the current working directory for a matching file. * http://localhost/scripts/code.js => d:/app/scripts/code.js * file:///d:/scripts/code.js => d:/scripts/code.js */ export declare function targetUrlToClientPath(aUrl: string, pathMapping: IPathMapping): string; /** * Convert a RemoteObject to a value+variableHandleRef for the client. * TODO - Delete after Microsoft/vscode#12019!! */ export declare function remoteObjectToValue(object: Crdp.Runtime.RemoteObject, stringify?: boolean): { value: string; variableHandleRef?: string; }; /** * Returns the targets from the given list that match the targetUrl, which may have * wildcards. * Ignores the protocol and is case-insensitive. */ export declare function getMatchingTargets(targets: ITarget[], targetUrlPattern: string): ITarget[]; export declare function compareVariableNames(var1: string, var2: string): number; export declare function remoteObjectToCallArgument(object: Crdp.Runtime.RemoteObject): Crdp.Runtime.CallArgument; /** * .exception is not present in Node < 6.6 - TODO this would be part of a generic solution for handling * protocol differences in the future. * This includes the error message and full stack */ export declare function descriptionFromExceptionDetails(exceptionDetails: Crdp.Runtime.ExceptionDetails): string; /** * Get just the error message from the exception details - the first line without the full stack */ export declare function errorMessageFromExceptionDetails(exceptionDetails: Crdp.Runtime.ExceptionDetails): string; export declare function getEvaluateName(parentEvaluateName: string, name: string): string; export declare function selectBreakpointLocation(lineNumber: number, columnNumber: number, locations: Crdp.Debugger.BreakLocation[]): Crdp.Debugger.BreakLocation; export declare const EVAL_NAME_PREFIX = "VM"; export declare function isEvalScript(scriptPath: string): boolean; export declare function getUrlRegexForBreakOnLoad(url: string): string;