Changeset View
Changeset View
Standalone View
Standalone View
addons/lspclient/tests/lsptestapp.cpp
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | 30 | { | |||
---|---|---|---|---|---|
56 | 56 | | |||
57 | QFile file(document.path()); | 57 | QFile file(document.path()); | ||
58 | if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) | 58 | if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) | ||
59 | return -1; | 59 | return -1; | ||
60 | QTextStream in(&file); | 60 | QTextStream in(&file); | ||
61 | QString content = in.readAll(); | 61 | QString content = in.readAll(); | ||
62 | lsp.didOpen(document, 0, content); | 62 | lsp.didOpen(document, 0, content); | ||
63 | 63 | | |||
64 | auto ds_h = [&q] (const QList<LSPSymbolInformation> & syms) { | 64 | auto ds_h = [&q] (std::shared_ptr<QStandardItemModel> syms) { | ||
65 | std::cout << "symbol count: " << syms.length() << std::endl; | 65 | std::cout << "symbol count: " << (syms ? syms->rowCount() : 0) << std::endl; | ||
66 | q.quit(); | 66 | q.quit(); | ||
67 | }; | 67 | }; | ||
68 | lsp.documentSymbols(document, &app, ds_h); | 68 | lsp.documentSymbols(document, &app, ds_h); | ||
69 | q.exec(); | 69 | q.exec(); | ||
70 | 70 | | |||
71 | auto position = QString::fromLatin1(argv[4]).split(QStringLiteral(" ")); | 71 | auto position = QString::fromLatin1(argv[4]).split(QStringLiteral(" ")); | ||
72 | auto def_h = [&q] (const QList<LSPLocation> & defs) { | 72 | auto def_h = [&q] (const QList<LSPLocation> & defs) { | ||
73 | std::cout << "definition count: " << defs.length() << std::endl; | 73 | std::cout << "definition count: " << defs.length() << std::endl; | ||
▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines |