Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Brian Orwe
    @Borwe
    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
    hah nice, the committer is a YCM user!
    For an example of the utility of this script: after running
    gen_compile_commands.json on the latest kernel version, I was able to
    use Vim + the YouCompleteMe pluging + clangd to automatically jump to
    definitions and declarations. Obviously, cscope and ctags provide some
    <3
    Zhu Yi
    @zhu-yi
    The USB port is disabled too. I'll try hotspot of my phone to download this patch.
    Ben Jackson
    @puremourning
    i know your pain
    Zhu Yi
    @zhu-yi
    Worked like a charm! :)
    Thank you so much for your advice, Ben! And of course, thanks a lot to the author Tom Roeder! :)
    Ben Jackson
    @puremourning
    you're welcome
    Enrico Maria De Angelis
    @Aster89

    Sometimes, after some hour of coding, in which I've certainly mashed TAB, I find out some file containing #include <bits/stdc++.h>, which means that some TAB-completion triggered that. Since I discover this after a long time coding, typically when qualifying the change, I don't know which completion trigger that. Any idea which could it be? Plus, shouldn't that header be avoided, in general?

    I've created this: https://github.com/clangd/clangd/issues/666#event-4251697760

    oh, wait, i see your point
    Boris Staletic
    @bstaletic
    And looks like Kadir already sent a patch.
    Ben Jackson
    @puremourning
    yeah noice