Recent Posts

Pages: 1 [2] 3 4 5 6 7 ... 10
11
Plugins development / Re: Code completion using LSP and clangd
« Last post by MaxGaspa on Yesterday at 02:46:09 pm »
@pecan

I'm observing another issue using the clangd plugin.

Using a std::vector the list of functions shown are listed in alphabetical order but it seems there is a maximum number of list members. Look at the attached images, all the functions after max_size() are not listed. For example push_back() is not listed but if I write "push" after the dot the plugin is correctly suggesting push_back (look at the attached images).

So it seems that the plugin knows the function push_back() exists but is not showing in the full list.

Is there a way to increase the number of items in the list? Is that limitation intentional?

12
General (but related to Code::Blocks) / Re: Questions
« Last post by Miguel Gimenez on Yesterday at 11:50:38 am »
The scaling factor is OS-dependent, you can change it in your screen settings. C::B only reports the value supplied by the OS. Values bigger than 1.00 are associated to HiDPI.
13
General (but related to Code::Blocks) / Questions
« Last post by MaxGaspa on Yesterday at 10:57:43 am »
Dear CB devs

Just a couple of questions...

1) Starting CB I read the following message

Initial scaling factor is 1.500 (actual: 1.500)

What is the "scaling factor"? Is there an option to change it? I'm unable to find any setting related to it

2) Is it possible to change the font size in the "Watches" window during debugging? I changed the font size in both log panel and editor but the font size in watches is too small to read easily the text, using large monitor. Is it possible to change the font type for the watches window? I'm using Source Code Pro for the editor and it is very comfortable.

Thank you in advance....

Max

14
Help / Re: Console does not display on Mac when running C code
« Last post by AndrewCot on Yesterday at 02:25:33 am »
Please install the latest nighty as the issue is fixed in it.
15
Help / Re: Console does not display on Mac when running C code
« Last post by xtie8319 on Yesterday at 12:23:46 am »
I have the same error when running the code on MACOS Big Sur. :(


-------------- Build: Debug in C (compiler: GNU GCC Compiler)---------------

gcc -Wall -g  -c /Users/Caroline/Desktop/C:C++/C/main.c -o obj/Debug/main.o
g++  -o bin/Debug/C obj/Debug/main.o   
Output file is bin/Debug/C with size 48.49 KB
Process terminated with status 0 (0 minute(s), 1 second(s))
0 error(s), 0 warning(s) (0 minute(s), 1 second(s))
 

-------------- Run: Debug in C (compiler: GNU GCC Compiler)---------------

Checking for existence: /Users/Caroline/Desktop/C:C++/C/bin/Debug/C
Executing: osascript -e 'tell app "Terminal"' -e 'activate' -e 'do script quoted form of "/Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:. /Users/Caroline/Desktop/C:C++/C/bin/Debug/C "' -e 'end tell'  (in /Users/Caroline/Desktop/C:C++/C/.)
Process terminated with status 0 (0 minute(s), 0 second(s))
 
16
Plugins development / Re: Code completion using LSP and clangd
« Last post by ollydbg on October 04, 2022, 01:21:01 pm »
I created a patch which can show the "doxygen comments".

Code
 clangd_client/src/codecompletion/parser/parser.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/clangd_client/src/codecompletion/parser/parser.cpp b/clangd_client/src/codecompletion/parser/parser.cpp
index 6852ee2..4706432 100644
--- a/clangd_client/src/codecompletion/parser/parser.cpp
+++ b/clangd_client/src/codecompletion/parser/parser.cpp
@@ -2563,13 +2563,14 @@ void Parser::OnLSP_HoverResponse(wxCommandEvent& event, std::vector<ClgdCCToken>
         wxString hoverText;
         for (size_t ii=0, foundIn=false; ii<vHoverInfo.size(); ++ii)
         {
-            if (ii < 2) hoverText += vHoverInfo[ii] + "\n"; //type and return value
             if (vHoverInfo[ii].StartsWith("// In "))    //parent
             {
                 hoverText += vHoverInfo[ii] += "\n";
                 foundIn = true; continue;
             }
-            if (foundIn) hoverText += vHoverInfo[ii] + "\n";;
+            if (foundIn) hoverText += vHoverInfo[ii] + "\n";
+
+            if (ii < 3) hoverText += vHoverInfo[ii] + "\n"; //type and return value  [0]: kind, [1]: type, [2]: comments
         }//endfor vHoverInfo
 
         v_HoverTokens.push_back(ClgdCCToken(0, hoverText, hoverText));


Normally, I see that

Code
variable m_AAA\n\nType: int\nABCDEFG\n\nint m_AAA

There are 3 sections separated by "\n\n", first: "variable m_AAA", second: "Type: int\nABCDEFG", and third: "int m_AAA". Basically the first two sections are needed.

There is two ";" in the original statement, this should be fixed.
17
Plugins development / Re: Code completion using LSP and clangd
« Last post by MaxGaspa on October 04, 2022, 11:27:44 am »
@pecan,

I observed an unexpected behavior (i would say a bug) using the latest nightly and latest plugin. I'm observing the issue using both win7 SP1 or Win10 Enterprise.

After I opened a project the plugin started to parse the files starting from "62 more" ....in the meantime I launch the related executable (compiled before). The parser stopped. During the stopping phase the parser is parsing some files without updating the remaining file counter (repeating "59 more")

After closing the executable, the parser didn't restarted, It stayed sleeping. I used the option "Reparse the project" but the new parser was not starting. I opened one of the project's file (Main.cpp) and the parser parsed the opened file (restarting the remaining file counter from 66, not 62!!!! ( the previous starting number)  but then stopped.

I closed Main.cpp and used several times "reparse the project" without success. I closed the project and the reopened it....the parser didn't start.

Then if I close CB and running a new CB loading the same projects used before I got the parser correctly parsing all files form 66 to 0.

I'm attaching the log from CB.

Hope this helps to reproduce the issue (It seems reproducible). I'm using 0 threads while compiling (and running?) and 6 threads concurrently parsing.

It seems there is some "memory" of the past parsing even if I delete the parser....

Max
18
Plugins development / Re: Code completion using LSP and clangd
« Last post by ollydbg on October 04, 2022, 09:11:14 am »
I did some extra test of how to show the comments.

Here is the log file from CBclangd_client-xxxxx.log:

Code
{"id":"textDocument/hover","jsonrpc":"2.0","method":"textDocument/hover","params":{"position":{"character":4,"line":3},"textDocument":{"uri":"file:///F:/code/test_clangd_client_tipwin/main.cpp"}}}

15:06:48.772 >>> readJson() len:220:
{"id":"textDocument/hover","jsonrpc":"2.0","result":{"contents":{"kind":"plaintext","value":"variable m_AAA\n\nType: int\nABCDEFG\n\nint m_AAA"},"range":{"end":{"character":9,"line":3},"start":{"character":4,"line":3}}}}

15:07:41.294 <<< Hover:
file:///F:/code/test_clangd_client_tipwin/main.cpp,line[1], char[4]

15:07:41.294 <<< Content-Length: 196



{"id":"textDocument/hover","jsonrpc":"2.0","method":"textDocument/hover","params":{"position":{"character":4,"line":1},"textDocument":{"uri":"file:///F:/code/test_clangd_client_tipwin/main.cpp"}}}

15:07:41.524 >>> readJson() len:240:
{"id":"textDocument/hover","jsonrpc":"2.0","result":{"contents":{"kind":"plaintext","value":"variable m_TcpFile\n\nType: int\nTCP鎺ユ敹鐨勬暟鎹甛n\nint m_TcpFile"},"range":{"end":{"character":13,"line":1},"start":{"character":4,"line":1}}}}

and here is the test code:
Code

int m_TcpFile;  ///< TCP接收的数据

int m_AAA; ///< ABCDEFG

int main()
{
    return 0;
}




You can see, when I hover on the variable "m_TcpFile", the received json contains some wrong contents, I'm not sure why it is not shown in Chinese.
While, for the variable "m_AAA", it shows the "ABCDEFG" correctly.


EDIT

It looks like we just drop the text returned from clangd, after the second \n

Here is the screen shot(in attachment)

The source code looks like in parser.cpp line 2553

Code
        // Example Hover contents: L"instance-method HelloWxWorldFrame::OnAbout\n\nType: void\nParameters:\n- wxCommandEvent & event\n\n// In HelloWxWorldFrame\nprivate: void HelloWxWorldFrame::OnAbout(wxCommandEvent &event)"
        // get string array of hover info separated at /n chars.
        wxString hoverString = contentsValue;
        hoverString.Replace("\n\n", "\n"); //remove double newline chars
        wxArrayString vHoverInfo = GetArrayFromString(hoverString, "\n");

        // **Debugging**
        // LogManager* pLogMgr = Manager::Get()->GetLogManager();
        //    for (size_t ii=0; ii<vHoverInfo.size(); ++ii)
        //        pLogMgr->DebugLog(wxString::Format("vHoverInfo[%d]:%s", int(ii), vHoverInfo[ii]));

        // Find items from hover data and cut the chaff
        wxString hoverText;
        for (size_t ii=0, foundIn=false; ii<vHoverInfo.size(); ++ii)
        {
            if (ii < 2) hoverText += vHoverInfo[ii] + "\n"; //type and return value
            if (vHoverInfo[ii].StartsWith("// In "))    //parent
            {
                hoverText += vHoverInfo[ii] += "\n";
                foundIn = true; continue;
            }
            if (foundIn) hoverText += vHoverInfo[ii] + "\n";;
        }//endfor vHoverInfo

        v_HoverTokens.push_back(ClgdCCToken(0, hoverText, hoverText));
19
General (but related to Code::Blocks) / Re: Are Scripted Wizards without license?
« Last post by ollydbg on October 04, 2022, 08:03:24 am »
My guess is that the Scripted file should be in GPL, and the template source code(sample.cpp files) should be public domain.
20
Plugins development / Re: Code completion using LSP and clangd
« Last post by ollydbg on October 04, 2022, 02:43:39 am »
Hi, pecan, thanks for the fix.

rev 82 works OK.

BTW, Is it possible to show the doxygen document in the tip window? Maybe, clangd already send to us? Thanks.

EDIT:

It looks like this clangd issue in github is related: Doxygen parsing missing Issue #529 clangd/clangd
Pages: 1 [2] 3 4 5 6 7 ... 10