2 This module contains variables with global |jedi| settings. To change the
3 behavior of |jedi|, change the variables defined in :mod:`jedi.settings`.
5 Plugins should expose an interface so that the user can adjust the
11 from jedi import settings
12 settings.case_insensitive_completion = True
18 .. autodata:: case_insensitive_completion
19 .. autodata:: add_bracket_after_function
25 .. autodata:: cache_directory
31 .. autodata:: fast_parser
37 .. autodata:: dynamic_array_additions
38 .. autodata:: dynamic_params
39 .. autodata:: dynamic_params_for_other_modules
40 .. autodata:: auto_import_modules
46 .. autodata:: call_signatures_validity
54 # Completion Output Settings
57 case_insensitive_completion
= True
59 Completions are by default case insensitive.
62 add_bracket_after_function
= False
64 Adds an opening bracket after a function for completions.
71 if platform
.system().lower() == 'windows':
72 _cache_directory
= os
.path
.join(
73 os
.getenv('LOCALAPPDATA') or os
.path
.expanduser('~'),
77 elif platform
.system().lower() == 'darwin':
78 _cache_directory
= os
.path
.join('~', 'Library', 'Caches', 'Jedi')
80 _cache_directory
= os
.path
.join(os
.getenv('XDG_CACHE_HOME') or '~/.cache',
82 cache_directory
= os
.path
.expanduser(_cache_directory
)
84 The path where the cache is stored.
86 On Linux, this defaults to ``~/.cache/jedi/``, on OS X to
87 ``~/Library/Caches/Jedi/`` and on Windows to ``%LOCALAPPDATA%\\Jedi\\Jedi\\``.
88 On Linux, if the environment variable ``$XDG_CACHE_HOME`` is set,
89 ``$XDG_CACHE_HOME/jedi`` is used instead of the default one.
98 Uses Parso's diff parser. If it is enabled, this might cause issues, please
99 read the warning on :class:`.Script`. This feature makes it possible to only
100 parse the parts again that have changed, while reusing the rest of the syntax
104 _cropped_file_size
= int(10e6
) # 1 Megabyte
106 Jedi gets extremely slow if the file size exceed a few thousand lines.
107 To avoid getting stuck completely Jedi crops the file at some point.
109 One megabyte of typical Python code equals about 20'000 lines of code.
116 dynamic_array_additions
= True
118 check for `append`, etc. on arrays: [], {}, () as well as list/set calls.
121 dynamic_params
= True
123 A dynamic param completion, finds the callees of the function, which define
124 the params of a function.
127 dynamic_params_for_other_modules
= True
129 Do the same for other modules.
132 dynamic_flow_information
= True
134 Check for `isinstance` and other information to infer a type.
137 auto_import_modules
= [
138 'gi', # This third-party repository (GTK stuff) doesn't really work with jedi
141 Modules that will not be analyzed but imported, if they contain Python code.
142 This improves autocompletion for libraries that use ``setattr`` or
143 ``globals()`` modifications a lot.
146 allow_unsafe_interpreter_executions
= True
148 Controls whether descriptors are evaluated when using an Interpreter. This is
149 something you might want to control when using Jedi from a Repl (e.g. IPython)
151 Generally this setting allows Jedi to execute __getitem__ and descriptors like
159 call_signatures_validity
= 3.0
161 Finding function calls might be slow (0.1-0.5s). This is not acceptible for
162 normal writing. Therefore cache it for a short time.