by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Ben Jackson
    @puremourning
    fixit is useful one too. with clangd that includes 'code actions' like extract variable and extract function (or ycm-core/ycmd#1465 when we fix it)
    Enrico Maria De Angelis
    @Aster89
    Yeah, maybe it's time to add that too, even if it's in my fingers already
    It's just 7 keys, after all
    But the mapping would be 3 or 4
    Enrico Maria De Angelis
    @Aster89

    Wow, little interactions in more than 24 hours?! :P

    However, in studying boost::hana from my laptop, I've hit this strange behavior when completing. I remember that often the signature of the function whose call I'm filling is available even if I tab complete the arguments or whatever. Am I wrong?

    Clearly boost::hana has nothing to do, I just meant to say that I've recorded this on my laptop, not on my work computer where the I remember part is set.
    Yiming Pan
    @YimingPan
    Hello everybody! My YCM suddenly stopped working very recently. :messages shows no error, client and server logs are both empty.
    Yiming Pan
    @YimingPan
    nvm, it somehow recovered by itself after I robooted my laptop
    Ben Jackson
    @puremourning
    @Aster89 sorry i'm not following exactly what's the expected behaviour
    henglxm
    @henglxm
    Has anyone used php's intelephense language server?
    Enrico Maria De Angelis
    @Aster89
    @puremourning , for instance, I write auto xxx = hana::filter( and the popup with operator()(Xs &&xs, Pred &&pred) -> auto shows up, with Xs &&xs being highlighted, then I keep writing rest and then comma ,. If rest is a variable the popup disappears as soon as I hit that comma; if rest is not an existing name the popup stays unchanged, with Xs &&xs still highlighted, whereas Pred &&pred should be as I've inserted the comma, so I'm going to write the second argument.
    Boris Staletic
    @bstaletic
    Does rest have the correct type for hana::filter()?
    @henglxm I don't think so, but you can always try to set it up with :h g:ycm_language_server.
    Enrico Maria De Angelis
    @Aster89
    @bstaletic , no but I see the same behavior if I pass an object of the correct type
    Boris Staletic
    @bstaletic

    no

    In that case, you're seeing the correct behaviour. Because overloads.

    but I see the same behavior if I pass an object of the correct type

    A , is a trigger character for signature help. Check the logs. My guess is that clangd just gives up on Boost.Hana's template blackmagic.

    Enrico Maria De Angelis
    @Aster89
    Yes, it's really blackmagic :D
    What I should specifically check to ensure that clangd is giving up?
    Boris Staletic
    @bstaletic
    1. Set g:ycm_log_level to 'debug'.
    2. Recreate the behaviour with the comma.
    3. :YcmToggleLogs and choose the ycmd stderr one.
    4. Check the last textDocument/signatureHelp request to see its id.
    5. Check the corresponding response with the same id. I'm expecting it to be empty.
    The ycm_log_level should be set in your vimrc, since the config is only read at startup.
    When you finish, you likely want to remove that line, since it makes YCM log a lot.
    Ben Jackson
    @puremourning
    Yeah it’s likely that the types don’t match and so clangd doesn’t think there are any matching signatures.
    Or it doesn’t know the types and the same happens
    Boris Staletic
    @bstaletic
    Interestingly, with rust-analyzer, typing space closes the signature help.
    Enrico Maria De Angelis
    @Aster89
    This is the last line containing textDocument/signatureHelp:
    2020-08-10 09:15:35,687 - DEBUG - TX: Sending message: b'Content-Length: 175\r\n\r\n{"id":11,"jsonrpc":"2.0","method":"textDocument/signatureHelp","params":{"position":{"character":37,"line":56},"textDocument":{"uri":"file:///home/enrico/hanaExercises.cpp"}}}'
    Boris Staletic
    @bstaletic
    That line should be followed by a line containing RX:, "id":11 and "result":.
    Enrico Maria De Angelis
    @Aster89
    Since it says Sending message I guess it is a request. In which case, the id is 11, and the corresponding response should be:
    2020-08-10 09:15:35,708 - DEBUG - RX: Received message: b'{"id":11,"jsonrpc":"2.0","result":{"activeParameter":0,"activeSignature":0,"signatures":[]}}'
    and signatures seems [] empty
    Boris Staletic
    @bstaletic
    That's right. Meaning clangd is returning no signatures.
    Enrico Maria De Angelis
    @Aster89
    So it's just clangd vs hana's blackmagic, and therefore other IDEs using clangd for autocompletion cannot do better, I guess
    Boris Staletic
    @bstaletic
    That, unfortunately, sounds correct. Maybe you can open an issue in clangd/clangd repo.
    Enrico Maria De Angelis
    @Aster89
    FYI, I've opened this, but they told me clangd/clangd#490 already addresses the more general issue.
    rileylyman
    @rileylyman
    When I use compile_commands.json with YCM with a cpp file and use the standard library with clang, everything works fine. When I use it with arm-none-eabi-g++, YCM complains it can't find c++ standard libraries. This is strange, though, because in the arm-none-eabi-g++ case, compiling using these compile commands still works fine. How do I get YCM to find the arm-none-eabi-g++ stdlib? Here is a picture of my two different compile_command.jsons, along with the YCM output: https://imgur.com/DjBZSvq
    Martin Chekurov
    @MartinChekurov
    Hello, i have been using YCM for a few months already and everything is working fine.However i have some project for which i am receiving this error: ResponseFailedException: Request failed: -32001: invalid AST.What is causing this error?
    Boris Staletic
    @bstaletic
    @rileylyman This is because clang does cross compiling very different from gcc. Use g:ycm_clangd_args to set --query-driver to the path to your arm-none-eabi-g++.
    @MartinChekurov That's clangd getting confused about something. Check that you can compile that file on its own with clang compiler. Is the file self-contained?
    Martin Chekurov
    @MartinChekurov
    It's not self-contained file, it's a whole project.And i am getting this error for all the files.
    Boris Staletic
    @bstaletic
    Then clang likely can't deal with your compilation database. Can you compile one of the files in that project with clang?
    Martin Chekurov
    @MartinChekurov
    It compiled it successfully.
    Boris Staletic
    @bstaletic
    Did you use the exact command line that clangd tried to use in vim?
    Martin Chekurov
    @MartinChekurov
    I don't know which command clangd uses in vim.How do i check that?
    Boris Staletic
    @bstaletic
    Set g:ycm_log_level to 'debug' in your vimrc, restart vim and then check what clangd is doing in its log with :YcmToggleLogs
    Martin Chekurov
    @MartinChekurov
    Which logfile do you wish to open (or close if already open)?
    1: ycm_dz0e68sj.log
    2: ycmd_54771_stderr_ycf8o06v.log
    3: ycmd_54771_stdout_bgugfddc.log
    Type number and <Enter> or click with mouse (empty cancels):
    Which one do i select?
    Boris Staletic
    @bstaletic
    Your cursor wasn't in a C++ file. The one with clangd in its name.
    Martin Chekurov
    @MartinChekurov
    mips-sde-elf-gcc -target mips-sde-elf -c -I EMVKER -I inc -O1 -EL -fno-builtin -march=4ksd -msmartmips -mno-float -gdwarf-2 -ffixed-14 -ffixed-15 -membedded-data -G0 -fno-strict-aliasing -finline-limit=5000 -fdata-sections -ffunction-sections -std=gnu99 -Wall -Wno-multichar -Wno-main -Wno-char-subscripts -Wno-return-type -Wno-pointer-sign -Wno-unused-but-set-variable -mips16 -DCODE16 src/BCDConvert.c -o out/src/BCDConvert.o -fsyntax-only -resource-dir=C:\Users\martinchekurov.vim\plugged\YouCompleteMe\third_party\ycmd\third_party\clang\lib\clang\10.0.0
    V[11:04:07.670] Ignored diagnostic. optimization flag '-finline-limit=5000' is not supported
    V[11:04:07.670] Driver produced command: cc1 -cc1 -triple mipsel-sde-unknown-elf -fsyntax-only -disable-free -disable-llvm-verifier -discard-value-names -main-file-name BCDConvert.c -mrelocation-model static -mthread-model posix -mframe-pointer=all -relaxed-aliasing -fmath-errno -fno-rounding-math -masm-verbose -mconstructor-aliases -target-cpu 4ksd -target-feature -noabicalls -target-feature +mips16 -target-abi o32 -mfloat-abi hard -mllvm -mips-ssection-threshold=0 -dwarf-column-info -fno-split-dwarf-inlining -debug-info-kind=limited -dwarf-version=2 -debugger-tuning=gdb -ffunction-sections -fdata-sections -resource-dir C:\Users\martinchekurov.vim\plugged\YouCompleteMe\third_party\ycmd\third_party\clang\lib\clang\10.0.0 -I EMVKER -I inc -D CODE16 -O1 -Wall -Wno-multichar -Wno-main -Wno-char-subscripts -Wno-return-type -Wno-pointer-sign -Wno-unused-but-set-variable -std=gnu99 -fdebug-compilation-dir 12052017 - 1704 - ver.1.0.1.15 -ferror-limit 19 -fmessage-length 0 -fno-builtin -fgnuc-version=4.2.1 -fobjc-runtime=gcc -fdiagnostics-show-option -faddrsig -x c src/BCDConvert.c
    V[11:04:07.671] Building first preamble for 12052017 - 1704 - ver.1.0.1.15\src\BCDConvert.c
    V[11:04:07.673] Ignored diagnostic. unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'?
    V[11:04:07.674] Ignored diagnostic. valid target CPU values are: mips1, mips2, mips3, mips4, mips5, mips32, mips32r2, mips32r3, mips32r5, mips32r6, mips64, mips64r2, mips64r3, mips64r5, mips64r6, octeon, octeon+, p5600
    E[11:04:07.674] Could not build a preamble for file 12052017 - 1704 - ver.1.0.1.15\src\BCDConvert.c
    V[11:04:07.676] Ignored diagnostic. unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'?
    V[11:04:07.676] Ignored diagnostic. valid target CPU values are: mips1, mips2, mips3, mips4, mips5, mips32, mips32r2, mips32r3, mips32r5, mips32r6, mips64, mips64r2, mips64r3, mips64r5, mips64r6, octeon, octeon+, p5600
    Boris Staletic
    @bstaletic
    clang -target mips-sde-elf -c -I EMVKER -I inc -O1 -EL -fno-builtin -march=4ksd -msmartmips -mno-float -gdwarf-2 -ffixed-14 -ffixed-15 -membedded-data -G0 -fno-strict-aliasing -finline-limit=5000 -fdata-sections -ffunction-sections -std=gnu99 -Wall -Wno-multichar -Wno-main -Wno-char-subscripts -Wno-return-type -Wno-pointer-sign -Wno-unused-but-set-variable -mips16 -DCODE16 src/BCDConvert.c -o out/src/BCDConvert.o -fsyntax-only
    Does the above command work without errors?
    Martin Chekurov
    @MartinChekurov
    No..
    clang: error: unknown argument: '-msmartmips'
    clang: error: unknown argument: '-mno-float'
    clang: error: unknown argument '-ffixed-14'; did you mean '-ffixed-x14'?
    clang: error: unknown argument '-ffixed-15'; did you mean '-ffixed-x15'?
    clang: warning: optimization flag '-finline-limit=5000' is not supported [-Wignored-optimization-argument]
    Boris Staletic
    @bstaletic
    That would explain it. Clang has to be able to compile your code for clangd to work.
    kadir çetinkaya
    @kadircet
    those are mostly failures relating to code-gen to so shouldn't effect clangd much. at least the include header search logic
    i think your main issue is you didn't pass --query-driver correctly as boris suggested