code-intelligence 4.9.0__py3-none-win_amd64.whl → 4.11.0__py3-none-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,7 +13,7 @@ from .goober import (
13
13
  # SHAME - Bump when fixing things too embarrassing to admit.
14
14
  # PROUD.DEFAULT.SHAME
15
15
  # \ | /
16
- __version__ = "4.9.0"
16
+ __version__ = "4.11.0"
17
17
  __version_info__ = tuple(int(i) for i in __version__.split('.'))
18
18
 
19
19
  __all__ = [
@@ -23,7 +23,10 @@ class Str_C(C.Structure):
23
23
  def to_str_c(s: str | bytes) -> Str_C:
24
24
  if isinstance(s, str):
25
25
  s = s.encode()
26
- return Str_C(s, len(s))
26
+
27
+ struct = Str_C(s, len(s))
28
+ struct._keep_alive = s # prevent `s` being freed before it's time
29
+ return struct
27
30
 
28
31
  _lib = C.CDLL(str(DIR / "libcode_intelligence.so"))
29
32
 
@@ -170,9 +173,10 @@ def find_symbols_in_text(text: str, callback: Callable[[T | None, list[Definitio
170
173
 
171
174
  c_callback, data_ptr = C_AFTER_FIND, _wrap_data_ptr((callback, data))
172
175
 
176
+ keep_alive_buffers = [None] * len(first_look_at_these_files)
173
177
  first_look_at_these_files_c = (Str_C * len(first_look_at_these_files))()
174
178
  for i, it in enumerate(first_look_at_these_files):
175
- first_look_at_these_files_c[i] = to_str_c(os.fsencode(it))
179
+ keep_alive_buffers[i] = first_look_at_these_files_c[i] = to_str_c(os.fsencode(it))
176
180
 
177
181
  # print("[PY] sending find_symbols_in_text")
178
182
  _lib.enqueue_find_symbols_in_text(c_callback, data_ptr, to_str_c(text), ignore_word_like, sync, first_look_at_these_files_c, len(first_look_at_these_files))
Binary file
@@ -1,4 +1,4 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: code_intelligence
3
- Version: 4.9.0
3
+ Version: 4.11.0
4
4
  Summary: Code intelligence library
@@ -0,0 +1,7 @@
1
+ code_intelligence-4.11.0.dist-info/METADATA,sha256=mW59anI55u7x4hlJ80gi2gnN9VEaFyMvAg5PJKltri8,101
2
+ code_intelligence-4.11.0.dist-info/RECORD,,
3
+ code_intelligence-4.11.0.dist-info/WHEEL,sha256=aD7J6E7Slys9i0J65v6Ehfi0DHYa5rImRhUDp62Iwh0,98
4
+ code_intelligence/__init__.py,sha256=wSKzv1_LXn1xqSIY11icgKpJOJ18bY83rFn1xtfv9E4,588
5
+ code_intelligence/goober.py,sha256=f2pW89Tfxj930XGVgU1WEZQzWbTwmVhVIjhkevgA1d8,8359
6
+ code_intelligence/libcode_intelligence.so,sha256=D-ofSemdVyvPBEeY4Q0U7D3AbSUsziqcTD46YIgs5Zw,25251328
7
+ code_intelligence/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -1,7 +0,0 @@
1
- code_intelligence-4.9.0.dist-info/METADATA,sha256=QnyUYN9xd9BVl3Osz2omcOlWcN8TO0ciTSCxUjikDi8,100
2
- code_intelligence-4.9.0.dist-info/RECORD,,
3
- code_intelligence-4.9.0.dist-info/WHEEL,sha256=aD7J6E7Slys9i0J65v6Ehfi0DHYa5rImRhUDp62Iwh0,98
4
- code_intelligence/__init__.py,sha256=SVNBNvQ3Dz4DLRmGRiZukI-XC8Boswo3nK9ilquEfHI,587
5
- code_intelligence/goober.py,sha256=Yo6g6rxW6SRsETKNqqHTy4Psovhs47aH9KdIJc9Ahaw,8174
6
- code_intelligence/libcode_intelligence.so,sha256=NlVdVPjY67rlwbWoAGNKcv72lcRlNBUg3pInDgZm0eo,25243136
7
- code_intelligence/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0