jerrymarino / SwiftVimTestHost

Swift Vim Test Host is a Playground to test out Swift Vim functionality on real projects.
4 stars 0 forks source link

Can't get the examples to work #1

Open ladislas opened 6 years ago

ladislas commented 6 years ago

Hi there!

First, let me thank you for providing us YCM lovers with iCM, it looks fantastic.

The only issue I have is that I can't get the examples to work and create the compile_commands.json file.

You say the projects are setup to create it but it doesn't seem to work.

Any help would be appreciated :)

jerrymarino commented 6 years ago

Hey @ladislas - thanks for the report!

Which of the examples aren't working for you, and what version of Xcode are you on? If you're using Xcode, then you'll need to make sure XcodeCompilationDatabase is working correctly with 9.4.

Based on what I saw testing the iOS Xcode example on 9.4 this morning, XcodeCompilationDatabase may need a bit of work. It should be redesigned to parse the output of Xcode's build instead of loading Xcode's data structures. It was also recommended by the team to use the swiftc invocation to derive compiler invocations, so that should be considered as well. This is a more robust design and is probably required to work with the new llbuild build system anyways.

Admittedly, I switched over all of my Xcode projects to SwiftPackageManager and Bazel so the Xcode stuff hasn't been getting much attention these days. None the less, I'd be happy to help test / look at it this over weekend if I get a free minute πŸ˜„ .

ladislas commented 6 years ago

Thanks for getting back to me!

Both macOS and iOS examples don't work. I'm using Xcode 9.4, the latest stable version.

From what you're saying, if I understand correctly, there is no way of using iCM with the current version of Xcode?

ladislas commented 6 years ago

For the BasicCliSwiftPM I can generate de compile database but iCM doesn't seem to work.

jerrymarino commented 6 years ago

For basic completions,within a single file it should just work ( no compilation DB ).

I’m not sure where it’s failig for you, a good place to start investigating is the server logs. If you get stuck, feel free to post those up - I can try to take a πŸ‘€ this weekend

ladislas commented 6 years ago

I have new bad news... I've upgraded my python to 3.7 as well as the neovim python package.

Now iCompleteMe won't even compile :(

[ 23%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/converter/registry.cpp.o
[ 25%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/converter/type_id.cpp.o
/Users/ladislas/.config/nvim/plugged/iCompleteMe/third_party/icmd/cpp/BoostParts/libs/python/src/converter/builtin_converters.cpp:51:14: error:
      cannot initialize return object of type 'void *' with an rvalue of type 'const char *'
      return PyUnicode_Check(obj) ? _PyUnicode_AsString(obj) : 0;
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/include/python3.7m/unicodeobject.h:363:18: note:
      expanded from macro 'PyUnicode_Check'
                 PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_UNICODE_SUBCLASS)
                 ^
/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/include/python3.7m/object.h:686:35: note: expanded
      from macro 'PyType_FastSubclass'
#define PyType_FastSubclass(t,f)  PyType_HasFeature(t,f)
                                  ^
/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/include/python3.7m/object.h:684:33: note: expanded
      from macro 'PyType_HasFeature'
#define PyType_HasFeature(t,f)  (((t)->tp_flags & (f)) != 0)
                                ^
1 error generated.
make[3]: *** [BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/converter/builtin_converters.cpp.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [BoostParts/CMakeFiles/BoostParts.dir/all] Error 2
make[1]: *** [ycm/CMakeFiles/ycm_core.dir/rule] Error 2
make: *** [ycm_core] Error 2
ERROR: the build failed.
jerrymarino commented 6 years ago

@ladislas thanks for the heads up. Now that 3.7 is official, we should make sure it's officially supported. The build issue is fixed in the latest Boost and part of iCompleteMe is still on an older version. Once bumping that, it builds fine on3.7 πŸ”₯

After testing this out locally, I ran into a warning issue with3.7 in Vim, specifically ( https://github.com/vim/vim/issues/3117 ). It looks like the Vim Py code is using a deprecated module. Out of curiosity, are you running into this warning in neovim?

Despite the warning on launch, iCompleteMe is now working good for me on:

jerrymarino commented 6 years ago

Here is the commit bumping iCompleteMe to the latest boost

ladislas commented 6 years ago

thanks a lot! It compiles now! I'll do more testing later today and will keep you up to date :)

jerrymarino commented 6 years ago

Awesome great to hear!

ladislas commented 6 years ago

Hi @jerrymarino, it's me again!

I'm still having issue with autocompletion besides 'in the same file' autocompletion.

I'm seeing error message about the HTTP pool not responding. I can share the logs, just let me know which one you'd like to have.

requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=64538): Max retries exceeded with url: /semantic_completion_available (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x102c2c2b0>: Failed to establish a new connection: [Errno 61] Connection refused'))