-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error: '_stricmp' was not declared in this scope #35
Comments
can you help to fix all of this, and push a request. I didn't have windows PC now . I only have macbook. |
I am a beginner in C++, though I am trying, If I succeed, I'll send a PR |
I didn't build lsp with clion. I alway build with vs. |
Open cmd or powershell and generate visual studio project with CMake. |
then build with visual studio |
lsp need boost , it's easy to get boost lib with visual studio on windows. |
The above errors may have occurred due to my faulty setup with boost and CLion or me not using the visual studio toolchain. I have now run the server, It works, Server started, also printed the address and port to console, connected to a visual studio code host. I have added this code to start a websocket server The only problem is that when the program starts, with initialize request std::cout is not printed to console, Not a single request prints to console, Its also kind of different from document didChange, didOpen server.point.registerHandler(
[&](const td_initialize::request &req) {
std::cout << "[Request] td_initialize\n";
td_initialize::response rsp;
CodeLensOptions code_lens_options;
code_lens_options.resolveProvider = true;
rsp.result.capabilities.codeLensProvider = code_lens_options;
return rsp;
});
server.point.registerHandler(
[&](const td_semanticTokens_full::request &request) {
std::cout << "[Request] td_semanticTokens_full\n";
td_semanticTokens_full::response rsp;
return rsp;
});
server.point.registerHandler(
[&](const td_semanticTokens_full_delta::request &request) {
std::cout << "[Request] td_semanticTokens_full_delta\n";
td_semanticTokens_full_delta::response rsp;
return rsp;
});
server.point.registerHandler(
[&](const td_completion::request &request) {
std::cout << "[Request] td_completion\n";
td_completion::response rsp;
return rsp;
});
server.point.registerHandler(
[&](const td_signatureHelp::request &request) {
std::cout << "[Request] td_signatureHelp\n";
td_signatureHelp::response rsp;
return rsp;
});
server.point.registerHandler(
[&](const td_symbol::request &request) {
std::cout << "[Request] td_symbol\n";
td_symbol::response rsp;
return rsp;
});
server.point.registerHandler(
[&](const td_typeHierarchy::request &request) {
std::cout << "[Request] td_typeHierarchy\n";
td_typeHierarchy::response rsp;
return rsp;
});
// std::thread([&]() {
server.run();
// }).detach(); |
I'd prefer that there is an example that clearly states the usage of the whole thing by writing a very bare bones implementation
Could you please do this, This would make it easier for me to extend this project. |
|
Hi @kuafuwang I get this message in the console and the program shuts down Unknown notification message : {"jsonrpc":"2.0","method":"$/setTrace","params":{"value":"off"}} |
you can register notificaition handler to handler it. |
Somehow I'm not receiving a semanticTokens/full request from the client Visual Studio Code Can you check it out, What am I doing wrong ? https://github.com/Qinetik/chemical-vscode As you can see I've written the code to provide semantic tokens for a single statement, just to test, However I'm not receiving the semantic tokens request even though, I have sent true for full : semantic tokens in capabilities. I've copied the some code from LPG server repository. I just want to get setup so I can write my own programming language. However its making me go crazy ! |
I have try . But i didn't know why. It should send TextDocumentDidOpen notify first. but it didn't . You need to find out why the TextDocumentDidOpen notify didn't send by vscode. And i am buzy these day . It's chinese year now, i need to deal some thing. |
semanticTokens range request ... ? |
Also when the user is editing the document, server sends a semanticTokens request with textDocument containing its uri However when I read the uri & source code from the file, it's not upto the current edits of the editor, So my tokens provide syntax highlighting for the previous source code which doesn't fit the current source code (in the editor, not saved) !! How can I fix this...? Do I need to implement some other request ? |
you could drop the outdate request, only return recent request. using document version to fix it. |
I don't understand what you mean... When I access the file, the source code is old. Unless user saved the file using ctrl + s and then the new source code is sent |
I have registered the request like this _sp.registerHandler([&](Notify_TextDocumentDidChange::notify ¬ify) {
_log.log(lsp::Log::Level::INFO, "TextDocumentDidChange Received 1");
if (need_initialize_error) {
return;
}
_log.log(lsp::Log::Level::INFO, "TextDocumentDidChange Received");
const auto ¶ms = notify.params;
AbsolutePath path = params.textDocument.uri.GetAbsolutePath();
if (ShouldIgnoreFileForIndexing(path))
return;
// work_space_mgr.OnChange(params);
}); and I'm getting the following in my console
I don't understand what do you mean by "track the change", To track the change I'm adding this request handler, But its not getting triggered. In the above code snippet you shared OnChange function, that's present in the library, what do I do with it Checkout |
on my computer, I am not getting
|
The console output for (opening a file, changing something and then closing it), None of the requests handlers get triggered
|
I just registered didOpen to be sent from vscode extension and it is also printing the same errror ! I don't understand why it works on your machine and doesn't work on mine 1 - you are using a different version of vscode which sends a different request than mine (I'm using the latest 1.86.2) 2 - the lsp has some platform specific code that is causing a problem ! (I'm using windows) You can checkout the repositories, I've updated the code |
Also Now I'm getting
When I open the vscode, I make the change to the sample, which sends two on change requests to the server, first on change request contains zero changes , you can see in debug console, the second on change request contains a single change, which causes this assertion error Try removing the "int" in sample.ch file when vscode instance opens, pull the latest code... I believe this error is not being caused by my code |
the uir is wrong format that in LSP spec. You need to debug it youself. You shouldn't send request or notify by yourself. you just need to |
microsoft/vscode#204906 (comment) I think I'll be able to continue along with this since vscode is working & sending requests ! I'll produce a small language server that supports at least these features and keep it open source as MIT 1 - semantic highlighting |
This error occurs when I'm building the code using Cmake on Windows
The code is
The text was updated successfully, but these errors were encountered: