Closed zongtaowang closed 2 days ago
Please confirm that your lsp environment is properly loaded and your lsp server is connected.
This is when you enter "," you should see the which key window.
If not there is an issue in loading your config and you have to check your message buffer for errors.
Please confirm that your lsp environment is properly loaded and your lsp server is connected.
This is when you enter "," you should see the which key window.
If not there is an issue in loading your config and you have to check your message buffer for errors.
Thank you for your suggestion. I believe that the lsp environment has been properly loaded. I am able to utilize other lsp commands. For instance, by typing ,=b
, I can successfully run lsp-format-buffer
command. Additionally, I have inspected the message buffer and found no errors either. By the way, what is displayed when you type ,c
? In my situation, it shows the key window, but there is no command under the 'compile' leader key.
This seems to be working for me. When I do SPC c I am seeing cmake-ide-compile. Here is my config:
(c-c++ :variables
c-c++-default-mode-for-headers 'c++-mode
c-c++-backend 'lsp-clangd
c-c++-lsp-enable-semantic-highlight 'rainbow
c++-enable-organize-includes-on-save t
c-c++-enable-clang-format-on-save t
c-c++-adopt-subprojects t)
I have used this simple c file for testing:
#include <stdio.h>
#include <stdlib.h>
int main(void) {
char buffer[5];
FILE *fp = fopen("myfile", "rb");
if (fp == NULL) {
perror("Failed to open file \"myfile\"");
return EXIT_FAILURE;
}
if (fread(buffer, 1, 5, fp) < 5) {
fputs("An error occurred while reading the file.\n", stderr);
return EXIT_FAILURE;
}
fclose(fp);
printf("The bytes read were: ");
for (int i = 0; i < 5; ++i) {
printf("%02X ", buffer[i]);
}
putchar('\n');
return EXIT_SUCCESS;
}
I am also running clangd as lsp server.
Is there an error message in your message buffer?
Description :octocat:
[c-c++] layer the compile command is not defined
Reproduction guide :beetle:
,c
, then the minibuffer shows ", c- which-key: There are no keys to show"Observed behaviour: :eyes: :broken_heart: There is no command under "compile" leader key Expected behaviour: :heart: :smile: I think it should show a pop window that lists the candidate command for compile the test.c file, and then another pop up windows to run the compiled file.
System Info :computer:
Backtrace :paw_prints: