Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Boris Staletic
    @bstaletic
    To compile latest YCM, you need to be able to compile this:
    #include <filesystem>
    
    int main(int argc, char** argv) {
        return std::filesystem::path(argv[1]).string().size();
    }
    zkitty
    @suricata3838
    ± |detached:master~9 U:1 ?:1 ✗| → g++ -o app -Wall test.cpp
    test.cpp:4:17: error: no member named 'filesystem' in namespace 'std'
        return std::filesystem::path(argv[1]).string().size();
               ~~~~~^
    1 error generated.
    Actually I checked out this commit.
    commit 4e480a317d4858db91631c14883c5927243d4893 (HEAD)
    Boris Staletic
    @bstaletic
    -std=c++17 flag is missing.
    zkitty
    @suricata3838
    Oh okay
    ± |detached:master~9 U:1 ?:1 ✗| → g++ -o app -Wall -std=c++17 test.cpp
    test.cpp:4:29: error: 'path' is unavailable: introduced in macOS 10.15
        return std::filesystem::path(argv[1]).string().size();
                                ^
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:739:24: note: 'path' has been explicitly
          marked unavailable here
    class _LIBCPP_TYPE_VIS path {
                           ^
    test.cpp:4:12: error: 'path' is unavailable: introduced in macOS 10.15
        return std::filesystem::path(argv[1]).string().size();
               ^
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:773:3: note: 'path' has been explicitly
          marked unavailable here
      path(const _Source& __src, format = format::auto_format) {
      ^
    test.cpp:4:12: error: '~path' is unavailable: introduced in macOS 10.15
        return std::filesystem::path(argv[1]).string().size();
               ^
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:791:3: note: '~path' has been explicitly
          marked unavailable here
      ~path() = default;
      ^
    test.cpp:4:43: error: 'string' is unavailable: introduced in macOS 10.15
        return std::filesystem::path(argv[1]).string().size();
                                              ^
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/filesystem:999:41: note: 'string' has been explicitly
          marked unavailable here
      _LIBCPP_INLINE_VISIBILITY std::string string() const { return __pn_; }
                                            ^
    4 errors generated.
    It's the same error when I got compiling ycmd.
    Boris Staletic
    @bstaletic

    Right. Like I said, macOS 10.14 doesn't have <filesystem> enabled.

    Actually I checked out this commit.
    commit 4e480a317d4858db91631c14883c5927243d4893 (HEAD)

    Did you do git submodule update --init --recursive after that?

    zkitty
    @suricata3838
    Maybe. I'll retry it.
    Boris Staletic
    @bstaletic
    I'm pretty sure you didn't. The point is that you have to avoid ycm-core/ycmd@ece414c in /path/to/YCM/third_party/ycmd. That's the thing that depends on C++17.
    zkitty
    @suricata3838
    Ah I see...
    As you said I didn't it, python3 install.py --all looks working right now!
    Boris Staletic
    @bstaletic
    Great!
    zkitty
    @suricata3838
    I really appreciate your so fast and kind helping.
    Boris Staletic
    @bstaletic
    You're welcome.
    Brian Orwe
    @Borwe
    Is it possible to have an intermediate applcation that acts as an interface on a port to stdio of an LSP server that doesn't offer the use of port?
    Just curious about this LSP world
    Boris Staletic
    @bstaletic
    I'm not sure what you mean, but g:ycm_language_server is pretty flexible.
    https://github.com/ycm-core/ycmd/#lsp-based-completers
    Brian Orwe
    @Borwe

    I'm not sure what you mean, but g:ycm_language_server is pretty flexible.
    https://github.com/ycm-core/ycmd/#lsp-based-completers

    For example there is this server, vala-language-server, and I wanna use it via port number rather than stdio (which is what it only supports)

    Boris Staletic
    @bstaletic
    That works just fine! You just need to state that in g:ycm_language_server.
    Brian Orwe
    @Borwe
    reason for wanting port over stdio, is because the server is kinda hard to install on local system, but would be good for docker installation, and then access it from the container.
    Boris Staletic
    @bstaletic
    let g:ycm_language_server = [ { 'name': 'vala', 'port': '123', 'filetypes': [ 'whatever' ] } ] " Use 'port': '*' to let YCM pick a random, free port
    See the examples for godot and someserver in the link above.
    Also, if you find that it works, you should open a PR on https://github.com/ycm-core/lsp-examples
    Brian Orwe
    @Borwe
    okay, cool
    Zhu Yi
    @zhu-yi
    Hello, I had installed YCM using:
    python3 install.py --clangd-completer
    And :YcmDebugInfo shows "Server has Clang support compiled in: False" and "Clangd running", so I guess the C-family completer is correctly set to clangd-completer.
    Ben Jackson
    @puremourning
    correct
    Zhu Yi
    @zhu-yi
    However, I'm not sure do I need to install other packages (e.g., clang) to actually get clangd-completer work? Currently I'm having problem to let YCM correctly show semantic support for Linux kernel using .ycm_extra_conf.py. I'm running Ubuntu 20.04 with Vim 8.1.2269.
    Ben Jackson
    @puremourning
    no you do not need to install anything else
    we recommend using a compilation database and NOT using a .ycm_extra_conf.py with clangd
    Zhu Yi
    @zhu-yi
    ok, thanks for your feedback, Ben
    Understood, for small C++ projects, I used cmake to generate the compilation database, and it works fine.
    Ben Jackson
    @puremourning
    the reason to use a compilation database is that is how clangd knows what to index
    Zhu Yi
    @zhu-yi
    For Linux kernel, do you have suggestions of how to generate the compilation database if not using .ycm_extra_conf.py?
    Ben Jackson
    @puremourning
    if you use a ycm_extra_conf.py file it will only be able to provide single-tu analysis. with the compilation database it will index the entire project
    how about google "create compilation database for linux kernel"
    or "linux kernel compile_commands.json"
    Zhu Yi
    @zhu-yi
    :) Thanks for the suggestion, I'll give it a try
    Ben Jackson
    @puremourning
    usually i would say pip3 install compiledb and then compiledb make
    but iirc the linux kernel makefiles supress the output so you might need to use bear but that probably won't work anymore
    scripts/gen_compile_commands.py
    i haven't compiled a linux kernel manually since... erm.... 2003
    Zhu Yi
    @zhu-yi
    I'm looking at this patch too. :) Thanks for your insight, I'll give it a try and feedback the results afterwards.
    Ben Jackson
    @puremourning
    remember to remove the .ycm_extra_conf.py aftrer generating the compile_commands.json (and YcmRestartServer, or restart vim)
    Zhu Yi
    @zhu-yi
    ok, thanks for the heads up. :) Currently I'm struggling of how to download the patch to my Linux PC, since it is not allowed to connect to company's network.
    Ben Jackson
    @puremourning
    is the script not there in your linux kernel scripts directory ?
    Zhu Yi
    @zhu-yi
    Not yet, I'm using an old kernel version (v4.9), so I need to manually apply this patch.
    Ben Jackson
    @puremourning
    can you copy/paste ?
    it's just a python script