140
*/
141
export function extractSelection(uri: URI): { selection: ITextEditorSelection | undefined; uri: URI } {
142
>
let selection: ITextEditorSelection | undefined = undefined;
opener.ts
143
>
const match = /^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(uri.fragment);
144
>
if (match) {
145
>
selection = {
146
>
startLineNumber: parseInt(match[1]),
147
>
startColumn: match[2] ? parseInt(match[2]) : 1,
148
>
endLineNumber: match[4] ? parseInt(match[4]) : undefined,
149
>
endColumn: match[4] ? (match[5] ? parseInt(match[5]) : 1) : undefined
150
>
};
151
>
uri = uri.with({ fragment: '' });
152
>
}
153
>
return { selection, uri };
154
>
}