Skip to content

Instantly share code, notes, and snippets.

@thegala
Created April 12, 2020 15:36
Show Gist options
  • Save thegala/8674ad280ebb278b934783492afdc0b0 to your computer and use it in GitHub Desktop.
Save thegala/8674ad280ebb278b934783492afdc0b0 to your computer and use it in GitHub Desktop.
[Trace - 10:33:56 PM] Sending request 'initialize - (0)'.
Params: {
"processId": 711749,
"rootPath": "/home/user/HelloWorld",
"rootUri": "file:///home/user/HelloWorld",
"capabilities": {
"workspace": {
"applyEdit": true,
"workspaceEdit": {
"documentChanges": true,
"resourceOperations": [
"create",
"rename",
"delete"
],
"failureHandling": "textOnlyTransactional"
},
"didChangeConfiguration": {
"dynamicRegistration": true
},
"didChangeWatchedFiles": {
"dynamicRegistration": true
},
"symbol": {
"dynamicRegistration": true,
"symbolKind": {
"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,
26
]
}
},
"executeCommand": {
"dynamicRegistration": true
},
"configuration": true,
"workspaceFolders": true
},
"textDocument": {
"publishDiagnostics": {
"relatedInformation": true,
"versionSupport": false
},
"synchronization": {
"dynamicRegistration": true,
"willSave": true,
"willSaveWaitUntil": true,
"didSave": true
},
"completion": {
"dynamicRegistration": true,
"contextSupport": true,
"completionItem": {
"snippetSupport": true,
"commitCharactersSupport": true,
"documentationFormat": [
"markdown",
"plaintext"
],
"deprecatedSupport": true,
"preselectSupport": true
},
"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
]
}
},
"hover": {
"dynamicRegistration": true,
"contentFormat": [
"markdown",
"plaintext"
]
},
"signatureHelp": {
"dynamicRegistration": true,
"signatureInformation": {
"documentationFormat": [
"markdown",
"plaintext"
],
"parameterInformation": {
"labelOffsetSupport": true
}
}
},
"definition": {
"dynamicRegistration": true
},
"references": {
"dynamicRegistration": true
},
"documentHighlight": {
"dynamicRegistration": true
},
"documentSymbol": {
"dynamicRegistration": true,
"symbolKind": {
"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,
26
]
},
"hierarchicalDocumentSymbolSupport": true
},
"codeAction": {
"dynamicRegistration": true,
"isPreferredSupport": true,
"codeActionLiteralSupport": {
"codeActionKind": {
"valueSet": [
"",
"quickfix",
"refactor",
"refactor.extract",
"refactor.inline",
"refactor.rewrite",
"source",
"source.organizeImports"
]
}
}
},
"codeLens": {
"dynamicRegistration": true
},
"formatting": {
"dynamicRegistration": true
},
"rangeFormatting": {
"dynamicRegistration": true
},
"onTypeFormatting": {
"dynamicRegistration": true
},
"rename": {
"dynamicRegistration": true,
"prepareSupport": true
},
"documentLink": {
"dynamicRegistration": true,
"tooltipSupport": true
},
"typeDefinition": {
"dynamicRegistration": true
},
"implementation": {
"dynamicRegistration": true
},
"declaration": {
"dynamicRegistration": true
},
"colorProvider": {
"dynamicRegistration": true
},
"foldingRange": {
"dynamicRegistration": true,
"rangeLimit": 5000,
"lineFoldingOnly": true
},
"selectionRange": {
"dynamicRegistration": true
}
},
"window": {
"workDoneProgress": true
}
},
"initializationOptions": {},
"trace": "verbose",
"workspaceFolders": [
{
"uri": "file:///home/user/HelloWorld",
"name": "HelloWorld"
}
],
"workDoneToken": "20e9fa4f-fb33-4292-9f3d-b934b7bb0f57"
}
I[22:33:56.890] clangd version 9.0.1
I[22:33:56.890] Working directory: /home/user/HelloWorld
I[22:33:56.890] argv[0]: clangd
I[22:33:56.890] argv[1]: -background-index
I[22:33:56.890] Starting LSP over stdin/stdout
I[22:33:56.890] <-- initialize(0)
I[22:33:56.890] --> reply:initialize(0) 0 ms
[Trace - 10:33:56 PM] Received response 'initialize - (0)' in 85ms.
Result: {
"capabilities": {
"codeActionProvider": true,
"completionProvider": {
"resolveProvider": false,
"triggerCharacters": [
".",
">",
":"
]
},
"declarationProvider": true,
"definitionProvider": true,
"documentFormattingProvider": true,
"documentHighlightProvider": true,
"documentOnTypeFormattingProvider": {
"firstTriggerCharacter": "\n",
"moreTriggerCharacter": []
},
"documentRangeFormattingProvider": true,
"documentSymbolProvider": true,
"executeCommandProvider": {
"commands": [
"clangd.applyFix",
"clangd.applyTweak"
]
},
"hoverProvider": true,
"referencesProvider": true,
"renameProvider": true,
"signatureHelpProvider": {
"triggerCharacters": [
"(",
","
]
},
"textDocumentSync": 2,
"typeHierarchyProvider": true,
"workspaceSymbolProvider": true
}
}
[Trace - 10:33:56 PM] Sending notification 'initialized'.
Params: {}
[Trace - 10:33:56 PM] Sending notification 'textDocument/didOpen'.
Params: {
"textDocument": {
"uri": "file:///home/user/HelloWorld/helloworld.c",
"languageId": "c",
"version": 1,
"text": "#include <stdlib.h>\n#include <stdio.h>\n\nint main(int argc, char *argv[])\n{\n\tprintf(\"Hello, World\");\n\treturn 0;\n}\n"
}
}
I[22:33:56.893] <-- initialized
I[22:33:56.893] unhandled notification initialized
I[22:33:56.895] <-- textDocument/didOpen
I[22:33:56.896] Failed to find compilation database for /home/user/HelloWorld/helloworld.c
I[22:33:56.896] Updating file /home/user/HelloWorld/helloworld.c with command clangd fallback
[/home/user/HelloWorld]
/usr/bin/clang /home/user/HelloWorld/helloworld.c -fsyntax-only -resource-dir=/usr/lib/clang/9.0.1
I[22:33:57.030] --> textDocument/publishDiagnostics
[Trace - 10:33:57 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
"diagnostics": [],
"uri": "file:///home/user/HelloWorld/helloworld.c"
}
[Trace - 10:33:59 PM] Sending request 'textDocument/hover - (1)'.
Params: {
"textDocument": {
"uri": "file:///home/user/HelloWorld/helloworld.c"
},
"position": {
"line": 5,
"character": 3
}
}
I[22:33:59.527] <-- textDocument/hover(1)
I[22:33:59.528] --> reply:textDocument/hover(1) 0 ms
[Trace - 10:33:59 PM] Received response 'textDocument/hover - (1)' in 1ms.
Result: {
"contents": {
"kind": "markdown",
"value": "Declared in `global namespace`\n```cpp\nextern int printf(const char *, ...)\n```\n"
},
"range": {
"end": {
"character": 7,
"line": 5
},
"start": {
"character": 1,
"line": 5
}
}
}
[Trace - 10:34:01 PM] Sending request 'textDocument/hover - (2)'.
Params: {
"textDocument": {
"uri": "file:///home/user/HelloWorld/helloworld.c"
},
"position": {
"line": 5,
"character": 4
}
}
I[22:34:01.349] <-- textDocument/hover(2)
I[22:34:01.349] --> reply:textDocument/hover(2) 0 ms
[Trace - 10:34:01 PM] Received response 'textDocument/hover - (2)' in 1ms.
Result: {
"contents": {
"kind": "markdown",
"value": "Declared in `global namespace`\n```cpp\nextern int printf(const char *, ...)\n```\n"
},
"range": {
"end": {
"character": 7,
"line": 5
},
"start": {
"character": 1,
"line": 5
}
}
}
[Trace - 10:34:02 PM] Sending request 'textDocument/documentHighlight - (3)'.
Params: {
"textDocument": {
"uri": "file:///home/user/HelloWorld/helloworld.c"
},
"position": {
"line": 5,
"character": 4
}
}
I[22:34:02.041] <-- textDocument/documentHighlight(3)
I[22:34:02.041] --> reply:textDocument/documentHighlight(3) 0 ms
[Trace - 10:34:02 PM] Received response 'textDocument/documentHighlight - (3)' in 0ms.
Result: [
{
"kind": 1,
"range": {
"end": {
"character": 7,
"line": 5
},
"start": {
"character": 1,
"line": 5
}
}
}
]
[Trace - 10:34:44 PM] Sending request 'textDocument/documentHighlight - (4)'.
Params: {
"textDocument": {
"uri": "file:///home/user/HelloWorld/helloworld.c"
},
"position": {
"line": 5,
"character": 4
}
}
I[22:34:44.570] <-- textDocument/documentHighlight(4)
I[22:34:44.570] --> reply:textDocument/documentHighlight(4) 0 ms
[Trace - 10:34:44 PM] Received response 'textDocument/documentHighlight - (4)' in 1ms.
Result: [
{
"kind": 1,
"range": {
"end": {
"character": 7,
"line": 5
},
"start": {
"character": 1,
"line": 5
}
}
}
]
[Trace - 10:34:45 PM] Sending request 'textDocument/definition - (5)'.
Params: {
"textDocument": {
"uri": "file:///home/user/HelloWorld/helloworld.c"
},
"position": {
"line": 5,
"character": 4
}
}
I[22:34:45.071] <-- textDocument/definition(5)
I[22:34:45.071] --> reply:textDocument/definition(5) 0 ms
[Trace - 10:34:45 PM] Received response 'textDocument/definition - (5)' in 1ms.
Result: [
{
"range": {
"end": {
"character": 17,
"line": 331
},
"start": {
"character": 11,
"line": 331
}
},
"uri": "file:///usr/include/stdio.h"
}
]
[Trace - 10:34:45 PM] Sending notification 'textDocument/didOpen'.
Params: {
"textDocument": {
"uri": "file:///usr/include/stdio.h",
"languageId": "cpp",
"version": 1,
"text": "/* Define ISO C stdio on top of C++ iostreams.\n Copyright (C) 1991-2020 Free Software Foundation, Inc.\n This file is part of the GNU C Library.\n\n The GNU C Library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation; either\n version 2.1 of the License, or (at your option) any later version.\n\n The GNU C Library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with the GNU C Library; if not, see\n <https://www.gnu.org/licenses/>. */\n\n/*\n *\tISO C99 Standard: 7.19 Input/output\t<stdio.h>\n */\n\n#ifndef _STDIO_H\n#define _STDIO_H\t1\n\n#define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION\n#include <bits/libc-header-start.h>\n\n__BEGIN_DECLS\n\n#define __need_size_t\n#define __need_NULL\n#include <stddef.h>\n\n#define __need___va_list\n#include <stdarg.h>\n\n#include <bits/types.h>\n#include <bits/types/__fpos_t.h>\n#include <bits/types/__fpos64_t.h>\n#include <bits/types/__FILE.h>\n#include <bits/types/FILE.h>\n#include <bits/types/struct_FILE.h>\n\n#ifdef __USE_GNU\n# include <bits/types/cookie_io_functions_t.h>\n#endif\n\n#if defined __USE_XOPEN || defined __USE_XOPEN2K8\n# ifdef __GNUC__\n# ifndef _VA_LIST_DEFINED\ntypedef __gnuc_va_list va_list;\n# define _VA_LIST_DEFINED\n# endif\n# else\n# include <stdarg.h>\n# endif\n#endif\n\n#if defined __USE_UNIX98 || defined __USE_XOPEN2K\n# ifndef __off_t_defined\n# ifndef __USE_FILE_OFFSET64\ntypedef __off_t off_t;\n# else\ntypedef __off64_t off_t;\n# endif\n# define __off_t_defined\n# endif\n# if defined __USE_LARGEFILE64 && !defined __off64_t_defined\ntypedef __off64_t off64_t;\n# define __off64_t_defined\n# endif\n#endif\n\n#ifdef __USE_XOPEN2K8\n# ifndef __ssize_t_defined\ntypedef __ssize_t ssize_t;\n# define __ssize_t_defined\n# endif\n#endif\n\n/* The type of the second argument to `fgetpos' and `fsetpos'. */\n#ifndef __USE_FILE_OFFSET64\ntypedef __fpos_t fpos_t;\n#else\ntypedef __fpos64_t fpos_t;\n#endif\n#ifdef __USE_LARGEFILE64\ntypedef __fpos64_t fpos64_t;\n#endif\n\n/* The possibilities for the third argument to `setvbuf'. */\n#define _IOFBF 0\t\t/* Fully buffered. */\n#define _IOLBF 1\t\t/* Line buffered. */\n#define _IONBF 2\t\t/* No buffering. */\n\n\n/* Default buffer size. */\n#define BUFSIZ 8192\n\n\n/* The value returned by fgetc and similar functions to indicate the\n end of the file. */\n#define EOF (-1)\n\n\n/* The possibilities for the third argument to `fseek'.\n These values should not be changed. */\n#define SEEK_SET\t0\t/* Seek from beginning of file. */\n#define SEEK_CUR\t1\t/* Seek from current position. */\n#define SEEK_END\t2\t/* Seek from end of file. */\n#ifdef __USE_GNU\n# define SEEK_DATA\t3\t/* Seek to next data. */\n# define SEEK_HOLE\t4\t/* Seek to next hole. */\n#endif\n\n\n#if defined __USE_MISC || defined __USE_XOPEN\n/* Default path prefix for `tempnam' and `tmpnam'. */\n# define P_tmpdir\t\"/tmp\"\n#endif\n\n\n/* Get the values:\n L_tmpnam\tHow long an array of chars must be to be passed to `tmpnam'.\n TMP_MAX\tThe minimum number of unique filenames generated by tmpnam\n\t\t(and tempnam when it uses tmpnam's name space),\n\t\tor tempnam (the two are separate).\n L_ctermid\tHow long an array to pass to `ctermid'.\n L_cuserid\tHow long an array to pass to `cuserid'.\n FOPEN_MAX\tMinimum number of files that can be open at once.\n FILENAME_MAX\tMaximum length of a filename. */\n#include <bits/stdio_lim.h>\n\n\n/* Standard streams. */\nextern FILE *stdin;\t\t/* Standard input stream. */\nextern FILE *stdout;\t\t/* Standard output stream. */\nextern FILE *stderr;\t\t/* Standard error output stream. */\n/* C89/C99 say they're macros. Make them happy. */\n#define stdin stdin\n#define stdout stdout\n#define stderr stderr\n\n/* Remove file FILENAME. */\nextern int remove (const char *__filename) __THROW;\n/* Rename file OLD to NEW. */\nextern int rename (const char *__old, const char *__new) __THROW;\n\n#ifdef __USE_ATFILE\n/* Rename file OLD relative to OLDFD to NEW relative to NEWFD. */\nextern int renameat (int __oldfd, const char *__old, int __newfd,\n\t\t const char *__new) __THROW;\n#endif\n\n#ifdef __USE_GNU\n/* Flags for renameat2. */\n# define RENAME_NOREPLACE (1 << 0)\n# define RENAME_EXCHANGE (1 << 1)\n# define RENAME_WHITEOUT (1 << 2)\n\n/* Rename file OLD relative to OLDFD to NEW relative to NEWFD, with\n additional flags. */\nextern int renameat2 (int __oldfd, const char *__old, int __newfd,\n\t\t const char *__new, unsigned int __flags) __THROW;\n#endif\n\n/* Create a temporary file and open it read/write.\n\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\n#ifndef __USE_FILE_OFFSET64\nextern FILE *tmpfile (void) __wur;\n#else\n# ifdef __REDIRECT\nextern FILE *__REDIRECT (tmpfile, (void), tmpfile64) __wur;\n# else\n# define tmpfile tmpfile64\n# endif\n#endif\n\n#ifdef __USE_LARGEFILE64\nextern FILE *tmpfile64 (void) __wur;\n#endif\n\n/* Generate a temporary filename. */\nextern char *tmpnam (char *__s) __THROW __wur;\n\n#ifdef __USE_MISC\n/* This is the reentrant variant of `tmpnam'. The only difference is\n that it does not allow S to be NULL. */\nextern char *tmpnam_r (char *__s) __THROW __wur;\n#endif\n\n\n#if defined __USE_MISC || defined __USE_XOPEN\n/* Generate a unique temporary filename using up to five characters of PFX\n if it is not NULL. The directory to put this file in is searched for\n as follows: First the environment variable \"TMPDIR\" is checked.\n If it contains the name of a writable directory, that directory is used.\n If not and if DIR is not NULL, that value is checked. If that fails,\n P_tmpdir is tried and finally \"/tmp\". The storage for the filename\n is allocated by `malloc'. */\nextern char *tempnam (const char *__dir, const char *__pfx)\n __THROW __attribute_malloc__ __wur;\n#endif\n\n\n/* Close STREAM.\n\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\nextern int fclose (FILE *__stream);\n/* Flush STREAM, or all streams if STREAM is NULL.\n\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\nextern int fflush (FILE *__stream);\n\n#ifdef __USE_MISC\n/* Faster versions when locking is not required.\n\n This function is not part of POSIX and therefore no official\n cancellation point. But due to similarity with an POSIX interface\n or due to the implementation it is a cancellation point and\n therefore not marked with __THROW. */\nextern int fflush_unlocked (FILE *__stream);\n#endif\n\n#ifdef __USE_GNU\n/* Close all streams.\n\n This function is not part of POSIX and therefore no official\n cancellation point. But due to similarity with an POSIX interface\n or due to the implementation it is a cancellation point and\n therefore not marked with __THROW. */\nextern int fcloseall (void);\n#endif\n\n\n#ifndef __USE_FILE_OFFSET64\n/* Open a file and create a new stream for it.\n\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\nextern FILE *fopen (const char *__restrict __filename,\n\t\t const char *__restrict __modes) __wur;\n/* Open a file, replacing an existing stream with it.\n\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\nextern FILE *freopen (const char *__restrict __filename,\n\t\t const char *__restrict __modes,\n\t\t FILE *__restrict __stream) __wur;\n#else\n# ifdef __REDIRECT\nextern FILE *__REDIRECT (fopen, (const char *__restrict __filename,\n\t\t\t\t const char *__restrict __modes), fopen64)\n __wur;\nextern FILE *__REDIRECT (freopen, (const char *__restrict __filename,\n\t\t\t\t const char *__restrict __modes,\n\t\t\t\t FILE *__restrict __stream), freopen64)\n __wur;\n# else\n# define fopen fopen64\n# define freopen freopen64\n# endif\n#endif\n#ifdef __USE_LARGEFILE64\nextern FILE *fopen64 (const char *__restrict __filename,\n\t\t const char *__restrict __modes) __wur;\nextern FILE *freopen64 (const char *__restrict __filename,\n\t\t\tconst char *__restrict __modes,\n\t\t\tFILE *__restrict __stream) __wur;\n#endif\n\n#ifdef\t__USE_POSIX\n/* Create a new stream that refers to an existing system file descriptor. */\nextern FILE *fdopen (int __fd, const char *__modes) __THROW __wur;\n#endif\n\n#ifdef\t__USE_GNU\n/* Create a new stream that refers to the given magic cookie,\n and uses the given functions for input and output. */\nextern FILE *fopencookie (void *__restrict __magic_cookie,\n\t\t\t const char *__restrict __modes,\n\t\t\t cookie_io_functions_t __io_funcs) __THROW __wur;\n#endif\n\n#if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2)\n/* Create a new stream that refers to a memory buffer. */\nextern FILE *fmemopen (void *__s, size_t __len, const char *__modes)\n __THROW __wur;\n\n/* Open a stream that writes into a malloc'd buffer that is expanded as\n necessary. *BUFLOC and *SIZELOC are updated with the buffer's location\n and the number of characters written on fflush or fclose. */\nextern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __THROW __wur;\n#endif\n\n\n/* If BUF is NULL, make STREAM unbuffered.\n Else make it use buffer BUF, of size BUFSIZ. */\nextern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __THROW;\n/* Make STREAM use buffering mode MODE.\n If BUF is not NULL, use N bytes of it for buffering;\n else allocate an internal buffer N bytes long. */\nextern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,\n\t\t int __modes, size_t __n) __THROW;\n\n#ifdef\t__USE_MISC\n/* If BUF is NULL, make STREAM unbuffered.\n Else make it use SIZE bytes of BUF for buffering. */\nextern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,\n\t\t size_t __size) __THROW;\n\n/* Make STREAM line-buffered. */\nextern void setlinebuf (FILE *__stream) __THROW;\n#endif\n\n\n/* Write formatted output to STREAM.\n\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\nextern int fprintf (FILE *__restrict __stream,\n\t\t const char *__restrict __format, ...);\n/* Write formatted output to stdout.\n\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\nextern int printf (const char *__restrict __format, ...);\n/* Write formatted output to S. */\nextern int sprintf (char *__restrict __s,\n\t\t const char *__restrict __format, ...) __THROWNL;\n\n/* Write formatted output to S from argument list ARG.\n\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\nextern int vfprintf (FILE *__restrict __s, const char *__restrict __format,\n\t\t __gnuc_va_list __arg);\n/* Write formatted output to stdout from argument list ARG.\n\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\nextern int vprintf (const char *__restrict __format, __gnuc_va_list __arg);\n/* Write formatted output to S from argument list ARG. */\nextern int vsprintf (char *__restrict __s, const char *__restrict __format,\n\t\t __gnuc_va_list __arg) __THROWNL;\n\n#if defined __USE_ISOC99 || defined __USE_UNIX98\n/* Maximum chars of output to write in MAXLEN. */\nextern int snprintf (char *__restrict __s, size_t __maxlen,\n\t\t const char *__restrict __format, ...)\n __THROWNL __attribute__ ((__format__ (__printf__, 3, 4)));\n\nextern int vsnprintf (char *__restrict __s, size_t __maxlen,\n\t\t const char *__restrict __format, __gnuc_va_list __arg)\n __THROWNL __attribute__ ((__format__ (__printf__, 3, 0)));\n#endif\n\n#if __GLIBC_USE (LIB_EXT2)\n/* Write formatted output to a string dynamically allocated with `malloc'.\n Store the address of the string in *PTR. */\nextern int vasprintf (char **__restrict __ptr, const char *__restrict __f,\n\t\t __gnuc_va_list __arg)\n __THROWNL __attribute__ ((__format__ (__printf__, 2, 0))) __wur;\nextern int __asprintf (char **__restrict __ptr,\n\t\t const char *__restrict __fmt, ...)\n __THROWNL __attribute__ ((__format__ (__printf__, 2, 3))) __wur;\nextern int asprintf (char **__restrict __ptr,\n\t\t const char *__restrict __fmt, ...)\n __THROWNL __attribute__ ((__format__ (__printf__, 2, 3))) __wur;\n#endif\n\n#ifdef __USE_XOPEN2K8\n/* Write formatted output to a file descriptor. */\nextern int vdprintf (int __fd, const char *__restrict __fmt,\n\t\t __gnuc_va_list __arg)\n __attribute__ ((__format__ (__printf__, 2, 0)));\nextern int dprintf (int __fd, const char *__restrict __fmt, ...)\n __attribute__ ((__format__ (__printf__, 2, 3)));\n#endif\n\n\n/* Read formatted input from STREAM.\n\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\nextern int fscanf (FILE *__restrict __stream,\n\t\t const char *__restrict __format, ...) __wur;\n/* Read formatted input from stdin.\n\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\nextern int scanf (const char *__restrict __format, ...) __wur;\n/* Read formatted input from S. */\nextern int sscanf (const char *__restrict __s,\n\t\t const char *__restrict __format, ...) __THROW;\n\n/* For historical reasons, the C99-compliant versions of the scanf\n functions are at alternative names. When __LDBL_COMPAT is in\n effect, this is handled in bits/stdio-ldbl.h. */\n#if !__GLIBC_USE (DEPRECATED_SCANF) && !defined __LDBL_COMPAT\n# ifdef __REDIRECT\nextern int __REDIRECT (fscanf, (FILE *__restrict __stream,\n\t\t\t\tconst char *__restrict __format, ...),\n\t\t __isoc99_fscanf) __wur;\nextern int __REDIRECT (scanf, (const char *__restrict __format, ...),\n\t\t __isoc99_scanf) __wur;\nextern int __REDIRECT_NTH (sscanf, (const char *__restrict __s,\n\t\t\t\t const char *__restrict __format, ...),\n\t\t\t __isoc99_sscanf);\n# else\nextern int __isoc99_fscanf (FILE *__restrict __stream,\n\t\t\t const char *__restrict __format, ...) __wur;\nextern int __isoc99_scanf (const char *__restrict __format, ...) __wur;\nextern int __isoc99_sscanf (const char *__restrict __s,\n\t\t\t const char *__restrict __format, ...) __THROW;\n# define fscanf __isoc99_fscanf\n# define scanf __isoc99_scanf\n# define sscanf __isoc99_sscanf\n# endif\n#endif\n\n#ifdef\t__USE_ISOC99\n/* Read formatted input from S into argument list ARG.\n\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\nextern int vfscanf (FILE *__restrict __s, const char *__restrict __format,\n\t\t __gnuc_va_list __arg)\n __attribute__ ((__format__ (__scanf__, 2, 0))) __wur;\n\n/* Read formatted input from stdin into argument list ARG.\n\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\nextern int vscanf (const char *__restrict __format, __gnuc_va_list __arg)\n __attribute__ ((__format__ (__scanf__, 1, 0))) __wur;\n\n/* Read formatted input from S into argument list ARG. */\nextern int vsscanf (const char *__restrict __s,\n\t\t const char *__restrict __format, __gnuc_va_list __arg)\n __THROW __attribute__ ((__format__ (__scanf__, 2, 0)));\n\n/* Same redirection as above for the v*scanf family. */\n# if !__GLIBC_USE (DEPRECATED_SCANF)\n# if defined __REDIRECT && !defined __LDBL_COMPAT\nextern int __REDIRECT (vfscanf,\n\t\t (FILE *__restrict __s,\n\t\t\tconst char *__restrict __format, __gnuc_va_list __arg),\n\t\t __isoc99_vfscanf)\n __attribute__ ((__format__ (__scanf__, 2, 0))) __wur;\nextern int __REDIRECT (vscanf, (const char *__restrict __format,\n\t\t\t\t__gnuc_va_list __arg), __isoc99_vscanf)\n __attribute__ ((__format__ (__scanf__, 1, 0))) __wur;\nextern int __REDIRECT_NTH (vsscanf,\n\t\t\t (const char *__restrict __s,\n\t\t\t const char *__restrict __format,\n\t\t\t __gnuc_va_list __arg), __isoc99_vsscanf)\n __attribute__ ((__format__ (__scanf__, 2, 0)));\n# elif !defined __REDIRECT\nextern int __isoc99_vfscanf (FILE *__restrict __s,\n\t\t\t const char *__restrict __format,\n\t\t\t __gnuc_va_list __arg) __wur;\nextern int __isoc99_vscanf (const char *__restrict __format,\n\t\t\t __gnuc_va_list __arg) __wur;\nextern int __isoc99_vsscanf (const char *__restrict __s,\n\t\t\t const char *__restrict __format,\n\t\t\t __gnuc_va_list __arg) __THROW;\n# define vfscanf __isoc99_vfscanf\n# define vscanf __isoc99_vscanf\n# define vsscanf __isoc99_vsscanf\n# endif\n# endif\n#endif /* Use ISO C9x. */\n\n\n/* Read a character from STREAM.\n\n These functions are possible cancellation points and therefore not\n marked with __THROW. */\nextern int fgetc (FILE *__stream);\nextern int getc (FILE *__stream);\n\n/* Read a character from stdin.\n\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\nextern int getchar (void);\n\n#ifdef __USE_POSIX199506\n/* These are defined in POSIX.1:1996.\n\n These functions are possible cancellation points and therefore not\n marked with __THROW. */\nextern int getc_unlocked (FILE *__stream);\nextern int getchar_unlocked (void);\n#endif /* Use POSIX. */\n\n#ifdef __USE_MISC\n/* Faster version when locking is not necessary.\n\n This function is not part of POSIX and therefore no official\n cancellation point. But due to similarity with an POSIX interface\n or due to the implementation it is a cancellation point and\n therefore not marked with __THROW. */\nextern int fgetc_unlocked (FILE *__stream);\n#endif /* Use MISC. */\n\n\n/* Write a character to STREAM.\n\n These functions are possible cancellation points and therefore not\n marked with __THROW.\n\n These functions is a possible cancellation point and therefore not\n marked with __THROW. */\nextern int fputc (int __c, FILE *__stream);\nextern int putc (int __c, FILE *__stream);\n\n/* Write a character to stdout.\n\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\nextern int putchar (int __c);\n\n#ifdef __USE_MISC\n/* Faster version when locking is not necessary.\n\n This function is not part of POSIX and therefore no official\n cancellation point. But due to similarity with an POSIX interface\n or due to the implementation it is a cancellation point and\n therefore not marked with __THROW. */\nextern int fputc_unlocked (int __c, FILE *__stream);\n#endif /* Use MISC. */\n\n#ifdef __USE_POSIX199506\n/* These are defined in POSIX.1:1996.\n\n These functions are possible cancellation points and therefore not\n marked with __THROW. */\nextern int putc_unlocked (int __c, FILE *__stream);\nextern int putchar_unlocked (int __c);\n#endif /* Use POSIX. */\n\n\n#if defined __USE_MISC \\\n || (defined __USE_XOPEN && !defined __USE_XOPEN2K)\n/* Get a word (int) from STREAM. */\nextern int getw (FILE *__stream);\n\n/* Write a word (int) to STREAM. */\nextern int putw (int __w, FILE *__stream);\n#endif\n\n\n/* Get a newline-terminated string of finite length from STREAM.\n\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\nextern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)\n __wur;\n\n#if __GLIBC_USE (DEPRECATED_GETS)\n/* Get a newline-terminated string from stdin, removing the newline.\n\n This function is impossible to use safely. It has been officially\n removed from ISO C11 and ISO C++14, and we have also removed it\n from the _GNU_SOURCE feature list. It remains available when\n explicitly using an old ISO C, Unix, or POSIX standard.\n\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\nextern char *gets (char *__s) __wur __attribute_deprecated__;\n#endif\n\n#ifdef __USE_GNU\n/* This function does the same as `fgets' but does not lock the stream.\n\n This function is not part of POSIX and therefore no official\n cancellation point. But due to similarity with an POSIX interface\n or due to the implementation it is a cancellation point and\n therefore not marked with __THROW. */\nextern char *fgets_unlocked (char *__restrict __s, int __n,\n\t\t\t FILE *__restrict __stream) __wur;\n#endif\n\n\n#if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2)\n/* Read up to (and including) a DELIMITER from STREAM into *LINEPTR\n (and null-terminate it). *LINEPTR is a pointer returned from malloc (or\n NULL), pointing to *N characters of space. It is realloc'd as\n necessary. Returns the number of characters read (not including the\n null terminator), or -1 on error or EOF.\n\n These functions are not part of POSIX and therefore no official\n cancellation point. But due to similarity with an POSIX interface\n or due to the implementation they are cancellation points and\n therefore not marked with __THROW. */\nextern __ssize_t __getdelim (char **__restrict __lineptr,\n size_t *__restrict __n, int __delimiter,\n FILE *__restrict __stream) __wur;\nextern __ssize_t getdelim (char **__restrict __lineptr,\n size_t *__restrict __n, int __delimiter,\n FILE *__restrict __stream) __wur;\n\n/* Like `getdelim', but reads up to a newline.\n\n This function is not part of POSIX and therefore no official\n cancellation point. But due to similarity with an POSIX interface\n or due to the implementation it is a cancellation point and\n therefore not marked with __THROW. */\nextern __ssize_t getline (char **__restrict __lineptr,\n size_t *__restrict __n,\n FILE *__restrict __stream) __wur;\n#endif\n\n\n/* Write a string to STREAM.\n\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\nextern int fputs (const char *__restrict __s, FILE *__restrict __stream);\n\n/* Write a string, followed by a newline, to stdout.\n\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\nextern int puts (const char *__s);\n\n\n/* Push a character back onto the input buffer of STREAM.\n\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\nextern int ungetc (int __c, FILE *__stream);\n\n\n/* Read chunks of generic data from STREAM.\n\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\nextern size_t fread (void *__restrict __ptr, size_t __size,\n\t\t size_t __n, FILE *__restrict __stream) __wur;\n/* Write chunks of generic data to STREAM.\n\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\nextern size_t fwrite (const void *__restrict __ptr, size_t __size,\n\t\t size_t __n, FILE *__restrict __s);\n\n#ifdef __USE_GNU\n/* This function does the same as `fputs' but does not lock the stream.\n\n This function is not part of POSIX and therefore no official\n cancellation point. But due to similarity with an POSIX interface\n or due to the implementation it is a cancellation point and\n therefore not marked with __THROW. */\nextern int fputs_unlocked (const char *__restrict __s,\n\t\t\t FILE *__restrict __stream);\n#endif\n\n#ifdef __USE_MISC\n/* Faster versions when locking is not necessary.\n\n These functions are not part of POSIX and therefore no official\n cancellation point. But due to similarity with an POSIX interface\n or due to the implementation they are cancellation points and\n therefore not marked with __THROW. */\nextern size_t fread_unlocked (void *__restrict __ptr, size_t __size,\n\t\t\t size_t __n, FILE *__restrict __stream) __wur;\nextern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size,\n\t\t\t size_t __n, FILE *__restrict __stream);\n#endif\n\n\n/* Seek to a certain position on STREAM.\n\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\nextern int fseek (FILE *__stream, long int __off, int __whence);\n/* Return the current position of STREAM.\n\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\nextern long int ftell (FILE *__stream) __wur;\n/* Rewind to the beginning of STREAM.\n\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\nextern void rewind (FILE *__stream);\n\n/* The Single Unix Specification, Version 2, specifies an alternative,\n more adequate interface for the two functions above which deal with\n file offset. `long int' is not the right type. These definitions\n are originally defined in the Large File Support API. */\n\n#if defined __USE_LARGEFILE || defined __USE_XOPEN2K\n# ifndef __USE_FILE_OFFSET64\n/* Seek to a certain position on STREAM.\n\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\nextern int fseeko (FILE *__stream, __off_t __off, int __whence);\n/* Return the current position of STREAM.\n\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\nextern __off_t ftello (FILE *__stream) __wur;\n# else\n# ifdef __REDIRECT\nextern int __REDIRECT (fseeko,\n\t\t (FILE *__stream, __off64_t __off, int __whence),\n\t\t fseeko64);\nextern __off64_t __REDIRECT (ftello, (FILE *__stream), ftello64);\n# else\n# define fseeko fseeko64\n# define ftello ftello64\n# endif\n# endif\n#endif\n\n#ifndef __USE_FILE_OFFSET64\n/* Get STREAM's position.\n\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\nextern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos);\n/* Set STREAM's position.\n\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\nextern int fsetpos (FILE *__stream, const fpos_t *__pos);\n#else\n# ifdef __REDIRECT\nextern int __REDIRECT (fgetpos, (FILE *__restrict __stream,\n\t\t\t\t fpos_t *__restrict __pos), fgetpos64);\nextern int __REDIRECT (fsetpos,\n\t\t (FILE *__stream, const fpos_t *__pos), fsetpos64);\n# else\n# define fgetpos fgetpos64\n# define fsetpos fsetpos64\n# endif\n#endif\n\n#ifdef __USE_LARGEFILE64\nextern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);\nextern __off64_t ftello64 (FILE *__stream) __wur;\nextern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);\nextern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);\n#endif\n\n/* Clear the error and EOF indicators for STREAM. */\nextern void clearerr (FILE *__stream) __THROW;\n/* Return the EOF indicator for STREAM. */\nextern int feof (FILE *__stream) __THROW __wur;\n/* Return the error indicator for STREAM. */\nextern int ferror (FILE *__stream) __THROW __wur;\n\n#ifdef __USE_MISC\n/* Faster versions when locking is not required. */\nextern void clearerr_unlocked (FILE *__stream) __THROW;\nextern int feof_unlocked (FILE *__stream) __THROW __wur;\nextern int ferror_unlocked (FILE *__stream) __THROW __wur;\n#endif\n\n\n/* Print a message describing the meaning of the value of errno.\n\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\nextern void perror (const char *__s);\n\n/* Provide the declarations for `sys_errlist' and `sys_nerr' if they\n are available on this system. Even if available, these variables\n should not be used directly. The `strerror' function provides\n all the necessary functionality. */\n#include <bits/sys_errlist.h>\n\n\n#ifdef\t__USE_POSIX\n/* Return the system file descriptor for STREAM. */\nextern int fileno (FILE *__stream) __THROW __wur;\n#endif /* Use POSIX. */\n\n#ifdef __USE_MISC\n/* Faster version when locking is not required. */\nextern int fileno_unlocked (FILE *__stream) __THROW __wur;\n#endif\n\n\n#ifdef __USE_POSIX2\n/* Create a new stream connected to a pipe running the given command.\n\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\nextern FILE *popen (const char *__command, const char *__modes) __wur;\n\n/* Close a stream opened by popen and return the status of its child.\n\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\nextern int pclose (FILE *__stream);\n#endif\n\n\n#ifdef\t__USE_POSIX\n/* Return the name of the controlling terminal. */\nextern char *ctermid (char *__s) __THROW;\n#endif /* Use POSIX. */\n\n\n#if (defined __USE_XOPEN && !defined __USE_XOPEN2K) || defined __USE_GNU\n/* Return the name of the current user. */\nextern char *cuserid (char *__s);\n#endif /* Use X/Open, but not issue 6. */\n\n\n#ifdef\t__USE_GNU\nstruct obstack;\t\t\t/* See <obstack.h>. */\n\n/* Write formatted output to an obstack. */\nextern int obstack_printf (struct obstack *__restrict __obstack,\n\t\t\t const char *__restrict __format, ...)\n __THROWNL __attribute__ ((__format__ (__printf__, 2, 3)));\nextern int obstack_vprintf (struct obstack *__restrict __obstack,\n\t\t\t const char *__restrict __format,\n\t\t\t __gnuc_va_list __args)\n __THROWNL __attribute__ ((__format__ (__printf__, 2, 0)));\n#endif /* Use GNU. */\n\n\n#ifdef __USE_POSIX199506\n/* These are defined in POSIX.1:1996. */\n\n/* Acquire ownership of STREAM. */\nextern void flockfile (FILE *__stream) __THROW;\n\n/* Try to acquire ownership of STREAM but do not block if it is not\n possible. */\nextern int ftrylockfile (FILE *__stream) __THROW __wur;\n\n/* Relinquish the ownership granted for STREAM. */\nextern void funlockfile (FILE *__stream) __THROW;\n#endif /* POSIX */\n\n#if defined __USE_XOPEN && !defined __USE_XOPEN2K && !defined __USE_GNU\n/* X/Open Issues 1-5 required getopt to be declared in this\n header. It was removed in Issue 6. GNU follows Issue 6. */\n# include <bits/getopt_posix.h>\n#endif\n\n/* Slow-path routines used by the optimized inline functions in\n bits/stdio.h. */\nextern int __uflow (FILE *);\nextern int __overflow (FILE *, int);\n\n/* If we are compiling with optimizing read this file. It contains\n several optimizing inline functions and macros. */\n#ifdef __USE_EXTERN_INLINES\n# include <bits/stdio.h>\n#endif\n#if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function\n# include <bits/stdio2.h>\n#endif\n#ifdef __LDBL_COMPAT\n# include <bits/stdio-ldbl.h>\n#endif\n\n__END_DECLS\n\n#endif /* <stdio.h> included. */\n"
}
}
I[22:34:45.322] <-- textDocument/didOpen
I[22:34:45.322] Failed to find compilation database for /usr/include/stdio.h
I[22:34:45.322] Updating file /usr/include/stdio.h with command clangd fallback
[/usr/include]
/usr/bin/clang -xobjective-c++-header /usr/include/stdio.h -fsyntax-only -resource-dir=/usr/lib/clang/9.0.1
I[22:34:45.368] --> textDocument/publishDiagnostics
[Trace - 10:34:45 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
"diagnostics": [],
"uri": "file:///usr/include/stdio.h"
}
[Trace - 10:34:47 PM] Sending request 'textDocument/hover - (6)'.
Params: {
"textDocument": {
"uri": "file:///home/user/HelloWorld/helloworld.c"
},
"position": {
"line": 5,
"character": 4
}
}
I[22:34:47.334] <-- textDocument/hover(6)
I[22:34:47.334] --> reply:textDocument/hover(6) 0 ms
[Trace - 10:34:47 PM] Received response 'textDocument/hover - (6)' in 2ms.
Result: {
"contents": {
"kind": "markdown",
"value": "Declared in `global namespace`\n```cpp\nextern int printf(const char *, ...)\n```\nWrite formatted output to stdout\\.\n\nThis function is a possible cancellation point and therefore not\nmarked with \\_\\_THROW\\. "
},
"range": {
"end": {
"character": 7,
"line": 5
},
"start": {
"character": 1,
"line": 5
}
}
}
[Trace - 10:34:47 PM] Sending request 'textDocument/documentHighlight - (7)'.
Params: {
"textDocument": {
"uri": "file:///home/user/HelloWorld/helloworld.c"
},
"position": {
"line": 5,
"character": 4
}
}
I[22:34:47.752] <-- textDocument/documentHighlight(7)
I[22:34:47.752] --> reply:textDocument/documentHighlight(7) 0 ms
[Trace - 10:34:47 PM] Received response 'textDocument/documentHighlight - (7)' in 1ms.
Result: [
{
"kind": 1,
"range": {
"end": {
"character": 7,
"line": 5
},
"start": {
"character": 1,
"line": 5
}
}
}
]
[Trace - 10:34:48 PM] Sending request 'textDocument/documentHighlight - (8)'.
Params: {
"textDocument": {
"uri": "file:///home/user/HelloWorld/helloworld.c"
},
"position": {
"line": 5,
"character": 4
}
}
I[22:34:48.923] <-- textDocument/documentHighlight(8)
I[22:34:48.923] --> reply:textDocument/documentHighlight(8) 0 ms
[Trace - 10:34:48 PM] Received response 'textDocument/documentHighlight - (8)' in 1ms.
Result: [
{
"kind": 1,
"range": {
"end": {
"character": 7,
"line": 5
},
"start": {
"character": 1,
"line": 5
}
}
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment