ernie-research/MEnvBench huggingface dataset:
Repository: eclipse-cyclonedds/cyclonedds (C)

Issue:
Best-Effort reader lose 1 more samples when network packet lost occurs
When writer writes samples (1, 2, 3, 4), while sample 2 was lost due to network packet lost. The unique best-effort reader only receives sample 1 and sample 4. The log file shows sample 3 is discarded as "too old". Is this the expected behavior?

Other qos settings are default. 

And when I debug the code of reorder part, I found `nn_reorder_rsample` always called twice. The first call it returns 1 sample in chain and try deliver data to readers and this time it only deliver data to so called SYNC readers. My best-effort reader seems to be a out-of-sync reader and don't get the sample. The second call it returns -1 which means too old. After that it tries to update sync state of reader, but the state always stays at out-of-sync as have_seen_heartbeat is 0. So I searched have_seen_heartbeat and found it is set to 1 at handle_Heartbeat but only for reliable readers. Is a best-effort reader always out-of-sync?


Discussion: Good questions ...

I dare say it wasn't my intent that best-effort readers are always out-of-sync. Going from out-of-sync to in-sync by design requires catching up with historical data (or similar), and doing that requires a reliable reader because of the way the protocol is designed. That means a best-effort reader can never become "in sync" and so has to start out that way.

I would therefore expect it to be taken care of here: https://github.com/eclipse-cyclonedds/cyclonedds/blob/de27a112cf673d9479d096ce4a9ac17f9d280434/src/core/ddsi/src/ddsi_endpoint_match.c#L1006, by also unconditionally setting it to `PRMSS_SYNC` if `!rd->reliable`.

Would you be ok with trying that out? You seem to be able to reproduce it quickly, and so if you can confirm that this indeed solves the problem, then doing a PR will be very easy.
Yes, I had tested it and it did solve the problem.



Fix (patch):
diff --git a/src/core/ddsi/src/ddsi_endpoint_match.c b/src/core/ddsi/src/ddsi_endpoint_match.c
index 170b53e075..5a72855f4d 100644
--- a/src/core/ddsi/src/ddsi_endpoint_match.c
+++ b/src/core/ddsi/src/ddsi_endpoint_match.c
@@ -1003,7 +1003,12 @@ void ddsi_proxy_writer_add_connection (struct ddsi_proxy_writer *pwr, struct dds
   /* These can change as a consequence of handling data and/or
      discovery activities. The safe way of dealing with them is to
      lock the proxy writer */
-  if (ddsi_is_builtin_entityid (rd->e.guid.entityid, DDSI_VENDORID_ECLIPSE) && !ddsrt_avl_is_empty (&pwr->readers) && !pwr->filtered)
+  if (!rd->reliable)
+  {
+    /* unreliable readers cannot be out-of-sync */
+    m->in_sync = PRMSS_SYNC;
+  }
+  else if (ddsi_is_builtin_entityid (rd->e.guid.entityid, DDSI_VENDORID_ECLIPSE) && !ddsrt_avl_is_empty (&pwr->readers) && !pwr->filtered)
   {
     /* builtins really don't care about multiple copies or anything */
     m->in_sync = PRMSS_SYNC;
Repository: FreeRDP/FreeRDP (C)

Issue:
Clipboard PNG to DIB format conversion error
reproduce :
Connecting to Server 2019 on Ubuntu 24.04, pressing Print Screen to capture the window, and pasting it into Paint on Server 2019 results in an error message: "Information on the clipboard cannot be inserted into Paint."

command line：
/sdl3-freerdp /v:xxx /u:xxx /p:xxx /gfx:rfx /cert:ignore /w:1920 /h:1080

freerdp version:
sdl3， build with -DWINPR_UTILS_IMAGE_PNG=ON，In addition, I modified the SDL3 code to add copy and paste functionality for PNG, but that's not an issue.

root cause:
Synthesizer PNG->DIB convert wrong in function:
static void* winpr_read_png_from_buffer(const void* data, size_t SrcSize, size_t* pSize,
                                        UINT32* pWidth, UINT32* pHeight, UINT32* pBpp)

size_t bpp = PNG_IMAGE_PIXEL_SIZE(color_type);

here color_type is wrong, shoud be format parameter.






Fix (patch):
diff --git a/winpr/libwinpr/utils/image.c b/winpr/libwinpr/utils/image.c
index 4848b237874a..09fca602e713 100644
--- a/winpr/libwinpr/utils/image.c
+++ b/winpr/libwinpr/utils/image.c
@@ -430,7 +430,8 @@ static int winpr_image_bitmap_read_buffer(wImage* image, const BYTE* buffer, siz
 
 	image->bitsPerPixel = bi.biBitCount;
 	image->bytesPerPixel = (image->bitsPerPixel / 8);
-	image->scanline = ((((bi.biWidth * bi.biBitCount) + 31) & ~31) >> 3);
+	const size_t bpp = (bi.biBitCount + 7) / 8;
+	image->scanline = bi.biWidth * bpp;
 	const size_t bmpsize = 1ull * image->scanline * image->height;
 	if (bmpsize != bi.biSizeImage)
 		WLog_WARN(TAG, "bmpsize=%" PRIuz " != bi.biSizeImage=%" PRIu32, bmpsize, bi.biSizeImage);
@@ -939,14 +940,15 @@ static void* winpr_read_png_from_buffer(const void* data, size_t SrcSize, size_t
 	                 NULL, NULL) != 1)
 		goto fail;
 
-	size_t bpp = PNG_IMAGE_PIXEL_SIZE(color_type);
+	const png_byte channelcount = png_get_channels(png_ptr, info_ptr);
+	const size_t bpp = channelcount * bit_depth;
 
 	row_pointers = png_get_rows(png_ptr, info_ptr);
 	if (row_pointers)
 	{
-		const size_t stride = width * bpp;
+		const size_t stride = width * bpp / 8ull;
 		const size_t png_stride = png_get_rowbytes(png_ptr, info_ptr);
-		const size_t size = width * height * bpp;
+		const size_t size = width * height * bpp / 8ull;
 		const size_t copybytes = stride > png_stride ? png_stride : stride;
 
 		rc = malloc(size);
@@ -961,7 +963,7 @@ static void* winpr_read_png_from_buffer(const void* data, size_t SrcSize, size_t
 			*pSize = size;
 			*pWidth = width;
 			*pHeight = height;
-			*pBpp = bpp * 8;
+			*pBpp = bpp;
 		}
 	}
 fail:
Repository: RoaringBitmap/CRoaring (C)

Issue:
Bitmap portable serialize/deserialize broken round-trip
Using amalgamation generated from v0.9.4.

## Code

```c
#include "roaring.h"
#include <stdio.h>

static void print_bitmap(const roaring_bitmap_t *b, const char *name) {
  printf("%-15s: ", name);
  printf("%u-%u ", roaring_bitmap_minimum(b), roaring_bitmap_maximum(b));
  roaring_bitmap_printf_describe(b);
  printf("\n");
}

int main() {
  roaring_bitmap_t *b1 = roaring_bitmap_create();

  // Works correctly if we remove this line (the container becomes a run container, rather than a bitset
  roaring_bitmap_add(b1, 262143);
  roaring_bitmap_add_range_closed(b1, 258047, 262143);
  // Works correctly if we use .remove instead, ostensibly because remove_range seems to force it to become a bitset
  roaring_bitmap_remove_range_closed(b1, 262143, 262143);

  size_t len = roaring_bitmap_portable_size_in_bytes(b1);
  char *data = roaring_malloc(len);
  roaring_bitmap_portable_serialize(b1, data);

  roaring_bitmap_t *b2 = roaring_bitmap_portable_deserialize_safe(data, len);

  print_bitmap(b1, "original");
  print_bitmap(b2, "deserialized");

  printf("Serialized equals source: %d\n", (int)roaring_bitmap_equals(b1, b2));

  for (int i = 0; i < 5; i++) {
    uint32_t elem = 0;
    roaring_bitmap_select(b2, i, &elem);
    printf("Item at %d: %u\n", i, elem);
  }
  printf("\n");

  printf("%s\n", ROARING_VERSION);

  roaring_bitmap_free(b2);
  roaring_bitmap_free(b1);
  roaring_free(data);
  return 0;
}
```

## Output
```
original       : 258047-262142 {3: bitset (4096)}
deserialized   : 196608-229375 {3: array (4096)}
Serialized equals source: 0
Item at 0: 196608
Item at 1: 196608
Item at 2: 196608
Item at 3: 196608
Item at 4: 196608

0.9.4
```

## Expected Behavior
Serializing with `roaring_bitmap_portable_serialize`, then deserializing with `roaring_bitmap_portable_deserialize_safe` (or the unsafe version) should return a bitmap which is equal to the original

## Actual Behavior
Returned bitmap is completely different (and invalid): The range of values is totally different, and iterating through it returns many duplicate values which should never happen.

Found via many hours of fuzzing (yay for free tiers of cloud services)


Discussion: Much appreciated.
It is not a serialization problem, it is a problem with the remove function.
I have released an issue. Please find more bugs !!! :-)



Fix (patch):
diff --git a/include/roaring/containers/containers.h b/include/roaring/containers/containers.h
index 782bf1370..2f7c1e4d7 100644
--- a/include/roaring/containers/containers.h
+++ b/include/roaring/containers/containers.h
@@ -2430,7 +2430,7 @@ static inline container_t *container_remove_range(
 
             if (result_cardinality == 0) {
                 return NULL;
-            } else if (result_cardinality < DEFAULT_MAX_SIZE) {
+            } else if (result_cardinality <= DEFAULT_MAX_SIZE) {
                 *result_type = ARRAY_CONTAINER_TYPE;
                 bitset_reset_range(bitset->words, min, max+1);
                 bitset->cardinality = result_cardinality;
Repository: libsdl-org/SDL (C)

Issue:
v4l2 camera driver shows (non-functional) mjpg pixelformats
Running testcamera with all-default arguments, only green is shown.

By default, the v4l2 camera driver is used.
Its stdout claims it provides surfaces with MJPG and YUV2 formats.

But the window is 100% green. When adding a [breakpont at stbi__jpeg_load](https://github.com/libsdl-org/SDL/blob/fcd41c1d2c89f46b59fe379aa93ad7f9007db519/src/video/SDL_stb.c#L66-L90), and viewing `src` in a memory viewer, it does not contain the JPEG magic header (`ff d8 ff`). The data (`src`) looks very uniform (uncompressed?) to me.

Comparing the v4l2 and pipewire camera driver, the `SDL_PIXELFORMAT_MJPG` formats do not appear when using the pipewire driver.

The webcam is a simple laptop webcam. `lsusb` shows:
```
Bus 002 Device 003: ID 1bcf:2c18 Sunplus Innovation Technology Inc. HD WebCam
```


<details>

<summary>Green window</summary>

![testcamera SDL3 window with green contents](https://github.com/user-attachments/assets/8841d306-8127-4cf4-b986-3f74031e98c1)

</details>


<details>

<summary>v4l2 output</summary>

```
Using SDL camera driver: v4l2
Saw 1 camera devices.
  - Camera #0:  HD WebCam: HD WebCam
Available formats:
    1280x720 30.00 FPS SDL_PIXELFORMAT_MJPG
    1280x720 7.50 FPS SDL_PIXELFORMAT_YUY2
    640x480 30.00 FPS SDL_PIXELFORMAT_MJPG
    640x480 30.00 FPS SDL_PIXELFORMAT_YUY2
    352x288 30.00 FPS SDL_PIXELFORMAT_MJPG
    352x288 30.00 FPS SDL_PIXELFORMAT_YUY2
    320x240 30.00 FPS SDL_PIXELFORMAT_MJPG
    320x240 30.00 FPS SDL_PIXELFORMAT_YUY2
    176x144 30.00 FPS SDL_PIXELFORMAT_MJPG
    176x144 30.00 FPS SDL_PIXELFORMAT_YUY2
    160x120 30.00 FPS SDL_PIXELFORMAT_MJPG
    160x120 30.00 FPS SDL_PIXELFORMAT_YUY2
Camera approved!
Camera Spec: 1280x720 30.00 FPS SDL_PIXELFORMAT_MJPG
```

</details>

<details>

<summary>pipewire output</summary>

```
Using SDL camera driver: pipewire
Saw 1 camera devices.
  - Camera #0:  HD WebCam (V4L2)
Available formats:
    1280x720 7.50 FPS SDL_PIXELFORMAT_YUY2
    640x480 30.00 FPS SDL_PIXELFORMAT_YUY2
    352x288 30.00 FPS SDL_PIXELFORMAT_YUY2
    320x240 30.00 FPS SDL_PIXELFORMAT_YUY2
    176x144 30.00 FPS SDL_PIXELFORMAT_YUY2
    160x120 30.00 FPS SDL_PIXELFORMAT_YUY2
Camera approved!
Camera Spec: 1280x720 7.50 FPS SDL_PIXELFORMAT_YUY2
```

</details>



Discussion: Can you debug the capture itself?



Fix (patch):
diff --git a/src/camera/v4l2/SDL_camera_v4l2.c b/src/camera/v4l2/SDL_camera_v4l2.c
index 8bfe30b0f58a5..9cdb54b02510e 100644
--- a/src/camera/v4l2/SDL_camera_v4l2.c
+++ b/src/camera/v4l2/SDL_camera_v4l2.c
@@ -438,10 +438,10 @@ static Uint32 format_sdl_to_v4l2(SDL_PixelFormat fmt)
     switch (fmt) {
         #define CASE(y, x)  case x: return y
         CASE(V4L2_PIX_FMT_YUYV, SDL_PIXELFORMAT_YUY2);
-        CASE(V4L2_PIX_FMT_MJPEG, SDL_PIXELFORMAT_UNKNOWN);
+        CASE(V4L2_PIX_FMT_MJPEG, SDL_PIXELFORMAT_MJPG);
         #undef CASE
         default:
-            return true;
+            return 0;
     }
 }
Repository: godotengine/godot (C++)

Issue:
Label and RichTextLabel word wrap treating spaces incorrectly
### Tested versions

Reproducible in 4.4.beta3. 
Not seen in 4.4.dev3.


### System information

Windows 11 - Godot 4.4.beta3

### Issue description


Label and RichTextLabel word wrap behaviour changed fairly recently - seems like the spaces count towards the line width in some way.

See an example below where a space separator at the end of a long word creates two consecutive line breaks.

![Image](https://github.com/user-attachments/assets/7cc551b6-c63e-4332-ac17-85234298bce3)

### Steps to reproduce

Create a Label with word wrap on, add words just barely under the width of the container separated by spaces until bug is seen.

### Minimal reproduction project (MRP)

[BugTest.zip](https://github.com/user-attachments/files/18798368/BugTest.zip)


Discussion: This is not a proper MRP, it contains only a single scene file, in the future please upload a complete project for MRPs

I can confirm this, will try to bisect it, change was between dev5 and dev6
Regression from #99488



Fix (patch):
diff --git a/servers/text_server.cpp b/servers/text_server.cpp
index 83a53bfc7c1f..d6db1c700b8c 100644
--- a/servers/text_server.cpp
+++ b/servers/text_server.cpp
@@ -847,7 +847,7 @@ PackedInt32Array TextServer::shaped_text_get_line_breaks_adv(const RID &p_shaped
 					if (last_end <= l_gl[start_pos].start) {
 						lines.push_back(l_gl[start_pos].start);
 						lines.push_back(l_gl[end_pos].end);
-						cur_safe_brk = end_pos;
+						cur_safe_brk = last_safe_break;
 						last_end = l_gl[end_pos].end;
 					}
 					trim_next = true;
@@ -1021,7 +1021,7 @@ PackedInt32Array TextServer::shaped_text_get_line_breaks(const RID &p_shaped, do
 						if (p_width > indent) {
 							l_width = p_width - indent;
 						}
-						cur_safe_brk = end_pos;
+						cur_safe_brk = last_safe_break;
 						last_end = l_gl[end_pos].end;
 					}
 					trim_next = true;
Repository: knative/eventing (Go)

Issue:
ApiServerSource creates receive adapter deployments dynamically without setting SecurityContext
**Describe the bug**

For RA of `ApiServerSource` we do completelt lack the `SecurityContext` of the `Container` obj on each of the "k8s source"'s deployment:

https://github.com/knative/eventing/blob/main/pkg/reconciler/apiserversource/resources/receive_adapter.go#L87-L107

In https://github.com/knative/eventing/pull/6533 we did address some `PodSecurityPolicy` enhancement, but looks like we missed the `ApiServerSource`



Discussion: /cc @evankanderson FYI
I'm not sure we have a consistent pattern for enhancing these created deployments, so it's not surprising we might miss some things.
/assign matzew
@evankanderson I saw that for serving you introduced a feature-flag, but the config there is generally more broad.

For our internal deployment, I am thinking to just add the bits, similar to the static manifests we updated late 2022.



Fix (patch):
diff --git a/pkg/reconciler/apiserversource/resources/receive_adapter.go b/pkg/reconciler/apiserversource/resources/receive_adapter.go
index aa1b1fdf2cb..83c784317ac 100644
--- a/pkg/reconciler/apiserversource/resources/receive_adapter.go
+++ b/pkg/reconciler/apiserversource/resources/receive_adapter.go
@@ -103,6 +103,13 @@ func MakeReceiveAdapter(args *ReceiveAdapterArgs) (*appsv1.Deployment, error) {
 									},
 								},
 							},
+							SecurityContext: &corev1.SecurityContext{
+								AllowPrivilegeEscalation: ptr.Bool(false),
+								ReadOnlyRootFilesystem:   ptr.Bool(true),
+								RunAsNonRoot:             ptr.Bool(true),
+								Capabilities:             &corev1.Capabilities{Drop: []corev1.Capability{"ALL"}},
+								SeccompProfile:           &corev1.SeccompProfile{Type: corev1.SeccompProfileTypeRuntimeDefault},
+							},
 						},
 					},
 				},
Repository: Shopify/ruby-lsp (Ruby)

Issue:
Rescue inlay hints do not appear when capturing a variable
This works
```ruby
begin
rescue # <- Shows StandardError inlay hint
end
```
This doesn't (but it should work the same)
```ruby
begin
rescue => e # <- This should also show a StandardError inlay hint right before the rocket operator
end
```



Fix (patch):
diff --git a/lib/ruby_lsp/requests/inlay_hints.rb b/lib/ruby_lsp/requests/inlay_hints.rb
index b45b21ba31..c317a98ad9 100644
--- a/lib/ruby_lsp/requests/inlay_hints.rb
+++ b/lib/ruby_lsp/requests/inlay_hints.rb
@@ -37,7 +37,7 @@ def run
 
       sig { override.params(node: SyntaxTree::Rescue).void }
       def visit_rescue(node)
-        return unless node.exception.nil?
+        return unless node.exception.nil? || node.exception.exceptions.nil?
 
         loc = node.location
         return unless visible?(node, @range)
Repository: Shopify/ruby-lsp (Ruby)

Issue:
Spec blocks in RSpec files are not foldable
```
RSpec.describe SomeObject do
	describe "#some_method" do
		...
    end

	describe "#some_other_method" do
		...
    end
end
```

In the above code, only the main `RSpec.describe` block is foldable. The two nested `describe` blocks are not.



Discussion: Hi @amiratak88 

I'm unable to reproduce this problem. I can fold the outer and inner `describe` blocks, as indicated by the markers here:

<img width="359" alt="Screenshot 2023-02-23 at 4 09 26 PM" src="https://user-images.githubusercontent.com/13400/221030880-2444231c-aa72-4d90-9430-5994bad01f5f.png">

Are you using the latest version of ruby-lsp?
Ah, I see the issue now - it happens only if you omit the parenthesis for `SomeObject`.
I believe this relates to a bug in SyntaxTree: https://github.com/ruby-syntax-tree/syntax_tree/issues/322
The upgrade of syntax_tree in https://github.com/Shopify/ruby-lsp/pull/538 by @vinistock will unblock this.



Fix (patch):
diff --git a/lib/ruby_lsp/requests/folding_ranges.rb b/lib/ruby_lsp/requests/folding_ranges.rb
index f5b4022ac7..8ac9c16d92 100644
--- a/lib/ruby_lsp/requests/folding_ranges.rb
+++ b/lib/ruby_lsp/requests/folding_ranges.rb
@@ -115,7 +115,7 @@ def visit(node)
       end
 
       # This is to prevent duplicate ranges
-      sig { params(node: SyntaxTree::Command).returns(T::Boolean) }
+      sig { params(node: T.any(SyntaxTree::Command, SyntaxTree::CommandCall)).returns(T::Boolean) }
       def same_lines_for_command_and_block?(node)
         node_block = node.block
         return false unless node_block
@@ -238,9 +238,17 @@ def add_call_range(node)
           end
         end
 
-        add_lines_range(receiver.location.start_line, node.location.end_line - 1) if receiver
+        if receiver
+          unless node.is_a?(SyntaxTree::CommandCall) && same_lines_for_command_and_block?(node)
+            add_lines_range(
+              receiver.location.start_line,
+              node.location.end_line - 1,
+            )
+          end
+        end
 
         visit(node.arguments)
+        visit(node.block) if node.is_a?(SyntaxTree::CommandCall)
       end
 
       sig { params(node: SyntaxTree::DefNode).void }
Repository: Shopify/ruby-lsp (Ruby)

Issue:
Allow add-ons to enhance the new custom request
Add all of the necessary bits to allow add-ons to enhance the custom request added in #3171 to discovery test items.

For example, the Rails and RSpec add-ons should be able to enhance our functionality and discover their own groups and examples with full control over the hierarchy.



Fix (patch):
diff --git a/lib/ruby_lsp/addon.rb b/lib/ruby_lsp/addon.rb
index 88e43fd2ab..537c277a0c 100644
--- a/lib/ruby_lsp/addon.rb
+++ b/lib/ruby_lsp/addon.rb
@@ -233,5 +233,10 @@ def create_definition_listener(response_builder, uri, node_context, dispatcher);
     # @overridable
     #: (ResponseBuilders::CollectionResponseBuilder[Interface::CompletionItem] response_builder, NodeContext node_context, Prism::Dispatcher dispatcher, URI::Generic uri) -> void
     def create_completion_listener(response_builder, node_context, dispatcher, uri); end
+
+    # Creates a new Discover Tests listener. This method is invoked on every DiscoverTests request
+    # @overridable
+    #: (ResponseBuilders::TestCollection response_builder, Prism::Dispatcher dispatcher, URI::Generic uri) -> void
+    def create_discover_tests_listener(response_builder, dispatcher, uri); end
   end
 end
Repository: Shopify/ruby-lsp (Ruby)

Issue:
Changelog on VSCode Marketplace include pre-release versions
### Operating System

macOS

### Ruby version

3.2.3

### Project has a bundle

- [ ] Has bundle

### Ruby version manager being used

asdf

### Description

The changelog shown in the extension detail page in VSCode contains the pre-release versions.

For example here, 0.6 versions are noted as pre-releases on Github, but they are shown in the changelog for 0.5.8.

<img width="899" alt="image" src="https://github.com/Shopify/vscode-ruby-lsp/assets/42070/aeca69c2-021d-48a3-aaaa-36965a939268">

The Github action that generates the changelog should probably be modified to not include pre-releases (if building a stable version), and maybe also to sort the versions by name rather than by release date?



Fix (patch):
diff --git a/lib/ruby_indexer/lib/ruby_indexer/index.rb b/lib/ruby_indexer/lib/ruby_indexer/index.rb
index f467b197ff..cf26b89a48 100644
--- a/lib/ruby_indexer/lib/ruby_indexer/index.rb
+++ b/lib/ruby_indexer/lib/ruby_indexer/index.rb
@@ -167,12 +167,16 @@ class Entry
       sig { returns(T::Array[String]) }
       attr_reader :comments
 
+      sig { returns(Symbol) }
+      attr_accessor :visibility
+
       sig { params(name: String, file_path: String, location: YARP::Location, comments: T::Array[String]).void }
       def initialize(name, file_path, location, comments)
         @name = name
         @file_path = file_path
         @location = location
         @comments = comments
+        @visibility = T.let(:public, Symbol)
       end
 
       sig { returns(String) }
diff --git a/lib/ruby_indexer/lib/ruby_indexer/visitor.rb b/lib/ruby_indexer/lib/ruby_indexer/visitor.rb
index 586e99edef..4b6ff0a298 100644
--- a/lib/ruby_indexer/lib/ruby_indexer/visitor.rb
+++ b/lib/ruby_indexer/lib/ruby_indexer/visitor.rb
@@ -39,6 +39,9 @@ def visit(node)
         add_constant(node)
       when YARP::ConstantPathWriteNode, YARP::ConstantPathOrWriteNode
         add_constant_with_path(node)
+      when YARP::CallNode
+        message = node.message
+        handle_private_constant(node) if message == "private_constant"
       end
     end
 
@@ -50,6 +53,28 @@ def visit_all(nodes)
 
     private
 
+    sig { params(node: YARP::CallNode).void }
+    def handle_private_constant(node)
+      arguments = node.arguments&.arguments
+      return unless arguments
+
+      first_argument = arguments.first
+
+      name = case first_argument
+      when YARP::StringNode
+        first_argument.content
+      when YARP::SymbolNode
+        first_argument.value
+      end
+
+      return unless name
+
+      # The private_constant method does not resolve the constant name. It always points to a constant that needs to
+      # exist in the current namespace
+      entries = @index[fully_qualify_name(name)]
+      entries&.each { |entry| entry.visibility = :private }
+    end
+
     sig do
       params(
         node: T.any(YARP::ConstantWriteNode, YARP::ConstantOrWriteNode),