A C/C++ minor mode for Emacs powered by libclang

Overview

Irony-Mode

A C/C++ minor mode powered by libclang

irony-mode is an Emacs minor-mode that aims at improving the editing experience for the C, C++ and Objective-C languages. It works by using a combination of an Emacs package and a C++ program (irony-server) exposing libclang.

Features:

Dependencies

Elisp dependencies

These dependencies will be installed automatically when using the standard installation procedure described below.

Package Comment
cl-lib Built-in since Emacs 24.3
json Built-in since Emacs 23.1
YASnippet Optional. May be used to provide post-completion expansion of function arguments

Irony-Server prerequisites

irony-server provides the libclang interface to irony-mode. It uses a simple protocol based on S-expression. This server, written in C++ and requires the following packages to be installed on your system:

Installation

The recommended way to install irony-mode and its dependencies is to use a package manager.

  • Using MELPA

      M-x package-install RET irony RET
    
  • Using apt on Debian ≥10 and derivatives

      sudo apt install elpa-irony
    

Accessing a newer Clang and LLVM Toolchain on Debian and derivatives

The backports mechanism is the recommended and officially supported method of accessing newer versions than Debian stable provides.

    sudo apt install -t $release_name-backports elpa-irony

If the llvm-toolchain backport is not new enough please use the following repository: LLVM Debian/Ubuntu nightly packages. This repository is maintained by Sylvestre Ledru, who is responsible for the official Debian package. His repository also supports Ubuntu and derivatives. When using this unofficial repository the MELPA package of irony-mode should be used in preference to the elpa-irony package.

Configuration

(add-hook 'c++-mode-hook 'irony-mode)
(add-hook 'c-mode-hook 'irony-mode)
(add-hook 'objc-mode-hook 'irony-mode)

(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)

Windows considerations

irony-mode should work fine on Windows but there are some things to take care of first.

  • libclang.dll is expected to be available in the PATH or in Emacs' exec-path.

  • Emacs >= 24.4 is required. A bug in previous versions makes irony unuseable (Emacs bug #18420).

  • w32-pipe-read-delay default value of 50 should be changed. This should not cause any issue on today's version of Windows. The default value of 50 may be lowered in mainline Emacs in future versions, until then, I suggest to set it to 0.

  • w32-pipe-buffer-size, introduced by Emacs 25, can be set to a larger value than the default to improve irony-server communication performances (c.f. https://github.com/Sarcasm/irony-mode/issues/321). The variable to customize is irony-server-w32-pipe-buffer-size.

Windows configuration tweaks to add to your Emacs configuration:

;; Windows performance tweaks
;;
(when (boundp 'w32-pipe-read-delay)
  (setq w32-pipe-read-delay 0))
;; Set the buffer size to 64K on Windows (from the original 4K)
(when (boundp 'w32-pipe-buffer-size)
  (setq irony-server-w32-pipe-buffer-size (* 64 1024)))

Usage

On the first run, irony-mode will ask you to build and install irony-server. To do so, type M-x irony-install-server RET.

To tune irony-mode, use customize:

M-x customize-group RET irony RET

In order to provide context sensitive and accurate information, irony-mode needs to know about the compiler flags used to parse the current buffer. The best way to achieve this is to use a Compilation Database.

Compilation Database

In order to work correctly, irony-mode needs to know the compile flags. irony-cdb aims to provide as automatic as possible compile flags discovery, with minimal user input.

Please refer to irony-cdb-autosetup-compile-options and irony-cdb-compilation-databases.

Right now irony-cdb supports the following compilation databases:

  • JSON Compilation Database - A JSON formatted file generated by various build tools. The file is named compile_commands.json, it lists the compile options associated to each file in the project.

    • CMake >= 2.8.5 will generate a compilation database in the build directory when issuing the following command cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON <...>.

    • ninja >= 1.2 will generate a JSON Compilation Database when using the compdb tool.

    • Bear generates a JSON Compilation Database file by "monitoring" the build of a project. The typical usage for a make-based project will be bear -- make -B.

  • .clang_complete - A file at the root of your project containing the compilation flags, one per line. This is compatible with the with plugin Rip-Rip/clang_complete. If you want to generate the .clang_complete automatically, take a look at the cc_args.py documentation.

More detailed information on compilation database is available here:

FAQ

It's slow, why?

A bug in old version of Clang (at least '3.1-8') caused the completion to fail on the standard library types. To eliminate this bug an optimisation has been disabled in the parsing of a translation unit. This result in a slower parsing.

This only affect old versions of Clang (< 3.2), it is suggested to update your libclang installation if you want to take advantage of the optimizations.

libclang.so: cannot open shared object file...

Compiling irony-server succeed but you have the following message when you try to run the irony-server executable:

'irony-server: error while loading shared libraries: libclang.so: cannot open shared object file: No such file or directory

When libclang is installed in a non-standard location (one that is missing from the path list of the dynamic loader, see ld.so.conf) you can tell CMake to use the rpath when installing the target irony-server. To enable rpath in CMake use the following command:

cmake -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON <args...>

If you're running OS X, you can also use install_name_tool to explicitly tell irony-server where an appropriate version of libclang.dylib lives. For example, Homebrew (with brew install llvm --with-clang) will install a libclang.dylib library at /usr/local/opt/llvm/lib/libclang.dylib; you can instruct irony-server to use this with something like:

install_name_tool -change @rpath/libclang.dylib /usr/local/opt/llvm/lib/libclang.dylib irony-server
Comments
  • Problem to build version 1.0 in MSVC 2017

    Problem to build version 1.0 in MSVC 2017

    Hi, the following messages appeared when I tried to build Irony version 1.0. In general, I did not have any problem to build irony in visual studio until version 1.0. I am using CMake 3.8.1 in order to be able to target MSVC 2017.

    Thank you for your help.

    1>------ Build started: Project: ZERO_CHECK, Configuration: Release x64 ------
    1>Checking Build System
    1>CMake does not need to re-run because C:/home_levis/.emacs.d/user/site-lisp/irony-1.0/build_msvc2017/CMakeFiles/generate.stamp is up-to-date.
    1>CMake does not need to re-run because C:/home_levis/.emacs.d/user/site-lisp/irony-1.0/build_msvc2017/src/CMakeFiles/generate.stamp is up-to-date.
    1>CMake does not need to re-run because C:/home_levis/.emacs.d/user/site-lisp/irony-1.0/build_msvc2017/docs/CMakeFiles/generate.stamp is up-to-date.
    1>CMake does not need to re-run because C:/home_levis/.emacs.d/user/site-lisp/irony-1.0/build_msvc2017/test/CMakeFiles/generate.stamp is up-to-date.
    1>CMake does not need to re-run because C:/home_levis/.emacs.d/user/site-lisp/irony-1.0/build_msvc2017/test/elisp/CMakeFiles/generate.stamp is up-to-date.
    2>------ Build started: Project: irony-server, Configuration: Release x64 ------
    3>------ Skipped Build: Project: Continuous, Configuration: Release x64 ------
    3>Project not selected to build for this solution configuration 
    4>------ Skipped Build: Project: Experimental, Configuration: Release x64 ------
    4>Project not selected to build for this solution configuration 
    5>------ Skipped Build: Project: Nightly, Configuration: Release x64 ------
    5>Project not selected to build for this solution configuration 
    6>------ Skipped Build: Project: NightlyMemoryCheck, Configuration: Release x64 ------
    6>Project not selected to build for this solution configuration 
    7>------ Skipped Build: Project: RUN_TESTS, Configuration: Release x64 ------
    7>Project not selected to build for this solution configuration 
    8>------ Skipped Build: Project: check, Configuration: Release x64 ------
    8>Project not selected to build for this solution configuration 
    9>------ Skipped Build: Project: doxygen, Configuration: Release x64 ------
    9>Project not selected to build for this solution configuration 
    2>Building Custom Rule C:/home_levis/.emacs.d/user/site-lisp/irony-1.0/server/src/CMakeLists.txt
    2>CMake does not need to re-run because C:/home_levis/.emacs.d/user/site-lisp/irony-1.0/build_msvc2017/src/CMakeFiles/generate.stamp is up-to-date.
    2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.10.25017\bin\HostX86\x64\CL.exe /c /I"C:\Program Files\LLVM-3.9.1\include" /I"C:\home_levis\.emacs.d\user\site-lisp\irony-1.0\server\src" /nologo /W3 /WX- /diagnostics:classic /O2 /Ob2 /D WIN32 /D _WINDOWS /D _HAS_EXCEPTIONS=0 /D NDEBUG /D "CLANG_BUILTIN_HEADERS_DIR=\"C:/Program Files/LLVM-3.9.1/lib/clang/3.9.1/include\"" /D "CMAKE_INTDIR=\"Release\"" /D _MBCS /Gm- /EHsc /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Fo"irony-server.dir\Release\\" /Fd"irony-server.dir\Release\vc141.pdb" /Gd /TP /errorReport:prompt   /EHs-c- "C:\home_levis\.emacs.d\user\site-lisp\irony-1.0\server\src\support\CommandLineParser.cpp" "C:\home_levis\.emacs.d\user\site-lisp\irony-1.0\server\src\support\TemporaryFile.cpp" "C:\home_levis\.emacs.d\user\site-lisp\irony-1.0\server\src\Command.cpp" "C:\home_levis\.emacs.d\user\site-lisp\irony-1.0\server\src\Irony.cpp" "C:\home_levis\.emacs.d\user\site-lisp\irony-1.0\server\src\TUManager.cpp"
    2>cl : Command line warning D9025: overriding '/EHs' with '/EHs-'
    2>cl : Command line warning D9025: overriding '/EHc' with '/EHc-'
    2>CommandLineParser.cpp
    2>TemporaryFile.cpp
    2>C:\home_levis\.emacs.d\user\site-lisp\irony-1.0\server\src\support\TemporaryFile.cpp(22): warning C4996: 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
    2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\ucrt\stdlib.h(1188): note: see declaration of 'getenv'
    2>Command.cpp
    2>C:\home_levis\.emacs.d\user\site-lisp\irony-1.0\server\src\Command.cpp(200): warning C4244: 'initializing': conversion from '__int64' to 'int', possible loss of data
    2>C:\home_levis\.emacs.d\user\site-lisp\irony-1.0\server\src\Command.cpp(200): warning C4244: 'initializing': conversion from '__int64' to 'const int', possible loss of data
    2>Irony.cpp
    2>C:\home_levis\.emacs.d\user\site-lisp\irony-1.0\server\src\Irony.cpp(100): error C2666: 'std::fpos<_Mbstatet>::operator ==': 3 overloads have similar conversions
    2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.10.25017\include\iosfwd(103): note: could be 'bool std::fpos<_Mbstatet>::operator ==(std::streamoff) const'
    2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.10.25017\include\iosfwd(98): note: or       'bool std::fpos<_Mbstatet>::operator ==(const std::fpos<_Mbstatet> &) const'
    2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.10.25017\include\exception(336): note: or       'bool std::operator ==(const std::exception_ptr &,const std::exception_ptr &) throw()' [found using argument-dependent lookup]
    2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.10.25017\include\exception(341): note: or       'bool std::operator ==(std::nullptr_t,const std::exception_ptr &) throw()' [found using argument-dependent lookup]
    2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.10.25017\include\exception(346): note: or       'bool std::operator ==(const std::exception_ptr &,std::nullptr_t) throw()' [found using argument-dependent lookup]
    2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.10.25017\include\system_error(362): note: or       'bool std::operator ==(const std::error_code &,const std::error_code &) throw()' [found using argument-dependent lookup]
    2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.10.25017\include\system_error(370): note: or       'bool std::operator ==(const std::error_code &,const std::error_condition &) throw()' [found using argument-dependent lookup]
    2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.10.25017\include\system_error(378): note: or       'bool std::operator ==(const std::error_condition &,const std::error_code &) throw()' [found using argument-dependent lookup]
    2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.10.25017\include\system_error(386): note: or       'bool std::operator ==(const std::error_condition &,const std::error_condition &) throw()' [found using argument-dependent lookup]
    2>C:\home_levis\.emacs.d\user\site-lisp\irony-1.0\server\src\Irony.cpp(100): note: or       'built-in C++ operator==(std::streamoff, int)'
    2>C:\home_levis\.emacs.d\user\site-lisp\irony-1.0\server\src\Irony.cpp(100): note: while trying to match the argument list '(std::fpos<_Mbstatet>, int)'
    2>C:\home_levis\.emacs.d\user\site-lisp\irony-1.0\server\src\Irony.cpp(271): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data
    2>C:\home_levis\.emacs.d\user\site-lisp\irony-1.0\server\src\Irony.cpp(419): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data
    2>C:\home_levis\.emacs.d\user\site-lisp\irony-1.0\server\src\Irony.cpp(421): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data
    2>C:\home_levis\.emacs.d\user\site-lisp\irony-1.0\server\src\Irony.cpp(432): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
    2>C:\home_levis\.emacs.d\user\site-lisp\irony-1.0\server\src\Irony.cpp(468): warning C4267: '=': conversion from 'size_t' to 'unsigned long', possible loss of data
    2>TUManager.cpp
    2>C:\home_levis\.emacs.d\user\site-lisp\irony-1.0\server\src\TUManager.cpp(115): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data
    2>C:\home_levis\.emacs.d\user\site-lisp\irony-1.0\server\src\TUManager.cpp(139): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data
    2>Generating Code...
    2>Done building project "irony-server.vcxproj" -- FAILED.
    10>------ Build started: Project: ALL_BUILD, Configuration: Release x64 ------
    10>Building Custom Rule C:/home_levis/.emacs.d/user/site-lisp/irony-1.0/server/CMakeLists.txt
    10>CMake does not need to re-run because C:/home_levis/.emacs.d/user/site-lisp/irony-1.0/build_msvc2017/CMakeFiles/generate.stamp is up-to-date.
    11>------ Skipped Build: Project: INSTALL, Configuration: Release x64 ------
    11>Project not selected to build for this solution configuration 
    ========== Build: 2 succeeded, 1 failed, 0 up-to-date, 8 skipped ==========
    
    opened by mambolevis 31
  • Irony-install server failure

    Irony-install server failure

     1-*- mode: compilation; default-directory: "~/.emacs.d/irony/build/" -*-
     2Compilation started at Wed Nov 12 11:46:21
     3
     4cmake -DCMAKE_INSTALL_PREFIX\=/Users/Chester/.emacs.d/irony/ /Users/Chester/.emacs.d/elpa/irony-20141030.1555/server && cmake --build . --use-stderr --config Release --target i\
      nstall
     5-- Detecting libclang builtin headers directory
     6-- Detecting libclang builtin headers directory -- fail
     7CMake Warning at cmake/CheckLibClangBuiltinHeadersDir.cmake:87 (message):
     8  CheckLibClangBuiltinHeadersDir: unsupported configuration, please report.
     9
    10
    11
    12    Check with args: -isystem;"/usr/local/Cellar/llvm/3.5.0/lib/clang/3.5.0/include";/Users/Chester/.emacs.d/irony/build/CMakeFiles/CMakeTmp/check-libclang-stddef.cpp
    13    Check output:
    14      dyld: Library not loaded: @rpath/libLLVM-3.5.dylib
    15    Referenced from: /usr/local/opt/llvm/lib/libclang.dylib
    16    Reason: image not found
    17
    18  SIGTRAP
    19
    20Call Stack (most recent call first):
    21  src/CMakeLists.txt:8 (check_libclang_builtin_headers_dir)
    22
    23
    24-- Irony package version is '0.1.2'
    25-- Found emacs: /Applications/emacs.app/Contents/MacOS/Emacs
    26-- Configuring done
    27-- Generating done
    28-- Build files have been written to: /Users/Chester/.emacs.d/irony/build
    29[100%] Built target irony-server
    30Install the project...
    31-- Install configuration: "Release"
    32-- Up-to-date: /Users/Chester/.emacs.d/irony/bin/irony-server
    33
    34Compilation finished at Wed Nov 12 11:46:21
    

    Here is the error messages i have when I tried to irony-in stall-server. I am currently using Mac OS v10.9.5, with cmake version 3.0.0 and LLVM built from brew.

    Thanks Chester

    opened by chester755 31
  • Semantic integration

    Semantic integration

    Hello.

    In addition to auto-completion features, libclang supports source code indexing and AST traversing. Emacs has its own C++ parser (in semantic) that works quite slow and is not perfect (e.g., 'jump to definition' is very slow not always accurate for me).

    And since both semantic and irony-mode are extensible, it's possible to write irony-mode plugin that will provide (hopefully) fast and reliable C++ back-end for semantic.

    So is there already some work in progress? If not, I'm going to start working on it. Would you like such plugin to be in main irony-mode repository?

    For now I have proof-of-concept standalone program that parses C++ code using libclang and prints elisp expression that is similar to (semantic-parse-region) output (but it is yet incomplete).

    proof-of-concept program example input example output

    feature 
    opened by ghost 26
  • Could NOT find LibClang (missing: LIBCLANG_LIBRARY LIBCLANG_INCLUDE_DIR)

    Could NOT find LibClang (missing: LIBCLANG_LIBRARY LIBCLANG_INCLUDE_DIR)

    I am attempting to build the irony server. The command fails outright within Emacs and attempting to build manually from the command line, I receive the following error message:

    -- C++11 compiler option(s): -std=c++11 CMake Error at /usr/local/Cellar/cmake/3.1.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:138 (message): Could NOT find LibClang (missing: LIBCLANG_LIBRARY LIBCLANG_INCLUDE_DIR) Call Stack (most recent call first): /usr/local/Cellar/cmake/3.1.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:374 (_FPHSA_FAILURE_MESSAGE) cmake/modules/FindLibClang.cmake:78 (find_package_handle_standard_args) src/CMakeLists.txt:3 (find_package)

    I have XCode6 installed in addition to clang through brew. The missing library libclang.dylib appears at /usr/local/opt/llvm/lib as installed by brew, additionally within /Applications through XCode. Clearly the cmake is simply not recognizing the installation. Can anybody provide any advice?

    opened by stephenry 22
  • Trouble setting up irony mode with company and json compilation database

    Trouble setting up irony mode with company and json compilation database

    Hello,

    First of all I would like to thank you for making irony-mode. It seems like a really nice package that greatly enhances the C/C++ editing experience.

    I am an rtags user, but wanted to combine it with irony mode so as to get nice completions. Thus I tried to use company mode and company-irony. I obtained the packages from el-get. My setup is as follows:

    init-irony-mode.el:

    (add-hook 'c++-mode-hook 'irony-mode)
    (add-hook 'c-mode-hook 'irony-mode)
    (add-hook 'objc-mode-hook 'irony-mode)
    
    ;; replace the `completion-at-point' and `complete-symbol' bindings in
    ;; irony-mode's buffers by irony-mode's function
    (defun my-irony-mode-hook ()
      (define-key irony-mode-map [remap completion-at-point]
        'irony-completion-at-point-async)
      (define-key irony-mode-map [remap complete-symbol]
        'irony-completion-at-point-async))
    (add-hook 'irony-mode-hook 'my-irony-mode-hook)
    (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)
    

    init-company-irony.el

    (eval-after-load 'company
      '(add-to-list 'company-backends 'company-irony))
    
    ;; (optional) adds CC special commands to `company-begin-commands' in order to
    ;; trigger completion at interesting places, such as after scope operator
    ;;     std::|
    (add-hook 'irony-mode-hook 'company-irony-setup-begin-commands)
    

    Nothing fancy. Just what the wikis say. I also got (add-hook 'after-init-hook 'global-company-mode) somewhere so that I activate company mode.

    I am using json compilation databases for all of my projects. I use a package that I have created to act as a glue between other emacs packages and create the json compilation database. I know that the database is valid since rtags server gets it as input and correctly navigates the projects.

    So I have this json compilation named compile_commands.json in the root of the project. I suspect that irony mode actually reads it since I see something that looks like the whole project's compile flags, include directories and files when I execute irony-cdb-menu.

    But the problem is that whenever I try to use any autocomplete or anything at all, all I get is an error message:

    error in process filter: irony-completion-at-point: Wrong type argument: sequencep, libclang:

    I also tried to describe the current company backend variable and it seems to be nil. This is funny because company-backends list has company-irony as the first one in the list. I tried to insert company-irony as the only element of company-backends but I got the same result.

    While debugging I tried to remove (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options) from the setup. Then completion popup actually appeared but it was totally random. Seemed to have no proper source. Could the issue be with the way that irony autodetects the compilation database?

    Do you have any idea what may be happening? IF you need any more information about my setup I will gladly provide.

    opened by LefterisJP 21
  • irony-mode  in Windows OS

    irony-mode in Windows OS

    I'm interested to use irony-mode in Windows, do you have a more detailed tutorial? please. Thank you.

    I try with MinWG and the Guide Wiki

    But I get message..

    "Standard library doesn't support C++11!"
    

    Thank You So Much.

    opened by juvasquezg 20
  • Useful additions to irony-cdb-json

    Useful additions to irony-cdb-json

    closes #234, #236 maybe some issues linked there as well.

    First, now looks recursively for parents for both ".json" and "build/.json". (#234)

    Second, #236. One confusing bit is that calling irony-cdb-json-add-compile-commands-path doesn't actually finish by loading the database you added. That might be "Cleaner", but its inconvenient and under-documented. Commit 2 fixes that.

    Third, still #236, I was led astray by add-compile-commands-path asking for both project root and cdb path and ended up choosing the build directory, then the file within it. I may not have been paying enough attention, but the issues suggest I may not be the only one. So, commit 3 adds an alternative which takes only a cdb path, loads it, and uses the source file paths in it to find the project root as the deepest dir parenting everything in the cdb. I would have just replaced add-compile-commands-path entirely, but that's public and the new function takes one argument less. If you like the idea and don't mind breaking the API, go for it.

    Please review/test, I only wrote it, I haven't actually tested it (much) :)

    If you merge 1m my problem is basically solved. 2 I think is reasonable. 3 was just frustration.

    opened by ghost 19
  • irony-server is broken status 127

    irony-server is broken status 127

    I want to test irony. But I have the following error:

    irony-server is broken, good luck buddy! /home/username/.emacs.d/irony/bin/irony-server exited with status 127
    

    Any ideas?

    opened by silgon 19
  • Emacs doesn't find irony installed via apt

    Emacs doesn't find irony installed via apt

    Hello everyone.

    So, I've successfully installed irony via apt (sudo apt install elpa-irony) but Emacs doesn't seem to be able to find it, since I keep getting the message "Irony server isn't installed" whenever I open a C++ file. This kept happening even after a system reboot.

    What am I missing here?

    Thanks in advance!

    opened by ducbueno 17
  • [Error]: error in process filter: Symbol's function definition is void: yas/current-snippet-table

    [Error]: error in process filter: Symbol's function definition is void: yas/current-snippet-table

    When coding something like std::, it will popup the candidates. But everytime it shows this error:

    error in process filter: Symbol's function definition is void: yas/current-snippet-table
    

    But it also works except that it's too slow.

    bug 
    opened by itlodge 17
  • irony server installation

    irony server installation

    0

    Irony install server yeilds this error every time i try an installation. Clang requirements are all installed. Can i be helped about what I'm missing here.

    Can someone please help me out. -- mode: compilation; default-directory: "/tmp/build-irony-server-1.3.1/" -- Compilation started at Sat Jul 6 08:23:45

    cmake -DCMAKE_INSTALL_PREFIX=/home/aviik/.emacs.d/irony/ /home/aviik/.emacs.d/elpa/irony-20190703.1732/server && cmake --build . --use-stderr --config Release --target install -- The C compiler identification is GNU 6.3.0 -- The CXX compiler identification is GNU 6.3.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done CMake Error at /usr/lib/llvm-9/lib/cmake/clang/ClangTargets.cmake:581 (message): The imported target "clang_shared" references the file "/usr/lib/llvm-9/lib/libclang_shared.so.9" but this file does not exist. Possible reasons include:

    • The file was deleted, renamed, or moved to another location.

    • An install or uninstall procedure did not complete successfully.

    • The installation package was faulty and contained

    "/usr/lib/llvm-9/lib/cmake/clang/ClangTargets.cmake"

    but not all the files it references. Call Stack (most recent call first): /usr/lib/cmake/clang-9/ClangConfig.cmake:19 (include) src/CMakeLists.txt:4 (find_package)

    -- Configuring incomplete, errors occurred! See also "/tmp/build-irony-server-1.3.1/CMakeFiles/CMakeOutput.log".

    CMakeOutput.log

    opened by kilokon 16
  • Precompiled binary on Github

    Precompiled binary on Github

    OSX now has a default installation of libclang under /Library/Developer/CommandLineTools/usr/lib and it will be really useful if there were precompiled binaries available from your repo that linked to this version of libclang. Currently, one has to install the humongous llvm package from homebrew just to get the header files to build it locally. In fact, a statically linked irony-mode that had no explicit dependency on libclang would be even better.

    opened by sumanthakur1976 1
  • Irony server with msys2 not working?

    Irony server with msys2 not working?

    I was trying to run: cmake -G "MSYS Makefiles" .. To get the irony server, but it doesn't even get past msys2 gcc compiler validation... Am I missing something here? I am only using msys2 tools

    image

    opened by Alf0nso 0
  • Irony-mode was not enable by default in my c++mode

    Irony-mode was not enable by default in my c++mode

    I have the following in my .emacs.d/init.el file, I would expect it will enable the Irony mode when I open my C++ file, but it's not. As a workaround for now, I have to explicitly type "M-x irony-mode" to enable it.

    ; == irony-mode == (use-package irony :ensure t :defer t :init (add-hook 'c++-mode-hook 'irony-mode) (add-hook 'c-mode-hook 'irony-mode) (add-hook 'objc-mode-hook 'irony-mode) :config ;; replace the completion-at-point' andcomplete-symbol' bindings in ;; irony-mode's buffers by irony-mode's function (defun my-irony-mode-hook () (define-key irony-mode-map [remap completion-at-point] 'irony-completion-at-point-async) (define-key irony-mode-map [remap complete-symbol] 'irony-completion-at-point-async)) (add-hook 'irony-mode-hook 'my-irony-mode-hook) (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options) ;; (add-hook 'irony-mode-hook 'irony-eldoc) )

    I also try to add these as suggested--> (add-hook 'c++-mode-hook 'irony-mode) (add-hook 'c-mode-hook 'irony-mode) (add-hook 'objc-mode-hook 'irony-mode) (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)

    but it's not helping though. Any help?

    opened by algogavin 0
  • M-x irony-install-server fails

    M-x irony-install-server fails

    Attempting to install the irony server through M-x irony-install-server returns the following:

    -*- mode: compilation; default-directory: "/var/folders/zq/7w9sl6hd41q3zczmbsym_fx00000gp/T/build-irony-server-1.4.0/" -*-
    Compilation started at Fri Nov 13 16:59:32
    
    cmake -DCMAKE_INSTALL_PREFIX\=/Users/gavinhughes/.emacs.d/.local/etc/irony-server/  /Users/gavinhughes/.emacs.d/.local/straight/build-27.0.50/irony/server && cmake --build . --use-stderr --config Release --target install
    CMake Warning at src/CMakeLists.txt:4 (find_package):
      By not providing "FindClang.cmake" in CMAKE_MODULE_PATH this project has
      asked CMake to find a package configuration file provided by "Clang", but
      CMake did not find one.
    
      Could not find a package configuration file provided by "Clang" with any of
      the following names:
    
        ClangConfig.cmake
        clang-config.cmake
    
      Add the installation prefix of "Clang" to CMAKE_PREFIX_PATH or set
      "Clang_DIR" to a directory containing one of the above files.  If "Clang"
      provides a separate development package or SDK, be sure it has been
      installed.
    
    
    CMake Error at /usr/local/Cellar/cmake/3.17.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:164 (message):
      Could NOT find LibClang (missing: LIBCLANG_LIBRARY LIBCLANG_INCLUDE_DIR)
    Call Stack (most recent call first):
      /usr/local/Cellar/cmake/3.17.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:445 (_FPHSA_FAILURE_MESSAGE)
      cmake/modules/FindLibClang.cmake:94 (find_package_handle_standard_args)
      src/CMakeLists.txt:28 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    See also "/private/var/folders/zq/7w9sl6hd41q3zczmbsym_fx00000gp/T/build-irony-server-1.4.0/CMakeFiles/CMakeOutput.log".
    See also "/private/var/folders/zq/7w9sl6hd41q3zczmbsym_fx00000gp/T/build-irony-server-1.4.0/CMakeFiles/CMakeError.log".
    
    Compilation exited abnormally with code 1 at Fri Nov 13 16:59:33
    

    Searched for the following files but none are present on my system:

    FindClang.cmake
    ClangConfig.cmake
    clang-config.cmake
    
    opened by gavinhughes 4
  • Irony auto-complete for structure with macro inside

    Irony auto-complete for structure with macro inside

    The definition of struct sigaction is

    struct sigaction
      {
        /* Signal handler.  */
    #ifdef __USE_POSIX199309
        union
          {
    	/* Used if SA_SIGINFO is not set.  */
    	__sighandler_t sa_handler;
    	/* Used if SA_SIGINFO is set.  */
    	void (*sa_sigaction) (int, siginfo_t *, void *);
          }
        __sigaction_handler;
    # define sa_handler	__sigaction_handler.sa_handler
    # define sa_sigaction	__sigaction_handler.sa_sigaction
    #else
        __sighandler_t sa_handler;
    #endif
    
        /* Additional set of signals to be blocked.  */
        __sigset_t sa_mask;
    
        /* Special flags.  */
        int sa_flags;
    
        /* Restore handler.  */
        void (*sa_restorer) (void);
      };
    

    Without special requirement or using obsolescent compiler, the compiler usually chooses the #else so that sa_handler is one of members.

    But irony doesn't show any candidates for sa_handler, my irony gives image

    There are duplicated items for the same candidate. That's because I'm using both irony and rtags. Both of them don't show sa_handler. But since they use clang as backend. I suspect it is a problem of clang, isn't it? There is another possible reason that I can come up with, that is there may be an option about compiler definition which should be given to irony but omitted.

    Can anyone help? Thank ahead.

    opened by wanghaiqiangk 0
Releases(v1.5.0)
  • v1.4.0(Oct 9, 2019)

    In this release:

    • cache compilation database [GH-499]
    • add support for new libclang versions, which should now support newer versions automatically
    • CMake modernization, require CMake >= 3
    • improved compile options adjustement [GH-542]
    Source code(tar.gz)
    Source code(zip)
  • v1.3.1(Dec 11, 2018)

  • v1.3.0(Dec 11, 2018)

    In this release:

    • add support for new libclang versions
    • add opt-in option to remove duplicates in completion menu [GH-503]
    • minor bug fixes and improvements
    Source code(tar.gz)
    Source code(zip)
  • v1.2.0(Oct 19, 2017)

  • v1.1.0(Sep 5, 2017)

    In this release:

    • server side completion filtering: this is a performance improvement for big list of candidates
    • completion styles: exact, case-insensitive, smart-case
    • cdb-json: add support for 'arguments' field, see https://clang.llvm.org/docs/JSONCompilationDatabase.html
    • support post-completion insertion in `irony-completion-at-point'

    Many thanks to all the contributors, especially @kangjianbin for the completion performance improvements.

    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(May 15, 2017)

    In this release, refactoring, small bug fixes and minor improvements.

    The most noticeable change is internal and also some API breakage, however functionally speaking everything should stay similar.

    What changed:

    • new internal API to make it easier to add new commands or new variants of commands
    • speed up big query results (e.g. when there are many completion candidates)
    • improve error reporting
    • tasks can be run synchronously or asynchronously
    • support for more than one unsaved buffers
    • support new libclang versions
    • travis-ci now runs clang-tidy on irony-server source files
    • completion candidates can be filtered base on availability

    API break on completion impacted at least the following project, which also needs to be updated:

    • company-irony
    • irony-eldoc
    • counsel-irony

    Known broken APIs are:

    • irony-completion-candidates-async: the async callback now takes the candidates as parameter

    • irony-completion-at-point-async disappeared, it should be removed from irony-mode configuration:

      ;; remove this
      (define-key irony-mode-map [remap completion-at-point] 'irony-completion-at-point-async)
      

      The function is no longer needed because irony-completion-at-point now works like one would expect, it request the completion synchronously. If asynchronous completion is needed, it should be written manually, but this no longer releated to completion-at-point.

    Source code(tar.gz)
    Source code(zip)
  • v0.2.1(Nov 2, 2016)

  • v0.2.0(Mar 17, 2016)

  • v0.1.2(Oct 30, 2014)

  • v0.1.1(Sep 9, 2014)

    This release contains bug fix and performance improvements, important changes are:

    • Improve completion performances
    • Build fixes for irony-server on Mac OS X
    • Update FindLibClang.cmake to support new release of Clang
    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Jun 30, 2014)

  • v0.0.1-alpha(Jun 5, 2014)

    This is a snapshot of what used to be develop branch of irony-mode. In the next release almost everything has been rewritten. This release is just to keep a trace of this "unfinished" version.

    Source code(tar.gz)
    Source code(zip)
Owner
Guillaume Papin
Guillaume Papin
C++ font-lock for Emacs

Syntax highlighting support for "Modern C++" - until C++20 and Technical Specification. This package aims to provide a simple highlight of the C++ lan

Ludwig PACIFICI 168 Jul 13, 2022
MINCE is an Emacs-like text editor from Mark of the Unicorn, Inc.

MINCE Is Not Complete[ly] EMACS Overview MINCE is an Emacs-like text editor from Mark of the Unicorn, Inc. Versions were available for many oper

Jeffrey H. Johnson 20 Jul 18, 2022
tree-sitter grammar for emacs lisp

Tree-sitter Grammar for Emacs Lisp A simple tree-sitter grammar for elisp. Syntax supported: Atoms (integers, floats, strings, characters, symbols) Li

Wilfred Hughes 21 Sep 12, 2022
te is a small text editor with emacs keybindings.

te - a tiny emacs te is a small text editor with emacs keybindings. Here are söme Ümlautß! Oh no. Come, you spirits That tend on mortal thoughts, unse

Leah Neukirchen 21 Jun 8, 2022
If the button pressed esp will reset and App mode will on. App mode will on then led will on, network is connected led will off.

DHT22-to-Google-sheet-Reset-Using-ESP8266-LED-Switch If button pressed esp will reset and App mode will on. App mode will on then led will on, network

Md. Harun-Or-Rashid 3 Aug 17, 2022
And ESP32 powered VU matrix using the INMP441 I2S microphone

ESP32-INMP441-Matrix-VU This is the repository for a 3D-printed, (optionally) battery-powered, WS2812B LED matrix that produces pretty patterns using

null 48 Aug 24, 2022
A guide and set of tools for working with TinyML powered Audio Sensors

Audio Sensor Toolkit This is a guide on how to build an Audio Sensor using Machine Learning, and helpful tools. Audio Sensor Guide Audio Tools Acceler

IQT Labs 20 Sep 21, 2022
Remote control for your QMK-powered keyboard

QMK RC QMK RC is a project that aims to bring the same convenience to controlling your QMK keyboard from your computer, as QMK did to programming keyb

Maciej Małecki 46 Sep 22, 2022
WIP: ESP32 powered robot dog, quadruped robot. This is just code, hardware in the other repositories

Small Robot dog (quadruped) Hardware ESP32 IMU (not implemented) 12 servos TowerPro mg90d (hope it will work) Two 18650 Software Arduino IDE compatibl

Gleb Devyatkin 68 Sep 23, 2022
This is the repo for the microcontroller part of project Cleanurge - a scalable IoT powered waste management system, our solution towards a greener world.

Cleanurge A scalable waste management system powered by IoT. There are 3 repositories for the entire cleanurge system in total cleanurge-mcu: Containi

Developer Student Clubs KGEC 6 Oct 11, 2021
split89 keyboard - a 3d printed 89 key split TKL keyboard base powered by ATmega32U4 Pro Micro controllers with QMK Configurator support.

split89 keyboard - a 3d printed 89 key split TKL keyboard base powered by ATmega32U4 Pro Micro controllers with QMK Configurator support. This keyboar

null 43 Aug 7, 2022
Zerobug is a 3D-printed micro-servo hexapod robot powered by a Raspberry Pi Zero and a STM32F103

ZeroBug - DIY Hexapod Robot Zerobug is a 3D-printed micro-servo hexapod robot powered by a Raspberry Pi Zero and a STM32F103. The Pi Zero is in charge

Max K 152 Sep 24, 2022
An open source Zstack3 gateway powered by ESP8266 and CC2652 modules

OpenZ3Gateway An open source Zstack3 gateway powered by ESP8266 and CC2652P modules. One costs less than 60 CNY in China. This repository includes Alt

Chen Yijun 36 Sep 25, 2022
Raspberry Pico powered Xilinx Virtual Cable - Xilinx JTAG Cable!

This project implements a Raspberry Pico based Xilinx Virtual Cable (XVC). It allows using Raspberry Pico as a JTAG adapter for programming Xilinx FPGAs.

Dhiru Kholia 149 Sep 29, 2022
Ring powered by an adafruit gemma + neopixel that sends a positive affirmation message to me via morse code

Positive Affirmation Morse Code Ring ✨ Ring powered by an adafruit gemma + neopixel that sends a positive affirmation message to me via slowed-down mo

Stephanie 3 Dec 31, 2021
A C library for RP2040-powered boards to control LCDs via the I2C protocol

picoi2clcd A C library to control I2C LCD displays using the Rapsberry Pi Pico (or really any board using the RP2040 microcontroller). License All of

Kosmas Raptis 2 Oct 16, 2021
Portable, Noto-powered font-rendering abstraction based on FreeType and Raqm

Mechascribe Mechascribe is still under construction and nothing is functional yet. Mechascribe is a text rendering abstraction trying to support as mu

null 4 Jan 27, 2022
Game about the Babylon tower, powered by olcPixelGameEngine.

Team VAVYLØN Game about the Babylon tower, powered by olcPixelGameEngine. ?? About Our project is a highly engaging, story-based, rogue-like, skill-ba

Atanas Pozharliev 14 Aug 19, 2022
A USB timer powered by Digispark ATtiny85 according to pomodoro time management technique

⏲ ES Timer Powered ⚡ by Digispark ATtiny85 and it works based on ?? pomodoro time management technique a special timer for all those that work a lot w

null 46 Sep 18, 2022