code-intelligence 3.3.0__py3-none-win_amd64.whl → 3.3.1__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__ = "3.3.0"
16
+ __version__ = "3.3.1"
17
17
  __version_info__ = tuple(int(i) for i in __version__.split('.'))
18
18
 
19
19
  __all__ = [
@@ -79,33 +79,31 @@ class Definition_Link:
79
79
  C_NO_CALLBACK = SCAN_CALLBACK(0)
80
80
 
81
81
 
82
- def _wrap_data_ptr(callback, data):
83
- full_data = (callback, data)
84
-
82
+ def _wrap_data_ptr(tup: tuple):
85
83
  # MANUALLY INCREMENT THE REFERENCE COUNT
86
84
  # We are now responsible for its lifetime
87
- C.pythonapi.Py_IncRef(full_data)
85
+ C.pythonapi.Py_IncRef(C.py_object(tup))
88
86
 
89
- return id(full_data)
87
+ return id(tup) # C.cast(obj, C.c_void_p)
90
88
 
91
89
 
92
- def _unwrap_data_ptr(data_ptr):
90
+ def _unwrap_data_ptr(data_ptr) -> tuple:
93
91
  assert data_ptr != 0, "we got NULL"
94
92
 
95
- full_data = C.cast(data_ptr, C.py_object).value
93
+ tup = C.cast(data_ptr, C.py_object).value
96
94
 
97
95
  # MANUALLY DECREMENT THE REFERENCE COUNT.
98
96
  # We are fulfilling our promise
99
- C.pythonapi.Py_DecRef(full_data)
97
+ C.pythonapi.Py_DecRef(C.py_object(tup))
100
98
 
101
- return full_data
99
+ return tup
102
100
 
103
101
 
104
102
  def scan_file(file, language: Language, callback=None, data=None) -> bool:
105
103
  if callback is None:
106
104
  c_callback, data_ptr = C_NO_CALLBACK, 0
107
105
  else:
108
- c_callback, data_ptr = C_AFTER_SCAN, _wrap_data_ptr(callback, data)
106
+ c_callback, data_ptr = C_AFTER_SCAN, _wrap_data_ptr((callback, data))
109
107
 
110
108
  # print(f"[PY] sending next request {file}")
111
109
  _lib.enqueue_scan_file(c_callback, data_ptr, os.fsencode(file), language)
@@ -125,7 +123,7 @@ def find_symbols_in_text(text: str, callback=None, data=None) -> bool:
125
123
  if callback is None:
126
124
  c_callback, data_ptr = C_NO_CALLBACK, 0
127
125
  else:
128
- c_callback, data_ptr = C_AFTER_FIND, _wrap_data_ptr(callback, data)
126
+ c_callback, data_ptr = C_AFTER_FIND, _wrap_data_ptr((callback, data))
129
127
 
130
128
  # print("[PY] sending find_symbols_in_text")
131
129
  _lib.enqueue_find_symbols_in_text(c_callback, data_ptr, text.encode())
@@ -206,9 +204,9 @@ if __name__ == "__main__":
206
204
  path = Path(folder)
207
205
  if path.is_dir():
208
206
  for file in path.rglob("*.py"):
209
- scan_file(file, scan_callback, file)
207
+ scan_file(file, Language.PYTHON, scan_callback, file)
210
208
  else:
211
- scan_file(path, scan_callback, path)
209
+ scan_file(path, Language.PYTHON, scan_callback, path)
212
210
 
213
211
  text = sys.argv[1]
214
212
  find_symbols_in_text(text, find_callback, data=(text, "before"))
Binary file
@@ -1,4 +1,4 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: code_intelligence
3
- Version: 3.3.0
3
+ Version: 3.3.1
4
4
  Summary: Code intelligence library
@@ -0,0 +1,8 @@
1
+ code_intelligence-3.3.1.dist-info/METADATA,sha256=w-DvM6pR4uWVpKsguom5rlXqeWBYdtudT4Rrf5-_AFg,100
2
+ code_intelligence-3.3.1.dist-info/RECORD,,
3
+ code_intelligence-3.3.1.dist-info/WHEEL,sha256=aD7J6E7Slys9i0J65v6Ehfi0DHYa5rImRhUDp62Iwh0,98
4
+ code_intelligence/__init__.py,sha256=iG0BcJz8lbGitiiOrnzZ7R9fIY9blHehoQ9Kmpu1PBw,587
5
+ code_intelligence/goober.py,sha256=4MYEegk26-GfaOOsd8ufREYqFRq0nNmDs6jiBq-kD6s,6510
6
+ code_intelligence/libcode_intelligence.h,sha256=9iy0xXcOpq366DuiKw1cw4-7VNz-QPAYBNJGZKEh12M,3169
7
+ code_intelligence/libcode_intelligence.so,sha256=gbNPCTEzVkKwp1m7h16dQqyWvnhosxpXCWEUbRTqwh0,2840576
8
+ code_intelligence/symdb.py,sha256=gRq3-xr2oYIzudgwDwMj3Zl5Pb0B8tDdnGKUB0WIV_o,32427
@@ -1,8 +0,0 @@
1
- code_intelligence-3.3.0.dist-info/METADATA,sha256=GjydZJisD2oYo8E4VkOSw7GKxskpnITRxtFGRurGncU,100
2
- code_intelligence-3.3.0.dist-info/RECORD,,
3
- code_intelligence-3.3.0.dist-info/WHEEL,sha256=aD7J6E7Slys9i0J65v6Ehfi0DHYa5rImRhUDp62Iwh0,98
4
- code_intelligence/__init__.py,sha256=oIXxSmeNFJScnUsKG8r906r1ur34-SwvbN8gGGkb_D8,587
5
- code_intelligence/goober.py,sha256=yelM919e_n3nI2NnYx3qGgAS74J2-zkdp3x-GIz_gVI,6481
6
- code_intelligence/libcode_intelligence.h,sha256=9iy0xXcOpq366DuiKw1cw4-7VNz-QPAYBNJGZKEh12M,3169
7
- code_intelligence/libcode_intelligence.so,sha256=wQ0AyR2z7GvHf6kZVntMmRAE-E4yT4VgZkcdFQ7G8Lo,2840064
8
- code_intelligence/symdb.py,sha256=gRq3-xr2oYIzudgwDwMj3Zl5Pb0B8tDdnGKUB0WIV_o,32427