.. link: .. description: .. tags: .. date: 2013/08/18 00:00:00 .. title: NINJA-IDE .. slug: code_completion .. class:: alert alert-info pull-top .. contents:: *Module:* `code_completion.py `_ API ==================================================================================================== No description. *Imports:* ------------ - `re `_ - `token `_ - `tokenize.TokenError `_ - `ninja_ide.tools.completion.analyzer `_ - `ninja_ide.tools.completion.completer `_ - `ninja_ide.tools.completion.completion_daemon `_ - `tokenize.generate_tokens `_ - `ninja_ide.gui.editor.helpers `_ - `ninja_ide.tools.completion.model `_ - `ninja_ide.core.settings `_ *Global Attributes:* ---------------------- - `_TOKEN_NL [at ln:40] `_ ---- *Class:* `CodeCompletion(object) `_ -------------------------------------------------------------------------------------------------------------------------------------------------------- .. code:: python class CodeCompletion(object): No description. *Attributes* ~~~~~~~~~~~~~~ - `MODULES [at ln:49] `_ - `_invalid_op [at ln:56] `_ - `_invalid_words [at ln:57] `_ - `_valid_op [at ln:55] `_ - `analyzer [at ln:46] `_ - `cdaemon [at ln:47] `_ - `keywords [at ln:60] `_ - `module_id [at ln:77] `_ - `patClass [at ln:52] `_ - `patFunction [at ln:53] `_ - `patIndent [at ln:51] `_ - `patWords [at ln:54] `_ *Function:* `__init__() [at ln:45] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def __init__(): No description. ---- *Function:* `_search_for_completion_segment(token_code) [at ln:143] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def _search_for_completion_segment(token_code): No description. ---- *Function:* `_search_for_scope(token_code) [at ln:105] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def _search_for_scope(token_code): No description. ---- *Function:* `_tokenize_text(code) [at ln:88] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def _tokenize_text(code): No description. ---- *Function:* `analyze_file(path, source=None, indent=settings.INDENT, useTabs=settings.USE_TABS) [at ln:65] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def analyze_file(path, source=None, indent=settings.INDENT, useTabs=settings.USE_TABS): No description. ---- *Function:* `get_completion(code, offset) [at ln:195] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def get_completion(code, offset): No description. ---- *Function:* `get_prefix(code, offset) [at ln:182] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def get_prefix(code, offset): | Return the prefix of the word under the cursor and a boolean | saying if it is a valid completion area. ---- *Function:* `unload_module() [at ln:62] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def unload_module(): No description.