Code Monkey home page Code Monkey logo

emacs-ycmd's Introduction

This package is currently unmaintained! If you want to take over maintenance, let me know in an issue.

emacs-ycmd

MELPA MELPA Stable Build Status

emacs-ycmd is a client for ycmd, the code completion system. It takes care of managing a ycmd server and fetching completions from that server.

emacs-ycmd comprises a core set of functionality for communicating with ycmd as well as integration with the Emacs completion framework company-mode.

A lot of the concepts behind emacs-ycmd are actually concepts from ycmd itself, so if you feel lost you might read the ycmd documentation and/or the the original YouCompleteMe documentation.

Important: The ycmd package itself doesn't provide a real UI for selecting and inserting completions into your files. For that you need to use company-ycmd or another "completion framework".

Quickstart

First make sure that ycmd is installed on your system. See the ycmd instructions for more details.

To use ycmd-mode in all supported modes, add the following to your emacs config:

(require 'ycmd)
(add-hook 'after-init-hook #'global-ycmd-mode)

Or add ycmd-mode to a specific supported mode:

(require 'ycmd)
(add-hook 'c++-mode-hook 'ycmd-mode)

Use the variable ycmd-server-command to specify how to run the server. It will typically be something like:

(set-variable 'ycmd-server-command '("python" "/path/to/ycmd/package/"))

NB: We do not do filename expansion on the elements of ycmd-server-command. As a result, paths using "~" to represent the home directory will not work properly; you need to expand them yourself. For example:

(set-variable 'ycmd-server-command `("python" ,(file-truename "~/.emacs.d/ycmd/ycmd/")))

If you've got a global ycmd configuration, specify that in your emacs configuration by setting ycmd-global-config:

(set-variable 'ycmd-global-config "/path/to/global_config.py")

Spacemacs users: Note that if you don't set ycmd-global-config, spacemacs will set it for you. This is not always what you want! See the spacemacs ycmd documentation for more info.

If you've got project-specific ycmd configurations (almost certainly called .ycm_extra_conf.py), and if you want them automatically loaded by ycmd as needed (which you probably do), then you can whitelist them by adding entries to ycmd-extra-conf-whitelist. For example, this will allow automatic loading of all .ycm_extra_conf.py files anywhere under ~/my_projects

(set-variable 'ycmd-extra-conf-whitelist '("~/my_projects/*"))

Alternatively, you can set ycmd-extra-conf-handler to control how ycmd.el deals with non-whitelisted extra configs. By default this is set to 'ask, meaning it will ask the user each time one is encountered. The other options are 'ignore, in which case the extra config will be ignored, and 'load, in which case the extra config will be loaded.

Now a ycmd server will be automatically launched whenever it's needed. Generally, this means whenever you visit a file with a supported major mode. You should not normally need to manually start or stop a ycmd server.

With a server running, you can now get completions for a point in a file using ycmd-get-completions. This doesn't actually insert the completions; it just fetches them from the server. It's not even an interactive function, so you can't really call it while editing. If you just want to see the possible completions at a point, you can try ycmd-display-completions which will dump a raw completion struct into a buffer. This is more of a debugging tool than anything.

completion

It is recommended to use company-mode for completion, however there is basic support for Emacs' built-in completion mechanism.

(defun ycmd-setup-completion-at-point-function ()
  "Setup `completion-at-point-functions' for `ycmd-mode'."
  (add-hook 'completion-at-point-functions
            #'ycmd-complete-at-point nil :local))

(add-hook 'ycmd-mode-hook #'ycmd-setup-completion-at-point-function)

company-ycmd

MELPA MELPA Stable

More likely, you'll want to use a completion framework like company-mode to manage the completions for you. Here's how to do that:

(require 'company-ycmd)
(company-ycmd-setup)

After this you can use your standard company-mode keybindings to do completion.

IMPORTANT: Unbuffered output

There have been some reports that ycmd.el doesn't work when Python's output is buffered. See, for example, issue #104. This is because we rely on the ycmd server printing out its host and port information in a timely (i.e. unbuffered) manner. We will almost certainly update the defaults for ycmd.el to force unbuffered output.

In any event, if you are facing problems with ycmd not starting and/or hanging Emacs, try adding -u to your ycmd-server-command. For example:

(set-variable 'ycmd-server-command '("c:/path/to/python.exe" "-u" "c:/path/to/ycmd"))

flycheck integration

MELPA MELPA Stable

flycheck-ycmd.el allows you to use ycmd as a backend for flycheck. With this enabled, whenever ycmd parses a file the results will be passed to flycheck for display. This is a really nice way to get quick feedback on problems in your code.

The simple way to enable flycheck integration is to use flycheck-ycmd-setup:

(require 'flycheck-ycmd)
(flycheck-ycmd-setup)

This will make sure that flycheck sees the parse results, and that the flycheck-ycmd backend is enabled.

If for some reason you want to do this manually, the instructions are like this:

(require 'flycheck-ycmd)

;; Make sure the flycheck cache sees the parse results
(add-hook 'ycmd-file-parse-result-hook 'flycheck-ycmd--cache-parse-results)

;; Add the ycmd checker to the list of available checkers
(add-to-list 'flycheck-checkers 'ycmd)

Disabling ycmd-based flycheck for specific modes

If you use flycheck-ycmd-setup or otherwise put ycmd at the front of flycheck-checkers, flycheck will use the ycmd checker for every buffer in ycmd-mode. This may not be what you want. For example, even though ycmd supports completion (and, thus, flycheck) for Python, you may wish to use pyflakes for flychecking Python code.

To disable ycmd-based flychecking for specific modes, you can modify the flycheck-disabled-checkers list in your mode hook. For example:

(add-hook 'python-mode-hook (lambda () (add-to-list 'flycheck-disabled-checkers 'ycmd)))

With this, the ycmd checker will be ignored in python-mode. Since flycheck-disabled-checkers is buffer-local, the ycmd-based checker will still be available for other modes.

Making flycheck and company work together

In some cases you may see that company and flycheck interfere with one another. You can end up with strange completion artifacts in your buffers. This mostly seems to happen when you run emacs in "terminal mode", i.e. with emacs -nw.

The short answer for how to deal with this is:

(setq flycheck-indication-mode nil)

The slightly longer and probably better answer is:

(when (not (display-graphic-p))
  (setq flycheck-indication-mode nil))

For a full explanation see the emacs-ycmd defect related to this as well as the root flycheck issue.

eldoc integration

ycmd-eldoc adds eldoc support for ycmd-mode buffers.

(require 'ycmd-eldoc)
(add-hook 'ycmd-mode-hook 'ycmd-eldoc-setup)

Note: eldoc messages will only be shown for functions which are retrieved via semantic completion.

next-error integration

emacs-ycmd reports found errors through emacs buttons; to integrate those with next-error prepend something like (require 'ycmd-next-error) before require'ing ycmd (after adding the contrib directory to your load-path).

Making emacs-ycmd quieter

In some common configurations emacs-ycmd can produce lots of messages, and some people find these noisy and distracting. If you're seeing a lot of messages like Contacting host: 127.0.0.1:NNNNN and you'd like to quiet them, set url-show-status to nil. This can effect non-ycmd-related buffers, so consider using buffer-local settings if this worries you.

You might also see a flurry of messages like this:

REQUEST [error] Error (error) while connecting to http://127.0.0.1:38987/completions.
REQUEST [error] Error (error) while connecting to http://127.0.0.1:38987/event_notification. [26 times]

These almost never indicate something you need to be concerned about. To quiet them, you can set request-message-level to -1.

See issue #173 for the initial discussion of this topic.

Running tests

emacs-ycmd comes with a number of tests that you can run. This is mostly useful for developers. They are built with ert, so you can run them using any technique that ert provides. For example:

(require 'ycmd-test)
(ert-run-tests-interactively "ycmd-test")

It is also possible to run the tests on the command-line with the Makefile provided in this repository. Before running test, you need to install the Cask in order to be able to install the package dependencies.

You can do this by running

make deps

The other thing that is required is to have the ycmd folder right next to emacs-ycmd (../ycmd).

To run the tests:

make test

It is also possible to have the ycmd server at a different location. In that case the path needs to be passed to the make command explicitly:

make YCMDPATH='/path/to/ycmd/ycmd' test

Make sure that you provide the path to the ycmd module and not the ycmd root directory.

emacs-ycmd's People

Contributors

aijony avatar andymoreland avatar ashwinravianandan avatar demon386 avatar fischman avatar hotpxl avatar jcs090218 avatar kha avatar mband avatar milkypostman avatar msanders avatar noxdafox avatar oblique avatar phst avatar ptrv avatar purcell avatar sbelmon avatar syohex avatar tarsius avatar unhammer avatar valloric avatar yourfin avatar zzbot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

emacs-ycmd's Issues

Ship new identifiers to ycmd as they become available

It should be possible to add new identifiers to ycmd's index as we create them in emacs. I'm not sure of the exact mechanism, but it's mentioned in #22.

Doing this will improve the fluidity of completion for newly created identifiers.

Typo issue

At last I find where the problem origins.

Please check your typo on ycmd.el line 8
;; Package-Requires: ((anaphoa "1.0.0") (request "0.2.0") (deferred "0.3.2") (request-deferred "0.2.0"))

anaphoa should be anaphora, right now it makes the package update stuck.

(Or you can check your /elpa/melpa/archive-contents) and crtl+s + "anaphoa".

Or just open package-list-packages and go to ycmd and check the REQUIREMENT. Easy to find the anaphoa is not a practical package, my friends.

Parsing large C++ files slows down emacs

The issue was already there but it got really noticeable and a bit annoying in large c++ projects since setting ycmd--buffer-needs-parse to t has been added to the after-change-hook. IMHO it is not necessary to reparse the buffer whenever I type a char. For c++ files in large projects completion then doesn't really work and slows down emacs. Is it really needed to reparse every time the buffer has been modified? I think reparse on save is sufficient. I really have a better ycmd completion experience if I comment out https://github.com/abingham/emacs-ycmd/blob/master/ycmd.el#L681

Tip from reddit

That's nice, I wrote some simple backend myself too.
Just one tip: the remove-if-not + string-prefix-p combo can be replaced with the built-in function all-completions. For example:
(all-completions arg sample-completions)

identifier-based completion doesn't work and clean fast enough

Let's say in Vim I have a variable like

int capci;

just after I type this line, I can immediately get completion when I type something like 'cap'.

In addition, after I delete that line, it will be "cleaned" from the identifier completion candidates.

I don't know what kind of magic @Valloric did for Vim client, but it works very smoothly. Right now in emacs-ycmd, at least for cpp file, I feel that there's a significant delay for getting new identifier into completion list, as well as get it "cleaned".

Company mode popup gets pushed right.

In some cases when using company-ycmd, the first character will work great but on typing additional characters the popup will get pushed down and to the right.

For me this only occurs with ycmd, company works fine everywhere else. This happens in both Python and C++ mode and occurs with error buttons disabled and enabled. Not sure about other factors in my config that could cause this, I'll keep looking into it.

Screencast:
http://cl.ly/2s1F1A2r3l08

Screenshot:
screen shot 2014-11-05 at 9 03 34 pm

more error information

Right now the completion works well for Python, but for C++, I got the following error:

REQUEST [error] Error (error) while connecting to http://127.0.0.1:51947/completions.

The plugins should provide more information for errors, otherwise I have no way to find what went wrong

Add support for all ycmd completion types.

Right now we're very focused on C++ support, and that's a bit hardwired into the client. We need to consider how to properly support other types of completion that ycmd provides. This include e.g. Python and c#.
This is going to take a bit of digging and discussion with ycmd. I took a simple stab at python, and it didn't work as expected. But hopefully it won't be too hard.
And of course support for completion in various languages should be optional. For example I currently use jedi.el for python completion, and I might not want to enable python completion via ycmd. So users need to be able to opt out of various forms of completion.

Handle event-notification asynchronously

Right now the emacs client will block while ycmd processed (i.e. compiles) files during file-ready handling. For complex files this can be very, very noticeable. Fix it.

Integrate with next-error (M-` by default)

YCM error reporting is great. It would be even better if it was integrated into emacs' next-error mechanism.

A prototype/hack to do this is below, though there are better ways to do this
(my constraint was that I wanted it to work with unmodified ycmd elisp, but the proper solution is probably to in fact modify ycmd elisp :)).

Prototype/hack details follow.

In all my programming buffers I run this:
(setq next-error-function 'ami-ycmd-next-error)

Then at the top-level of my .emacs I have:

(defun ami-at-ycmd-button (cur)
  "Returns whether CUR is at a ycmd button."
  (let* ((button (button-at cur))
         (type (and button (button-type button))))
    (or (eq type 'ycmd--error-button)
        (eq type 'ycmd--warning-button))))

(defun ami-ycmd-next-error (&optional count reset)
  "Go to next YCM-detected error in the current buffer, or stay put if none"
  (interactive)
  (when (null count) (setq count 0))
  (let ((target nil)
        (move-fn (if (< count 0) 'previous-button 'next-button))
        (next-count (if (< count -1) (1+ count) (if (> count 1) (1- count) 0)))
        (cur (if reset (point-min) (point))))
    (save-excursion
      (when (and
             (setq cur (funcall (symbol-function move-fn) cur))
             (ami-at-ycmd-button cur))
        (setq target cur)))
    (if (not (and count target))
        (message "Reached last error")
      (goto-char target)
      (when (not (eq next-count 0))
        (ami-ycmd-next-error next-count nil)))))

(add-hook 'next-error-hook
          '(lambda () (interactive)
             (if (ami-at-ycmd-button (point)) (push-button)
               (let ((compilation-buffer (get-buffer "*compilation*")))
                 (when compilation-buffer
                   (save-excursion
                     (set-buffer "*compilation*")
                     (move-beginning-of-line nil)
                     (pulse-line-hook-function)))))))

(the bottom of this last lambda predates the YCM business and should probably be extracted).

.ycm_extra_conf.py is necessary only for clang completion

In other words, users shouldn't need to specify that if he doesn't want to use clang completion.

The search logic of YCM Vim client makes more sense (quoted from https://github.com/Valloric/YouCompleteMe):

YCM looks for a .ycm_extra_conf.py file in the directory of the opened file or in any directory above it in the hierarchy (recursively); when the file is found, it is loaded (only once!) as a Python module... You can also provide a path to a global .ycm_extra_conf.py file, which will be used as a fallback.

Ideally, users don't need to call ycmd-open in configuration. Providing a global fallback file path should be enough, and only clang completion needs this file.

Error until parsing is finished

Is it normal that I get the following error everytime until paring is finished?

REQUEST [error] Error (error) while connecting to http://127.0.0.1:61686/completions.

The output in *ycmd-server* is:

2014-11-01 12:38:13,813 - DEBUG - Using filetype completion: True
Traceback (most recent call last):
  File "/Users/peter/src/ycmd/third_party/bottle/bottle.py", line 861, in _handle
    return route.call(**args)
  File "/Users/peter/src/ycmd/third_party/bottle/bottle.py", line 1734, in wrapper
    rv = callback(*a, **ka)
  File "/Users/peter/src/ycmd/ycmd/../ycmd/watchdog_plugin.py", line 100, in wrapper
    return callback( *args, **kwargs )
  File "/Users/peter/src/ycmd/ycmd/../ycmd/hmac_plugin.py", line 54, in wrapper
    body = callback( *args, **kwargs )
  File "/Users/peter/src/ycmd/ycmd/../ycmd/handlers.py", line 100, in GetCompletions
    completer.ComputeCandidates( request_data ),
  File "/Users/peter/src/ycmd/ycmd/../ycmd/completers/completer.py", line 158, in ComputeCandidates
    candidates = self._GetCandidatesFromSubclass( request_data )
  File "/Users/peter/src/ycmd/ycmd/../ycmd/completers/completer.py", line 173, in _GetCandidatesFromSubclass
    raw_completions = self.ComputeCandidatesInner( request_data )
  File "/Users/peter/src/ycmd/ycmd/../ycmd/completers/cpp/clang_completer.py", line 81, in ComputeCandidatesInner
    raise RuntimeError( PARSING_FILE_MESSAGE )
RuntimeError: Still parsing file, no completions yet.

Wouldn't it be better just to wait until parsing is finished and completion result is there in ycmd-get-completion and not returning the error message? After this message I have to call ycmd-get-completion again until paring is finished to get completion results.

REQUEST [error] Error (parse-error) while connecting to http://127.0.0.1:<port>/event_notification

Hi, I also submitted this issue upstream: tkf/emacs-request#20
I also post the issue here to let people know that the problem is known and caused by emacs-request and hopefully attract some more attention to the currently inactive project emacs-request...
The details and example file can be seen below. Furthermore a quick and dirty workaround to avoid having the error pop up as a message, is to customize the variable request-message-level and set the value to -1 - this will stop the error from being shown all the time when the file that is being edited or looked at doesn't contain any warning(s), error(s) or the like.

########################################################################
# simple.cpp
########################################################################
struct Foo {
    int bar;
};

void something(void) {
    Foo foo;
    foo.bar = 5;
}
########################################################################
# REQUEST debug log/messages appearing in *Messages*
########################################################################
REQUEST [debug] REQUEST
REQUEST [debug] Run: curl --silent --include --location --compressed --cookie /home/mband/.emacs.d/request/curl-cookie-jar --cookie-jar /home/mband/.emacs.d/request/curl-cookie-jar --write-out \n(:num-redirects %{num_redirects} :url-effective "%{url_effective}") --data-binary @- --request POST --header Content-Type: application/json --header X-Ycm-Hmac: MTg0ZTA4ZmMzNGZhY2Y4ZGE1ZGFmZDgzMDliYWVkZDhiMTQ4ZjMxYmUwYjJlMDAwNDQwOTUxMWFjZmFiMTMwZA== http://127.0.0.1:59180/event_notification
REQUEST [debug] REQUEST--CURL-CALLBACK event = finished

REQUEST [debug] REQUEST--CURL-CALLBACK proc = #<process request curl>
REQUEST [debug] REQUEST--CURL-CALLBACK buffer = #<buffer  *request curl*>
REQUEST [debug] REQUEST--CURL-CALLBACK symbol-status = nil
REQUEST [debug] REQUEST--CALLBACK
REQUEST [debug] (buffer-string) =
HTTP/1.1 200 OK
Content-Length: 0
Content-Type: text/html; charset=UTF-8
Date: Fri, 31 Oct 2014 10:49:56 GMT
Server: waitress
X-Ycm-Hmac: Mzc5NDc4MzBmOWUxN2Q4N2U4NjlkNjViMDY5MTgzNmI1Y2JmYjM4YWRmZjhhZTRiYjU0YTI4Mjk4MTcwMzdlYQ==


REQUEST [debug] REQUEST-RESPONSE--CANCEL-TIMER
REQUEST [debug] -CLEAN-HEADER
REQUEST [debug] -CUT-HEADER
REQUEST [debug] error-thrown = nil
REQUEST [debug] -PARSE-DATA
REQUEST [debug] parser = json-read
REQUEST [error] Error from parser json-read: (end-of-file)
REQUEST [debug] data = nil
REQUEST [debug] symbol-status = parse-error
REQUEST [debug] Executing error callback.
REQUEST [error] Error (parse-error) while connecting to http://127.0.0.1:59180/event_notification.
REQUEST [debug] Executing complete callback.
########################################################################
# *ycmd-content-log*
########################################################################
HTTP REQUEST CONTENT

"{\"event_name\":\"FileReadyToParse\", \"file_data\":{\"\\/home\\/mband\\/tmp\\/simple.cpp\":{\"contents\":\"struct Foo {\\n    int bar;\\n};\\n\\nvoid something(void) {\\n    Foo foo;\\n    foo.bar = 5;\\n}\\n\", \"filetypes\":[\"cpp\"]}}, \"filepath\":\"\\/home\\/mband\\/tmp\\/simple.cpp\", \"line_num\":1, \"column_num\":1}"
HTTP RESPONSE CONTENT

nil
########################################################################
# *ycmd-server*
########################################################################
2014-10-31 11:49:55,890 - DEBUG - No global extra conf, not calling method YcmCorePreload
serving on http://127.0.0.1:59180
2014-10-31 11:49:56,018 - INFO - Received event notification
2014-10-31 11:49:56,018 - DEBUG - Event name: FileReadyToParse
2014-10-31 11:49:56,018 - INFO - Adding buffer identifiers for file: /home/mband/tmp/simple.cpp

Restart server after it auto-dies

We may have a problem where, if the server auto-dies, we don't restart it when necessary. For example, if you leave a C++ buffer open overnight, the server will die but not be restarted when you start interacting with the buffer again. Investigate this, verify the behavior, and fix it if needed.

Consider a more sophisticated file-ready system

Right now we just send a file-ready notification every N seconds (and on file-visit) whether it's necessary or not. We could have a system that tracks when buffers have been modified, for example, and doesn't send a notification unless there's actually been a change. This could potentially lead to much better performance wrt seeing changes reflected in the code.

REQUEST [error] Error (error) while connecting to http://127.0.0.1:<port>/event_notification

Hi,

I'm using:
Commit cdeabc1 of emacs-ycmd (latest master as of this writing)
Commit 97c19ffe442683cfff8d68a3d343a8b497ea4fd5 of ycmd (latest master as of this writing)
Python 2.7.6 (Ubuntu 14.04)
Emacs 24.3.1 (Ubuntu 14.04)

I ran the ycmd testsuite and it didn't reveal any errors, so I suppose the issue is with emacs-ycmd or my configuration of it (~/.emacs.d/init.el):
(require 'ycmd)
(set-variable 'ycmd-server-command '("python" "/home/mband/ycmd/ycmd"))
Where /home/mband/ycmd is the "git root".

When I open a .cpp file I get the following error shown:
REQUEST [error] Error (error) while connecting to http://127.0.0.1:57953/event_notification.
And the ycmd-server buffer contains:
2014-10-28 13:56:32,896 - DEBUG - No global extra conf, not calling method YcmCorePreload
serving on http://127.0.0.1:57953
2014-10-28 13:56:32,988 - INFO - Received event notification
Traceback (most recent call last):
File "/home/mband/ycmd/third_party/bottle/bottle.py", line 861, in _handle
return route.call(*_args)
File "/home/mband/ycmd/third_party/bottle/bottle.py", line 1734, in wrapper
rv = callback(_a, *_ka)
File "/home/mband/ycmd/ycmd/../ycmd/watchdog_plugin.py", line 100, in wrapper
return callback( *args, *_kwargs )
File "/home/mband/ycmd/ycmd/../ycmd/hmac_plugin.py", line 54, in wrapper
body = callback( _args, *_kwargs )
File "/home/mband/ycmd/ycmd/../ycmd/handlers.py", line 59, in EventNotification
request_data = RequestWrap( request.json )
File "/home/mband/ycmd/ycmd/../ycmd/request_wrap.py", line 27, in init
EnsureRequestValid( request )
File "/home/mband/ycmd/ycmd/../ycmd/request_validation.py", line 28, in EnsureRequestValid
missing = set( x for x in required_fields if x not in request_json )
File "/home/mband/ycmd/ycmd/../ycmd/request_validation.py", line 28, in
missing = set( x for x in required_fields if x not in request_json )
TypeError: argument of type 'NoneType' is not iterable
And one more INFO - Received event notification traceback that I omitted since it contains the same information just with another timestamp.

If you got anything I should test, please let me know as I really want to get this issue solved. To me it sounds like some sort of protocol issue, but given that the last commit on ycmd was 8 days ago, it doesn't appear to be any newly introduced changes...

Add some tests

We've reached a point where some automated regression tests are probably wise. Testing the UI stuff, e.g. company-mode, is probably not feasible (but then, what do I know about emacs testing support.) But that's probably not necessary anyway. We do need to test things like basic completion functionality, parsing, etc.

Handle case where ycm_extra_conf.py is not in whitelist

When an extra-conf is not whitelisted, we should get prompted by ycmd regarding whether we should load the config. Right now we simply ignore that prompting, but we should actually be asking the user if they want to load it.

When compilation takes a long time, commands seem to interfere with each other.

We have a lot of C++ files that take a long time (multiple seconds) to incrementally compile.
In that case, I get non-optimal behavior from emacs-ycmd:
I start writing something, for example:
variable
I start getting error markers (expected). I continue:
variable.
Now the problem is that the re-parsing of the file is still running, so I don't get completions. I have to do backspace, '.' multiple times until I happen to get completions.
Then, when I finish:
variable.something();
The error markers will not go away (it seems like it started the call before I typed ';', and then didn't issues another one when I finally finished writing).

On ycmd error font-locking of current buffer is gone

Sometimes I noticed that when ycmd return with an error suddenly the font-locking of the current buffer is gone. It's not only C++ buffers but also other buffers like ibuffer or magit-status. It seems it happens when ycmd return an event_notification error. The current selected buffer looses syntax highlighting. I don't have a 100% repro, thats why I cannot say what exactly happens.

Maybe you have some idea?

Thanks,
Peter

REQUEST [error] Error (error) while connecting to http://127.0.0.1:54426/event_notification.

When ycmd takes a while to get the compile commands (for our internal build system this can take a minute or so) or compile command are not available for some other reason (this can be easily tested with a .ycm-extra-config that does not produce compile commands) I get the error:
REQUEST [error] Error (error) while connecting to http://127.0.0.1:35282/event_notification
instead of a useful error message.

I'm not sure whether that's related to #23 at all (once I wait a while everything works), or whether it's possible to get better responses from emacs-request.

Improve support for parse feedback display

We currently crudely highlight the entire line for errors and warnings. We might do better to look at the ranges and location-extent that's passed to us. But there are edge cases to consider.
For example, when the error is a missing semicolon, there's essentially no extent to highlight. So we need checking for these kinds of situations, otherwise we end up not highlighting anything.

Clean identifiers from ycmd database as they're deleted

In the vim ycm client, outdated/deleted identifiers are quickly removed from the ycmd database because it ships code for re-parsing when the user exits insert mode. The result is that stale identifiers are not often used for completion. See #22 for more information.

We should consider techniques for doing this in the emacs client.

font-locking disappears transiently during typing

A number of users, notably @noxdafox and @ptrv, have reported that font-lock sometime disappears on parts of their code as they're typing. It disappears for a while and comes back. It's not clear yet what the pattern is.

Much of the original discussion for this issue took place in #42.

Add a README

Explain what the project is and provide a quickstart.

Only for C/C++/ObjC?

First of all, thanks for the effort.

The header says "ycmd provides clang-based completion for C/C++/ObjC". I personally expect ycmd can also provide a fuzzy matching mechanism for identifier and tag based auto-completion in Emacs. YCM is able to do that in vim.

Any chance that Emacs can utilize that?

related discussion: company-mode/company-mode#166

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.