|
9 | 9 | ...or in User Mouse Bindings (Packages/User/Default.sublime-mousemap): |
10 | 10 | { "button": "button1", "modifiers": ["super"], "command": "goto_python_definition", "press_command": "drag_select" } |
11 | 11 |
|
12 | | -Configuration files (`~/.codeintel/config' or `project_root/.codeintel/config'). Example: |
| 12 | +Configuration files (`~/.codeintel/config' or `project_root/.codeintel/config'). All configurations are optional. Example: |
13 | 13 | { |
14 | 14 | "PHP": { |
15 | 15 | "php": '/usr/bin/php', |
16 | 16 | "phpExtraPaths": [], |
17 | | - "phpConfigFile": 'php.ini', |
| 17 | + "phpConfigFile": 'php.ini' |
18 | 18 | }, |
19 | 19 | "JavaScript": { |
20 | | - "javascriptExtraPaths": [], |
| 20 | + "javascriptExtraPaths": [] |
21 | 21 | }, |
22 | 22 | "Perl": { |
23 | 23 | "perl": "/usr/bin/perl", |
24 | | - "perlExtraPaths": [], |
| 24 | + "perlExtraPaths": [] |
25 | 25 | }, |
26 | 26 | "Perl": { |
27 | 27 | "ruby": "/usr/bin/ruby", |
28 | | - "rubyExtraPaths": [], |
| 28 | + "rubyExtraPaths": [] |
29 | 29 | }, |
30 | 30 | "Python": { |
31 | 31 | "python": '/usr/bin/python', |
32 | | - "pythonExtraPaths": [], |
| 32 | + "pythonExtraPaths": [] |
33 | 33 | }, |
34 | 34 | "Python3": { |
35 | 35 | "python": '/usr/bin/python3', |
36 | | - "pythonExtraPaths": [], |
37 | | - }, |
| 36 | + "pythonExtraPaths": [] |
| 37 | + } |
38 | 38 | } |
39 | 39 |
|
40 | 40 | """ |
@@ -247,11 +247,13 @@ def codeintel_scan(view, path, content, lang): |
247 | 247 | project_dir = path and find_folder(path, '.codeintel') |
248 | 248 | if project_dir: |
249 | 249 | tryReadCodeIntelDict(os.path.join(project_dir, 'config'), _config) |
| 250 | + else: |
| 251 | + project_dir = os.path.expanduser(os.path.join('~', '.codeintel')) |
250 | 252 | config.update(_config.get(lang, {})) |
251 | 253 | for conf in [ 'pythonExtraPaths', 'rubyExtraPaths', 'perlExtraPaths', 'javascriptExtraPaths', 'phpExtraPaths' ]: |
252 | 254 | v = config.get(conf) |
253 | 255 | if v and isinstance(v, (list, tuple)): |
254 | | - config[conf] = os.pathsep.join(v) |
| 256 | + config[conf] = os.pathsep.join(p if p.startswith('/') else os.path.abspath(os.path.join(project_dir, '..', p)) for p in v) |
255 | 257 |
|
256 | 258 | env = SimplePrefsEnvironment(**config) |
257 | 259 |
|
|
0 commit comments