Skip to content

Instantly share code, notes, and snippets.

@bstaletic
bstaletic / clangd.log
Created April 26, 2019 14:20
Indexing, no exit, 1 thread
V[16:18:47.580] <<< {"id":"1","jsonrpc":"2.0","method":"initialize","params":{"capabilities":{"textDocument":{"completion":{"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}}}},"initializationOptions":{},"processId":7398,"rootPath":"/home/bstaletic/Temp/ycmd","rootUri":"file:///home/bstaletic/Temp/ycmd"}}
I[16:18:47.581] <-- initialize("1")
I[16:18:47.581] BackgroundIndex: build symbol index periodically every 5000 ms.
I[16:18:47.581] --> reply:initialize("1") 0 ms
V[16:18:47.582] >>> {"id":"1","jsonrpc":"2.0","result":{"capabilities":{"codeActionProvider":true,"completionProvider":{"resolveProvider":false,"triggerCharacters":[".",">",":"]},"definitionProvider":true,"documentFormattingProvider":true,"documentHighlightProvider":true,"documentOnTypeFormattingProvider":{"firstTriggerCharacter":"}","moreTriggerCharacter":[]},"documentRangeFormattingProvider":true,"documentSymbolProvider":true,"executeCommandProvider":{"commands":["clangd.applyFix"]},"hoverProvi
#0 0x00007ffff7e0282f in raise () from /usr/lib/libc.so.6
#1 0x00007ffff7ded672 in abort () from /usr/lib/libc.so.6
#2 0x00007ffff6a7758e in __gnu_cxx::__verbose_terminate_handler () at /build/gcc/src/gcc/libstdc++-v3/libsupc++/vterminate.cc:95
#3 0x00007ffff6a7de0a in __cxxabiv1::__terminate (handler=<optimized out>) at /build/gcc/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:47
#4 0x00007ffff6a7de67 in std::terminate () at /build/gcc/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:57
#5 0x00007ffff6a7e0bc in __cxxabiv1::__cxa_throw (obj=<optimized out>, tinfo=0x7ffff6b6ecf0 <typeinfo for std::bad_alloc>, dest=0x7ffff6a7c1e0 <std::bad_alloc::~bad_alloc()>) at /build/gcc/src/gcc/libstdc++-v3/libsupc++/eh_throw.cc:95
#6 0x00007ffff6d091c6 in babb::this_thread_::inject_random_failure<std::bad_alloc> (this=0x555555687250) at /home/bstaletic/Temp/ycmd/cpp/ycm/babb/babb.h:175
#7 0x00007ffff6d08c6c in operator new (size=40) at /home/bstaletic/Temp/ycmd/cpp/ycm/babb/new_replacements.cpp:57
#8 0x00007ffff6c6
#0 0x00007ffff7e0282f in raise () from /usr/lib/libc.so.6
#1 0x00007ffff7ded672 in abort () from /usr/lib/libc.so.6
#2 0x00007ffff70d358e in __gnu_cxx::__verbose_terminate_handler () at /build/gcc/src/gcc/libstdc++-v3/libsupc++/vterminate.cc:95
#3 0x00007ffff70d9e0a in __cxxabiv1::__terminate (handler=<optimized out>) at /build/gcc/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:47
#4 0x00007ffff70d9e67 in std::terminate () at /build/gcc/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:57
#5 0x00007ffff70da0bc in __cxxabiv1::__cxa_throw (obj=<optimized out>, tinfo=0x7ffff71cacf0 <typeinfo for std::bad_alloc>, dest=0x7ffff70d81e0 <std::bad_alloc::~bad_alloc()>) at /build/gcc/src/gcc/libstdc++-v3/libsupc++/eh_throw.cc:95
#6 0x00007ffff721b835 in operator new(unsigned long) () from /home/bstaletic/Temp/pybind11/tests/pybind11_tests.cpython-37m-x86_64-linux-gnu.so
#7 0x00007ffff71f95e5 in ?? () from /home/bstaletic/Temp/pybind11/tests/pybind11_tests.cpython-37m-x86_64-linux-gnu.so
#8 0x00007ffff71f91c0 in ?
@bstaletic
bstaletic / drop_and_reuse.cpp
Last active June 8, 2020 21:21
Allocator messing around
#include <cstdio>
#include <memory_resource>
#include <new>
#include <type_traits>
#include <vector>
struct data {
data() = default;
data(int a) : a(a) {}
~data() { printf("destructed\n"); }
int a;
V[14:55:13.191] <<< {"id":"1","jsonrpc":"2.0","method":"initialize","params":{"capabilities":{"textDocument":{"completion":{"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}}}},"initializationOptions":{},"processId":20060,"rootPath":"/home/bstaletic/Temp/test","rootUri":"file:///home/bstaletic/Temp/test"}}
I[14:55:13.191] <-- initialize("1")
I[14:55:13.206] BackgroundIndex: build symbol index periodically every 5000 ms.
I[14:55:13.206] --> reply:initialize("1") 15 ms
V[14:55:13.206] >>> {"id":"1","jsonrpc":"2.0","result":{"capabilities":{"codeActionProvider":true,"completionProvider":{"resolveProvider":false,"triggerCharacters":[".",">",":"]},"definitionProvider":true,"documentFormattingProvider":true,"documentHighlightProvider":true,"documentOnTypeFormattingProvider":{"firstTriggerCharacter":"}","moreTriggerCharacter":[]},"documentRangeFormattingProvider":true,"documentSymbolProvider":true,"executeCommandProvider":{"commands":["clangd.applyFix"]},"hoverPro
Messages maintainer: Bram Moolenaar <[email protected]>
Error detected while processing function <SNR>60_OnTextChangedInsertMode[29]..<SNR>60_RequestSignatureHelp[2]..<SNR>60_PollSignatureHelp[1]..<SNR>60_Pyeval:
line 2:
Traceback (most recent call last):
Error detected while processing function <SNR>60_OnTextChangedInsertMode[29]..<SNR>60_RequestSignatureHelp[2]..<SNR>60_PollSignatureHelp[1]..<SNR>60_Pyeval:
line 2:
File "<string>", line 1, in <module>
Error detected while processing function <SNR>60_OnTextChangedInsertMode[29]..<SNR>60_RequestSignatureHelp[2]..<SNR>60_PollSignatureHelp[1]..<SNR>60_Pyeval:
line 2:
File "/home/bstaletic/.vim/pack/bundle/start/YouCompleteMe/python/ycm/youcompleteme.py", line 339, in SignatureHelpRequestReady

LSP based completers

The LSP servers sometimes support user configurations. To learn what configurations are available, consult the respective LSP server's documentation.

  • ls: (optional) a dictionary where all LSP server specific settings reside.

Example of LSP configuration:

def Settings( **kwargs ):
def LanguageServerCompleter_Diagnostics_HandleNotificationThrows_test():
completer = MockCompleter()
filepath = os.path.realpath( '/foo' )
uri = lsp.FilePathToUri( filepath )
request_data = RequestWrap( BuildRequest( line_num = 1,
column_num = 1,
filepath = filepath,
contents = '' ) )
notification = {
'jsonrpc': '2.0',
@bstaletic
bstaletic / bench.txt
Last active January 15, 2020 18:39
ycmd bench
master
---------------------------------------------------------------------------------------------------------------------
IdentifierCompleterFixture/CandidatesWithCommonPrefix/1/0 827 ns 827 ns 849012
IdentifierCompleterFixture/CandidatesWithCommonPrefix/16/0 5420 ns 5415 ns 128928
IdentifierCompleterFixture/CandidatesWithCommonPrefix/256/0 125180 ns 125083 ns 5617
IdentifierCompleterFixture/CandidatesWithCommonPrefix/4096/0 1846880 ns 1844614 ns 386
IdentifierCompleterFixture/CandidatesWithCommonPrefix/65536/0 46297888 ns 46121385 ns 15
IdentifierCompleterFixture_BigO 44.14 NlgN 43.97 NlgN
IdentifierCompleterFixture_RMS 2 % 1 %
IdentifierCompleterFixture/CandidatesWithCommonPrefix/1/10 835 ns 8
diff --git a/ycmd/completers/rust/rust_completer.py b/ycmd/completers/rust/rust_completer.py
index 941cec4f..7d91e214 100644
--- a/ycmd/completers/rust/rust_completer.py
+++ b/ycmd/completers/rust/rust_completer.py
@@ -28,7 +28,8 @@ from future.utils import itervalues
from subprocess import PIPE
from ycmd import responses, utils
-from ycmd.completers.language_server import simple_language_server_completer
+from ycmd.completers.language_server import ( simple_language_server_completer,