From e6cb81a0b22f852a8d9eda29430931cb29b15392 Mon Sep 17 00:00:00 2001 From: Ricky Nelson Date: Mon, 8 Jul 2013 13:56:51 +0000 Subject: [PATCH 1/9] fixed build problem with threads on SmartOS --- cpp/BoostParts/CMakeLists.txt | 5 +++++ cpp/CMakeLists.txt | 4 ++++ cpp/ycm/CMakeLists.txt | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/cpp/BoostParts/CMakeLists.txt b/cpp/BoostParts/CMakeLists.txt index 14e37a4e..6b0d3675 100644 --- a/cpp/BoostParts/CMakeLists.txt +++ b/cpp/BoostParts/CMakeLists.txt @@ -118,3 +118,8 @@ if( MSVC ) set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi /GL" ) set_target_properties( ${PROJECT_NAME} PROPERTIES STATIC_LIBRARY_FLAGS "/LTCG" ) endif() + +if( SYSTEM_IS_SUNOS ) + # SunOS needs this setting for thread support + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthreads" ) +endif() diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 7afe590b..fecda10b 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -28,6 +28,10 @@ if ( ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" ) set( SYSTEM_IS_FREEBSD true ) endif() +if ( ${CMAKE_SYSTEM_NAME} MATCHES "SunOS" ) + set( SYSTEM_IS_SUNOS true ) +endif() + # Check if platform is 64 bit if( CMAKE_SIZEOF_VOID_P EQUAL 4 ) set( 64_BIT_PLATFORM 0 ) diff --git a/cpp/ycm/CMakeLists.txt b/cpp/ycm/CMakeLists.txt index 52e7afd6..44ea8717 100644 --- a/cpp/ycm/CMakeLists.txt +++ b/cpp/ycm/CMakeLists.txt @@ -313,4 +313,9 @@ endif() ############################################################################# +if( SYSTEM_IS_SUNOS ) + # SunOS needs this setting for thread support + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthreads" ) +endif() + add_subdirectory( tests ) From ac5b5bfdbe2cafff4da054327ff67672e6f7def9 Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Mon, 8 Jul 2013 10:31:17 -0700 Subject: [PATCH 2/9] Typo fix in docs --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 65767a6f..c0005375 100644 --- a/README.md +++ b/README.md @@ -1244,7 +1244,7 @@ current file and simple prefix-based fitering. ### Why does YCM demand such a recent version of Vim? -During YCM's development several show-stopper bugs where encountered in Vim. +During YCM's development several show-stopper bugs were encountered in Vim. Those needed to be fixed upstream (and were). A few months after those bugs were fixed, Vim trunk landed the `pyeval()` function which improved YCM performance even more since less time was spent serializing and deserializing data between From c89ef89cfe8864a45ae3c2548a279d4cb10a5fdf Mon Sep 17 00:00:00 2001 From: Manpreet Singh Date: Mon, 8 Jul 2013 12:19:49 -0700 Subject: [PATCH 3/9] Allow easier system libclang use --- install.sh | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/install.sh b/install.sh index 93ebc758..4506842a 100755 --- a/install.sh +++ b/install.sh @@ -102,26 +102,32 @@ function linux_cmake_install { } function usage { - echo "Usage: $0 [--clang-completer]" + echo "Usage: $0 [--clang-completer [--system-libclang]]" exit 0 } -if [[ $# -gt 1 ]]; then +cmake_args='' +while [ -n "$1" ]; do + case "$1" in + --clang-completer) + cmake_args="$cmake_args -DUSE_CLANG_COMPLETER=ON" + shift + ;; + --system-libclang) + cmake_args="$cmake_args -DUSE_SYSTEM_LIBCLANG=ON" + shift + ;; + *) + usage + ;; + esac +done + +if [[ $cmake_args == *-DUSE_SYSTEM_LIBCLANG=ON* ]] && \ + [[ $cmake_args != *-DUSE_CLANG_COMPLETER=ON* ]]; then usage fi -case "$1" in - --clang-completer) - cmake_args='-DUSE_CLANG_COMPLETER=ON' - ;; - '') - cmake_args='' - ;; - *) - usage - ;; -esac - if ! command_exists cmake; then echo "CMake is required to build YouCompleteMe." cmake_install From a011eb6aa02783f6b393c26630365e4de8add6de Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Mon, 8 Jul 2013 15:56:54 -0700 Subject: [PATCH 4/9] Fix duplicate entries in filename completion We could just remove the "dup: 1" part in the completion dict, but that would leave the duplicate removal up to Vim which would be slow. Also, we might not end up returning the correct number of results then. --- .../completers/general/filename_completer.py | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/python/ycm/completers/general/filename_completer.py b/python/ycm/completers/general/filename_completer.py index 42ad6711..559968a1 100644 --- a/python/ycm/completers/general/filename_completer.py +++ b/python/ycm/completers/general/filename_completer.py @@ -125,10 +125,18 @@ def GetPathsStandardCase( path_dir ): def GenerateCandidatesForPaths( absolute_paths ): - def GenerateCandidateForPath( absolute_path ): - is_dir = os.path.isdir( absolute_path ) - return { 'word': os.path.basename( absolute_path ), - 'dup': 1, - 'menu': '[Dir]' if is_dir else '[File]' } + seen_basenames = set() + completion_dicts = [] - return [ GenerateCandidateForPath( path ) for path in absolute_paths ] + for absolute_path in absolute_paths: + basename = os.path.basename( absolute_path ) + if basename in seen_basenames: + continue + seen_basenames.add( basename ) + + is_dir = os.path.isdir( absolute_path ) + completion_dicts.append( { 'word': basename, + 'dup': 1, + 'menu': '[Dir]' if is_dir else '[File]' } ) + + return completion_dicts From ddd0287436d0ecb2cd67ed6f5b8a97a2d92dafda Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Mon, 8 Jul 2013 16:00:06 -0700 Subject: [PATCH 5/9] Code style fixes --- python/ycm/completers/general/filename_completer.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/ycm/completers/general/filename_completer.py b/python/ycm/completers/general/filename_completer.py index 559968a1..8dd1f181 100644 --- a/python/ycm/completers/general/filename_completer.py +++ b/python/ycm/completers/general/filename_completer.py @@ -82,13 +82,13 @@ class FilenameCompleter( ThreadedCompleter ): # We do what GCC does for <> versus "": # http://gcc.gnu.org/onlinedocs/cpp/Include-Syntax.html include_current_file_dir = '<' not in include_match.group() - return GenerateCandidatesForPaths( + return _GenerateCandidatesForPaths( self.GetPathsIncludeCase( path_dir, include_current_file_dir ) ) path_match = self._path_regex.search( line ) path_dir = os.path.expanduser( path_match.group() ) if path_match else '' - return GenerateCandidatesForPaths( GetPathsStandardCase( path_dir ) ) + return _GenerateCandidatesForPaths( _GetPathsStandardCase( path_dir ) ) def GetPathsIncludeCase( self, path_dir, include_current_file_dir ): @@ -110,7 +110,7 @@ class FilenameCompleter( ThreadedCompleter ): return sorted( set( paths ) ) -def GetPathsStandardCase( path_dir ): +def _GetPathsStandardCase( path_dir ): if not USE_WORKING_DIR and not path_dir.startswith( '/' ): path_dir = os.path.join( os.path.dirname( vim.current.buffer.name ), path_dir ) @@ -124,7 +124,7 @@ def GetPathsStandardCase( path_dir ): for relative_path in relative_paths ) -def GenerateCandidatesForPaths( absolute_paths ): +def _GenerateCandidatesForPaths( absolute_paths ): seen_basenames = set() completion_dicts = [] From 398d06ab80ea11e065c64d46037e9333226c26e9 Mon Sep 17 00:00:00 2001 From: Aldric Giacomoni Date: Wed, 10 Jul 2013 15:45:19 -0400 Subject: [PATCH 6/9] Update README.md Small tweaks to the README to make extended installation steps more obvious. It's not perfect yet, but it's a start. --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c0005375..cd526bd1 100644 --- a/README.md +++ b/README.md @@ -240,16 +240,22 @@ notify you to recompile it. You should then rerun the install process. Now we need to generate the makefiles. If you DON'T care about semantic support for C-family languages, run the following command in the `ycm_build` - directory: `cmake -G "Unix Makefiles" . ~/.vim/bundle/YouCompleteMe/cpp` + directory: + + cmake -G "Unix Makefiles" . ~/.vim/bundle/YouCompleteMe/cpp If you DO care about semantic support for C-family languages, then your `cmake` call will be a bit more complicated. We'll assume you downloaded a binary distribution of LLVM+Clang from llvm.org in step 3 and that you extracted the archive file to folder `~/ycm_temp/llvm_root_dir` (with `bin`, `lib`, `include` etc. folders right inside that folder). With that in mind, - run the following command in the `ycm_build` directory: `cmake -G "Unix Makefiles" -DPATH_TO_LLVM_ROOT=~/ycm_temp/llvm_root_dir . ~/.vim/bundle/YouCompleteMe/cpp` + run the following command in the `ycm_build` directory: + + cmake -G "Unix Makefiles" -DPATH_TO_LLVM_ROOT=~/ycm_temp/llvm_root_dir . ~/.vim/bundle/YouCompleteMe/cpp - Now that makefiles have been generated, simply run `make ycm_core`. + Now that makefiles have been generated, simply run: + + make ycm_core For those who want to use the system version of libclang, you would pass `-DUSE_SYSTEM_LIBCLANG=ON` to cmake _instead of_ the From 5c017bcabf2ec8114cbf8f45b3d20d570013bd27 Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Fri, 12 Jul 2013 10:23:01 -0700 Subject: [PATCH 7/9] Better check for min supported Vim version --- plugin/youcompleteme.vim | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/plugin/youcompleteme.vim b/plugin/youcompleteme.vim index 940ca304..34f2d44a 100644 --- a/plugin/youcompleteme.vim +++ b/plugin/youcompleteme.vim @@ -21,13 +21,11 @@ set cpo&vim if exists( "g:loaded_youcompleteme" ) finish -elseif v:version < 704 - if v:version < 703 || !has( 'patch584' ) - echohl WarningMsg | - \ echomsg "YouCompleteMe unavailable: requires Vim 7.3.584+" | - \ echohl None - finish - endif +elseif v:version < 703 || (v:version == 703 && !has('patch584')) + echohl WarningMsg | + \ echomsg "YouCompleteMe unavailable: requires Vim 7.3.584+" | + \ echohl None + finish elseif !has( 'python' ) echohl WarningMsg | \ echomsg "YouCompleteMe unavailable: requires python 2.x" | From affe3e8d312753ba3ec8f7d476a49c0190a55fb5 Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Sat, 13 Jul 2013 11:38:34 -0700 Subject: [PATCH 8/9] Docs now mention the new ycm-users mailing list --- CONTRIBUTING.md | 6 ++++++ README.md | 15 +++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3e0c8688..66fab962 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,6 +7,9 @@ YCM to work on my machine" and the reason why is obviously related to your machine configuration and the problem would not be resolved with _reasonable_ changes to the YCM codebase, then the issue is likely to be closed. +**A good place to ask questions is the [ycm-users][] Google group**. Rule of +thumb: if you're not sure whether your problem is a real bug, ask on the group. + **YCM compiles just fine**; [the build bots say so][build-bots]. If the bots are green and YCM doesn't compile on your machine, then _your machine is the root cause_. Now read the previous paragraph again. @@ -25,6 +28,8 @@ Further, **search the issue tracker for similar issues** before creating a new one. There's no point in duplication; if an existing issue addresses your problem, please comment there instead of creating a duplicate. +You should also **search the archives of the [ycm-users][] mailing list**. + Lastly, **make sure you are running the latest version of YCM**. The issue you have encountered may have already been fixed. **Don't forget to recompile ycm_core.so too** (usually by just running `install.sh` again). @@ -80,3 +85,4 @@ Creating good pull requests change is known. _What goal are you trying to accomplish?_ [build-bots]: https://travis-ci.org/Valloric/YouCompleteMe +[ycm-users]: https://groups.google.com/forum/?hl=en#!forum/ycm-users diff --git a/README.md b/README.md index cd526bd1..e6ea221b 100644 --- a/README.md +++ b/README.md @@ -1270,12 +1270,22 @@ You'll have to learn to ignore them. It's a shitty "solution", I know. Use the [delimitMate][] plugin instead. It does the same thing without conflicting with YCM. +### Is there some sort of YCM mailing list? I have questions + +If you have questions about the plugin or need help, please use the +[ycm-users][] mailing list, _don't_ create issues on the tracker. The tracker is +for bug reports and feature requests. Contact ------- -If you have questions, bug reports, suggestions, etc. please use the [issue -tracker][tracker]. The latest version is available at +If you have questions about the plugin or need help, please use the +[ycm-users][] mailing list. + +If you have bug reports or feature suggestions, please use the [issue +tracker][tracker]. + +The latest version of the plugin is available at . The author's homepage is . @@ -1314,3 +1324,4 @@ This software is licensed under the [GPL v3 license][gpl]. [exuberant-ctags]: http://ctags.sourceforge.net/ [ctags-format]: http://ctags.sourceforge.net/FORMAT [vundle-bug]: https://github.com/gmarik/vundle/issues/48 +[ycm-users]: https://groups.google.com/forum/?hl=en#!forum/ycm-users From 60db012660448635de1d4bcd440e9ead2316ec36 Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Sat, 13 Jul 2013 11:42:40 -0700 Subject: [PATCH 9/9] Minor doc rewording --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 66fab962..b6823e74 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,7 +12,7 @@ thumb: if you're not sure whether your problem is a real bug, ask on the group. **YCM compiles just fine**; [the build bots say so][build-bots]. If the bots are green and YCM doesn't compile on your machine, then _your machine is the root -cause_. Now read the previous paragraph again. +cause_. Now read the first paragraph again. Realize that quite literally _thousands_ of people have gotten YCM to work successfully so if you can't, it's probably because you have a peculiar