# Path: core/helpers.py
# def prepend_scheme(url):
#     """Prepend scheme to URL if necessary.
#     """
#     if isinstance(url, str) and len(url.split('://')) == 1:
#         scheme = sublime.load_settings('Requester.sublime-settings').get('scheme', 'http')
#         return scheme + '://' + url
#     return url


import re
from collections import namedtuple
from .helpers import prepend_scheme

    Returns a list of `Selection` instances. Optionally stop after `n` selections
    have been parsed.

    Also supports a shorthand syntax for basic, one-line GET requests.
    """
    start_indices = []

    index = 0
    lines = s.splitlines(True)
    for line in lines:
        if n and len(start_indices) >= n:
            break
        for pattern in match_patterns:
            # for multiline requests, match must occur at start of line,
            # to diminish risk of matching something like 'get(' in the middle of a string
            if re.match(pattern, line):
                start_indices.append(index)
                break
        index += len(line)

    if not start_indices and len(lines) == 1:  # shorthand syntax for basic, one-line GET requests
        # if selection has only one line, we can safely search for start index of first match,
        # even if it's not at start of line
        match = None
        for pattern in match_patterns:
            match = re.search(pattern, line)
            if match:
                break
        if not match:

# Path: core/helpers.py
# def prepend_scheme(url):
#     """Prepend scheme to URL if necessary.
#     """
#     if isinstance(url, str) and len(url.split('://')) == 1:
#         scheme = sublime.load_settings('Requester.sublime-settings').get('scheme', 'http')
#         return scheme + '://' + url
#     return url


# Path: core/parsers.py
import re
from collections import namedtuple
from .helpers import prepend_scheme


    Returns a list of `Selection` instances. Optionally stop after `n` selections
    have been parsed.

    Also supports a shorthand syntax for basic, one-line GET requests.
    """
    start_indices = []

    index = 0
    lines = s.splitlines(True)
    for line in lines:
        if n and len(start_indices) >= n:
            break
        for pattern in match_patterns:
            # for multiline requests, match must occur at start of line,
            # to diminish risk of matching something like 'get(' in the middle of a string
            if re.match(pattern, line):
                start_indices.append(index)
                break
        index += len(line)

    if not start_indices and len(lines) == 1:  # shorthand syntax for basic, one-line GET requests
        # if selection has only one line, we can safely search for start index of first match,
        # even if it's not at start of line
        match = None
        for pattern in match_patterns:
            match = re.search(pattern, line)
            if match:
                break
        if not match:

            return [Selection("get('{}')".format(prepend_scheme(s.strip().strip('"').strip("'"))), 0)]