How to use the radian.document.cursor_in_string function in radian

To help you get started, we’ve selected a few radian examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github randy3k / radian / radian / completion.py View on Github external
def get_package_completions(self, document, complete_event):
        text_before = document.current_line_before_cursor
        token_match = TOKEN_PATTERN.match(text_before)
        library_prefix = LIBRARY_PATTERN.match(text_before)
        if token_match and not library_prefix:
            token = token_match.group(1)
            instring = cursor_in_string(document)
            for p in installed_packages():
                if p.startswith(token):
                    comp = p if instring else p + "::"
                    yield Completion(comp, -len(token))
github randy3k / radian / radian / completion.py View on Github external
def get_package_completions(self, document, complete_event):
        text_before = document.current_line_before_cursor
        token_match = TOKEN_PATTERN.match(text_before)
        if not token_match:
            return
        token = token_match.group(1)
        library_prefix = LIBRARY_PATTERN.match(text_before)
        instring = cursor_in_string(document)
        for p in installed_packages():
            if p.startswith(token):
                comp = p if instring or library_prefix else p + "::"
                yield Completion(comp, -len(token))
github randy3k / radian / radian / key_bindings.py View on Github external
def string_scope():
    app = get_app()
    return cursor_in_string(app.current_buffer.document)