Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

Code completion using LSP and clangd

<< < (65/92) > >>

ollydbg:
Oh, thanks for the help. I looked at my local commits, and this is the only change I made to PlatWX.cpp, which I try to enable the font smooth. I don't have other changes to scintilla related code.


--- Code: ---diff --git a/src/sdk/wxscintilla/src/PlatWX.cpp b/src/sdk/wxscintilla/src/PlatWX.cpp
index 247b558c..66d64375 100644
--- a/src/sdk/wxscintilla/src/PlatWX.cpp
+++ b/src/sdk/wxscintilla/src/PlatWX.cpp
@@ -198,7 +198,30 @@ void Font::Create(const FontParameters &fp) {
         false,
         sci2wx(fp.faceName),
         encoding);
+
+#ifdef __WXMSW__
+    // enable the smooth font on Windows by default
+    // font rendering issue when using C::B under windows remote desktop
+    // https://forums.codeblocks.org/index.php/topic,25146.msg171484.html#msg171484
+
+    wxString nativeDesc = font.GetNativeFontInfoDesc();
+    int index = 0;
+    for (size_t pos = 0, start = 0; pos <= nativeDesc.length(); )
+    {
+        pos = nativeDesc.find(";", start);
+        index++;
+        if (index == 14) // the index 14 for wx 3.2.1
+        {
+            // enable the cleartype option of the font
+            nativeDesc.replace(start, pos - start, "5");
+            bool result = font.SetNativeFontInfo(nativeDesc);
+            break;
+        }
+        start = pos+1;
+    }
+#endif // __WXMSW__
     wxFontWithAscent* newFont = new wxFontWithAscent(font);
+
     fid = newFont;
 
 #ifdef HAVE_DIRECTWRITE_TECHNOLOGY

--- End code ---

Pecan:

--- Quote from: ollydbg on September 27, 2023, 04:54:19 pm ---Oh, thanks for the help. I looked at my local commits, and this is the only change I made to PlatWX.cpp, which I try to enable the font smooth. I don't have other changes to scintilla related code.


--- Code: ---diff --git a/src/sdk/wxscintilla/src/PlatWX.cpp b/src/sdk/wxscintilla/src/PlatWX.cpp
index 247b558c..66d64375 100644
--- a/src/sdk/wxscintilla/src/PlatWX.cpp
+++ b/src/sdk/wxscintilla/src/PlatWX.cpp
@@ -198,7 +198,30 @@ void Font::Create(const FontParameters &fp) {
         false,
         sci2wx(fp.faceName),
         encoding);
+
+#ifdef __WXMSW__
+    // enable the smooth font on Windows by default
+    // font rendering issue when using C::B under windows remote desktop
+    // https://forums.codeblocks.org/index.php/topic,25146.msg171484.html#msg171484
+
+    wxString nativeDesc = font.GetNativeFontInfoDesc();
+    int index = 0;
+    for (size_t pos = 0, start = 0; pos <= nativeDesc.length(); )
+    {
+        pos = nativeDesc.find(";", start);
+        index++;
+        if (index == 14) // the index 14 for wx 3.2.1
+        {
+            // enable the cleartype option of the font
+            nativeDesc.replace(start, pos - start, "5");
+            bool result = font.SetNativeFontInfo(nativeDesc);
+            break;
+        }
+        start = pos+1;
+    }
+#endif // __WXMSW__
     wxFontWithAscent* newFont = new wxFontWithAscent(font);
+
     fid = newFont;
 
 #ifdef HAVE_DIRECTWRITE_TECHNOLOGY

--- End code ---

--- End quote ---

@ollydbg
After many hours, I cannot re-create the error.

Then the only action left is to run both CodeBlocks and clangd_client in "-g" mode in order to catch the assert/crash.

Just copy the devel32_64 versions of them to your release folder after running update32_64.bat.

When the assert happens, click continue and you should get a .RPT with all the line numbers in the backtrace.

ollydbg:
I see an issue which I guess it comes from the BrowseTracker plugin when using Clangd_Client plugin.

When I right click on a symbol(such as a function name), and select "goto definition" in the context menu, the Clangd_Client plugin did bring me to the function definition, that's good.

But when I click the toolbar(the toolbar from BrowseTracker plugin) Jump back, it does not go back to the place where I did the right click. I have to click the Jump back button several times to go back to the original place.

Do you guys see such issue?

Thanks.

Pecan:

--- Quote from: ollydbg on October 22, 2023, 04:32:21 am ---I see an issue which I guess it comes from the BrowseTracker plugin when using Clangd_Client plugin.

When I right click on a symbol(such as a function name), and select "goto definition" in the context menu, the Clangd_Client plugin did bring me to the function definition, that's good.

But when I click the toolbar(the toolbar from BrowseTracker plugin) Jump back, it does not go back to the place where I did the right click. I have to click the Jump back button several times to go back to the original place.

Do you guys see such issue?

Thanks.

--- End quote ---


Yes, I've experienced this. But it may not have anything to do with Clangd_client.
I think it's a problem in BrowseTracker itself.
I'll look into it.

Thanks for the report.

Pecan:
@ ollydbg


--- Quote from: ollydbg on October 22, 2023, 04:32:21 am ---I see an issue which I guess it comes from the BrowseTracker plugin when using Clangd_Client plugin.

When I right click on a symbol(such as a function name), and select "goto definition" in the context menu, the Clangd_Client plugin did bring me to the function definition, that's good.

But when I click the toolbar(the toolbar from BrowseTracker plugin) Jump back, it does not go back to the place where I did the right click. I have to click the Jump back button several times to go back to the original place.

Do you guys see such issue?

Thanks.

--- End quote ---

@ ollydbg
Would you place the following "return;" mod in JumpTracker.cpp and see if it solves this problem for you.


--- Code: ---Index: JumpTracker.cpp
===================================================================
--- JumpTracker.cpp (revision 13374)
+++ JumpTracker.cpp (working copy)
@@ -458,6 +458,11 @@
 void JumpTracker::OnEditorActivated(CodeBlocksEvent& event)
 // ----------------------------------------------------------------------------
 {
+    // This is causing the new activated editor to enter it's current line location //(ph 2023/10/22)
+    // before entering the clangd_client target of "Find declaration" causing the next
+    // jump back to jump to an out of sequence location.
+    return; //(ph 2023/10/23)
+
     // Record this activation event and place activation in history
     // NB: Editor Activated is not called on project loading.
     //  So we miss the first activated editor

--- End code ---

The point of this test is to stop OnEditorActivated() from entering the current location of the activated editor before BrowseTracker gets to enters the location of the Clangd_client response.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version