Commit Graph

88 Commits

Author SHA1 Message Date
Stanislav Golovanov
48cda3bb8f Add general completers support 2013-04-21 01:28:37 +04:00
Strahinja Val Markovic
93ed6f7db7 Fix bug with removing flag after "-c"
-c does not take an argument. Why did I think it did?
2013-04-19 10:31:55 -07:00
Thomas Refis
dad08df71b checking if a key is in a dict is done with 'key in dict' not 'hasattr(dict, key)' 2013-04-13 14:29:57 +02:00
Jacek Lach
1b4eb6122c Make caching optional in the omnicompleter 2013-04-11 10:22:16 +01:00
Strahinja Val Markovic
77fbd80c89 Refactoring out some vim.eval calls
s:completion_start_column should not be evaled in Python code. That was a
stopgap measure that ended up lasting far longer than intended.
2013-04-09 19:32:48 -07:00
Strahinja Val Markovic
27d73e0d51 Removing some dead code 2013-04-09 18:43:29 -07:00
Strahinja Val Markovic
085df7e8af Fix traceback print on None for |location|
This happens when the user invokes a GoTo* command on a file with no compilation
flags.
2013-04-08 11:15:27 -07:00
Strahinja Val Markovic
a75c92bb6a Using event.is_set to be compatible with Python2.6
Fixes #227
2013-04-03 19:14:46 -07:00
Strahinja Val Markovic
1f094e50d0 GoToDefinition/Declaration commands for C-family
These are accessible through the :YcmCompleter command. The docs have more
information.
2013-03-31 20:38:29 -07:00
Strahinja Val Markovic
b4837c81fe Handling exceptions in jedi_completer thread 2013-03-24 18:52:50 -07:00
Strahinja Val Markovic
edbcb3abfe More cleanup for correctness and simplicity
The jedi completer now won't hang on <C-Space>
2013-03-24 18:42:31 -07:00
Strahinja Val Markovic
9845d81fb0 More style fixes 2013-03-24 15:22:31 -07:00
Strahinja Val Markovic
6fb784e61b Making the python thread not hang Vim on exit
As the Pytho docs say, "The entire Python program exits when no alive non-daemon
threads are left." Basically, the daemon threads are safely killed.
2013-03-24 15:04:00 -07:00
Strahinja Val Markovic
1c78971acd More style fixes 2013-03-24 14:57:25 -07:00
Strahinja Val Markovic
8f2715c1a4 Posting an error message when jedi import fails 2013-03-24 14:52:11 -07:00
Strahinja Val Markovic
4d95e32a1e Python code style fixes 2013-03-24 14:41:22 -07:00
Strahinja Val Markovic
0954ff31d9 Bug fixes for the new python semantic completer 2013-03-24 14:38:55 -07:00
Stephen Sugden
eed0434e39 Refactor jedi-completer to use a worker thread 2013-03-23 19:24:26 -07:00
Stephen Sugden
da46be7044 Add jedi-based completion.
This first version only uses the Jedi completion engine after a ".", similar to
how the ClangCompleter works. It is also entirely synchronous and blocks for
quite a while the first time it is called.
2013-03-23 16:21:49 -07:00
Strahinja Val Markovic
74021144c0 Making the omni completer more robust
- There was a bug in not calling int() on the result of the first call to the
omnifunc.
- We need to be more resilient to badly written omnifuncs and check that the
result of the second call is a list or a dict with a list, as the vim docs say
the omnifunc should return on the second call.

One of the two fixes probably fixes #198 but since I can't repro the error, I
can't be sure.
2013-03-22 10:26:18 -07:00
Strahinja Val Markovic
d0a51fbf2c More info for conf file load dialog message
The user is now informed of options that can turn off this dialog.
2013-03-19 12:59:17 -07:00
Strahinja Val Markovic
4cb9f17c5f Cache deletion is now async 2013-03-16 12:10:24 -07:00
Strahinja Val Markovic
c391bdcc62 Reducing RAM consumption by deleting unused caches
When the user deletes a buffer, we can delete the clang caches for that file.
Fixes #184.
2013-03-16 10:41:47 -07:00
Strahinja Val Markovic
ba6b40e485 Refactoring the ClangAvailableForBuffer method 2013-03-03 10:48:34 -08:00
Zeh Rizzatti
c6aefaef86 Select correct triggers for multiple filetypes
The base class completer Inner chose the first filetype available and
would use the triggers for it.

The triggers are now chosen considering the first for the current buffer
that is supported by the current completer. If there is no intersection,
it fallsback to considering the first filetype for the buffer.
2013-03-03 01:52:56 -04:00
Zeh Rizzatti
1acd3e84c7 Support for multile filetypes in clang_completer
clang_completer would check if the raw value of '&ft' was one of
supported filetypes for the completer.

Vim allows for multiple filetypes with a '.' separator. A file with
ft=qt.cpp, for example, would not be supported by clang_completer even
though it was a cpp file.

This patch changes that behaviour.
2013-03-02 22:02:29 -04:00
Strahinja Val Markovic
980a1c2ffc Minor post-PR changes 2013-02-28 09:54:22 -08:00
Strahinja Val Markovic
aafcd4264d Merge branch 'globlist' of github.com:kljohann/YouCompleteMe into kljohann-globlist
Conflicts:
	python/completers/cpp/flags.py
2013-02-28 09:51:38 -08:00
Val Markovic
c24d272df6 Merge pull request #155 from kljohann/reload
Implement completer-specific commands
2013-02-28 09:49:11 -08:00
Johann Klähn
1d566bad80 Implement white-/blacklisting 2013-02-28 18:15:09 +01:00
Johann Klähn
3d305f9c74 Implement completer-specific commands
This provides a framework for completer-writers to create
completer-specific commands. I have in mind to use this for the clang
completer to force reloading of a flags module via `:YcmCompleter reload`.
2013-02-28 11:32:07 +01:00
Strahinja Val Markovic
263b405ab4 Very minor post-pull style-related changes. 2013-02-26 18:28:58 -08:00
Strahinja Val Markovic
95b9eeee18 Merge branch 'master' of github.com:kljohann/YouCompleteMe into kljohann-master 2013-02-26 18:21:46 -08:00
Johann Klähn
e9cce29761 Ask before loading .ycm_extra_conf.py files
To prevent the execution of malicious code the new default is
to ask the user before a `.ycm_extra_conf.py` file is loaded.
This can be disabled using the option `g:ycm_confirm_extra_conf`.

This commit introduces a helper class `FlagsModules` that keeps track of
and caches the currently loaded modules. To introduce further criteria
for a module look at `FlagsModules.ShouldLoad`.

Also `:YcmDebugInfo` now lists the file that was used to determine
the current set of flags.

`Flags.ModuleForFile` could be used in a user-facing command that
opens the `.ycm_extra_conf.py` corresponding to the current file.
A second command could then force a reloding of this module via
`Flags.ReloadModule`.
2013-02-26 11:16:26 +01:00
Johann Klähn
70a2a722fe Add GetBoolValue helper in vimsupport 2013-02-25 10:50:39 +01:00
Strahinja Val Markovic
c819c9f31e Typo fix 2013-02-23 13:08:56 -08:00
Strahinja Val Markovic
98ff82ece5 Removing falsy items from omnifunc returned items
Depending on the omnifunc the user has set, it could return empty strings etc in
the list of items.

Fixes #146, fixes #147
2013-02-23 09:55:13 -08:00
Strahinja Val Markovic
c1700c7d19 Handle omnifunc returning dict with 'words' 2013-02-23 09:35:07 -08:00
Strahinja Val Markovic
e60928d721 Updating error message on missing ycm_extra_conf 2013-02-20 13:16:18 -08:00
bear
66289d7522 let g:ycm_global_ycm_extra_conf can use "~" 2013-02-18 15:10:13 +08:00
Val Markovic
9e3aa21a77 Merge pull request #119 from olajep/let-local-conf-override-global
Let local YCM config file override global config file
2013-02-17 13:07:38 -08:00
Ola Jeppsson
3d1a86c382 Let local YCM config file override global config file
Currently, when VIM opens a source file, YCM always defaults to
'g:global_ycm_extra_conf_file' if it exists.

This commit changes YCM's behaviour so that it first tries to find the config
file in the source file's folder (or any of its parents folder), before
falling back to 'g:global_ycm_extra_conf_file'.
2013-02-17 19:06:48 +01:00
Strahinja Val Markovic
e743076e14 Option to collect identifiers n comments/strings
Fixes #98.
2013-02-16 14:00:46 -08:00
Strahinja Val Markovic
7833cc1cf1 More doc updates for Completer API 2013-02-16 13:33:19 -08:00
Strahinja Val Markovic
1cd6f4d05e Some extra docs for the Completer API 2013-02-16 13:26:56 -08:00
Stephen Sugden
7006033d3e typo fix 2013-02-13 21:18:51 -08:00
Strahinja Val Markovic
4000da089d Only triggering omni_completer when omnifunc set 2013-02-13 10:27:40 -08:00
Strahinja Val Markovic
21dac46ecc Docs for the Completer API 2013-02-12 20:01:22 -08:00
Strahinja Val Markovic
452f7d1fec Better triggering of semantic completion
Now there's a nice user-configurable setting for when YCM should trigger
semantic completion. This is very useful for the new omni_completer that uses
data coming from Vim's omnicomplete system.
2013-02-11 21:46:06 -08:00
Strahinja Val Markovic
786e6182ff Initial version of omnifunc-based omni_completer
Still a work in progress (needs better triggering and bug fixes)
2013-02-10 20:03:56 -08:00