code-intelligence 1.2.0__py3-none-win_amd64.whl → 1.3.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.
@@ -3,14 +3,14 @@ from .symdb import (
3
3
  SymbolType,
4
4
  Symbol,
5
5
  Location,
6
- ImmideateSymbolDatabase,
6
+ ImmediateSymbolDatabase,
7
7
  LazySymbolDatabase,
8
8
  )
9
9
 
10
10
  # Backward compatibility alias
11
- SymbolDatabase = ImmideateSymbolDatabase
11
+ SymbolDatabase = ImmediateSymbolDatabase
12
12
 
13
- __version__ = "1.2.0"
13
+ __version__ = "1.3.0"
14
14
  __version_info__ = tuple(int(i) for i in __version__.split('.'))
15
15
 
16
16
  __all__ = [
@@ -18,7 +18,7 @@ __all__ = [
18
18
  "SymbolType",
19
19
  "Symbol",
20
20
  "Location",
21
- "ImmideateSymbolDatabase",
21
+ "ImmediateSymbolDatabase",
22
22
  "LazySymbolDatabase",
23
23
  "SymbolDatabase",
24
24
  ]
Binary file
@@ -9,21 +9,14 @@ from dataclasses import dataclass, field
9
9
  class Language(IntEnum):
10
10
  # UNKNOWN = 0
11
11
  PYTHON = 1
12
- JAVASCRIPT = 2
13
- TYPESCRIPT = 3
12
+ JAVASCRIPT = 2 # Not implemented yet - enum exists but no parser
13
+ TYPESCRIPT = 3 # Not implemented yet - enum exists but no parser
14
14
  CPP = 4
15
15
  C = 5
16
- JAVA = 6
16
+ JAVA = 6 # Not implemented yet - enum exists but no parser
17
17
  RUST = 7
18
18
  GO = 8
19
19
  PHP = 9
20
- RUBY = 10
21
- CSHARP = 11
22
- KOTLIN = 12
23
- SWIFT = 13
24
- SCALA = 14
25
- DART = 15
26
- LUA = 16
27
20
 
28
21
 
29
22
  class SymbolType(IntEnum):
@@ -35,17 +28,6 @@ class SymbolType(IntEnum):
35
28
  MODULE = 5
36
29
  IMPORT = 6
37
30
  FROM_IMPORT = 7
38
- CONSTANT = 8
39
- PROPERTY = 9
40
- INTERFACE = 10
41
- STRUCT = 11
42
- ENUM = 12
43
- NAMESPACE = 13
44
- PACKAGE = 14
45
- FIELD = 15
46
- PARAMETER = 16
47
- LOCAL = 17
48
- TYPE = 18
49
31
 
50
32
  Path_Like = str | Path
51
33
 
@@ -94,7 +76,6 @@ class Symbol:
94
76
 
95
77
  # --- Private ctypes Implementation ---
96
78
 
97
- # Matches ci_location_t (field name 'path')
98
79
  class _Location(ctypes.Structure):
99
80
  _fields_ = [
100
81
  ("path", ctypes.c_char_p),
@@ -104,15 +85,16 @@ class _Location(ctypes.Structure):
104
85
  ("end_column", ctypes.c_uint32),
105
86
  ]
106
87
 
107
- # Matches ci_symbol_t (field name 'definition')
108
88
  class _Symbol(ctypes.Structure):
109
89
  _fields_ = [
110
90
  ("name", ctypes.c_char_p),
111
- ("symbol_type", ctypes.c_int),
91
+ ("symbol_type", ctypes.c_uint8),
112
92
  ("definition", _Location),
113
93
  ("parent", ctypes.c_char_p),
114
94
  ("signature", ctypes.c_char_p),
115
95
  ("documentation", ctypes.c_char_p),
96
+ ("_is_stub", ctypes.c_bool),
97
+ ("_target_module", ctypes.c_char_p),
116
98
  ]
117
99
 
118
100
 
@@ -154,18 +136,18 @@ _lib.symbol_db_destroy.restype = None
154
136
  _lib.symbol_db_set_project_root.argtypes = [ctypes.c_void_p, ctypes.c_char_p]
155
137
  _lib.symbol_db_set_project_root.restype = None
156
138
 
157
- _lib.symbol_db_scan_file.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_int]
139
+ _lib.symbol_db_scan_file.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_uint8]
158
140
  _lib.symbol_db_scan_file.restype = ctypes.c_bool
159
141
 
160
142
  # Batch scan
161
- _lib.symbol_db_scan_files.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_char_p), ctypes.c_uint32, ctypes.c_int]
143
+ _lib.symbol_db_scan_files.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_char_p), ctypes.c_uint32, ctypes.c_uint8]
162
144
  _lib.symbol_db_scan_files.restype = ctypes.c_bool
163
145
 
164
146
  _lib.symbol_db_remove_file.argtypes = [ctypes.c_void_p, ctypes.c_char_p]
165
147
  _lib.symbol_db_remove_file.restype = ctypes.c_bool
166
148
 
167
149
  # Update file (re-scan and replace)
168
- _lib.symbol_db_update_file.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_int]
150
+ _lib.symbol_db_update_file.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_uint8]
169
151
  _lib.symbol_db_update_file.restype = ctypes.c_bool
170
152
 
171
153
  # Arrays with out_count
@@ -178,6 +160,9 @@ _lib.symbol_db_find_references.restype = ctypes.POINTER(_Symbol)
178
160
  _lib.symbol_db_get_all_symbols.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)]
179
161
  _lib.symbol_db_get_all_symbols.restype = ctypes.POINTER(_Symbol)
180
162
 
163
+ _lib.symbol_db_get_file_symbols.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_uint32)]
164
+ _lib.symbol_db_get_file_symbols.restype = ctypes.POINTER(_Symbol)
165
+
181
166
  # bool return + out _Symbol
182
167
  _lib.symbol_db_get_symbol.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_uint32, ctypes.c_uint32, ctypes.POINTER(_Symbol)]
183
168
  _lib.symbol_db_get_symbol.restype = ctypes.c_bool
@@ -413,7 +398,7 @@ class _BaseSymbolDatabase:
413
398
  return _to_py_symbol(out) if ok else None
414
399
 
415
400
 
416
- class ImmideateSymbolDatabase(_BaseSymbolDatabase):
401
+ class ImmediateSymbolDatabase(_BaseSymbolDatabase):
417
402
  """Symbol database using copying (eager) backend."""
418
403
  def find_definitions(self, symbol_name: str) -> list[Symbol]:
419
404
  count = ctypes.c_uint32(0)
@@ -441,6 +426,15 @@ class ImmideateSymbolDatabase(_BaseSymbolDatabase):
441
426
  ptr = _lib.symbol_db_get_all_symbols(self._handle, ctypes.byref(count))
442
427
  return _convert_symbol_array(ptr, int(count.value))
443
428
 
429
+ def get_file_symbols(self, path: Path_Like) -> list[Symbol]:
430
+ count = ctypes.c_uint32(0)
431
+ ptr = _lib.symbol_db_get_file_symbols(
432
+ self._handle,
433
+ os.fsencode(path),
434
+ ctypes.byref(count),
435
+ )
436
+ return _convert_symbol_array(ptr, int(count.value))
437
+
444
438
 
445
439
  class LazySymbolDatabase(_BaseSymbolDatabase):
446
440
  """Symbol database using lazy backend."""
@@ -470,3 +464,12 @@ class LazySymbolDatabase(_BaseSymbolDatabase):
470
464
  ptr = _lib.symbol_db_get_all_symbols(self._handle, ctypes.byref(count))
471
465
  return _convert_symbol_array_lazy(ptr, int(count.value))
472
466
 
467
+ def get_file_symbols(self, path: Path_Like) -> SymbolArrayView:
468
+ count = ctypes.c_uint32(0)
469
+ ptr = _lib.symbol_db_get_file_symbols(
470
+ self._handle,
471
+ os.fsencode(path),
472
+ ctypes.byref(count),
473
+ )
474
+ return _convert_symbol_array_lazy(ptr, int(count.value))
475
+
@@ -1,4 +1,4 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: code_intelligence
3
- Version: 1.2.0
3
+ Version: 1.3.0
4
4
  Summary: Code intelligence library
@@ -0,0 +1,6 @@
1
+ code_intelligence-1.3.0.dist-info/METADATA,sha256=___8D0t8oEl2VRhVidjmJX1B84UDJkFHPhHm5w8mews,100
2
+ code_intelligence-1.3.0.dist-info/RECORD,,
3
+ code_intelligence-1.3.0.dist-info/WHEEL,sha256=aD7J6E7Slys9i0J65v6Ehfi0DHYa5rImRhUDp62Iwh0,98
4
+ code_intelligence/__init__.py,sha256=2br2823E1Mi9gejTIr_lRhPtv0tZKFlyjVebV_tuxJg,475
5
+ code_intelligence/_code_intelligence.dll,sha256=2f_7kGXznmc3NBbSn7H6HvaA_Mp9sKK8xRAQ4XJ39Tw,6475264
6
+ code_intelligence/symdb.py,sha256=eIcyCsbXNBfpmHsEJmHtOSgtMW8GdrnIryYDSfafGH4,16529
@@ -1,6 +0,0 @@
1
- code_intelligence-1.2.0.dist-info/METADATA,sha256=hKTZsfBd4PDEY2n4goorqCM_HwqJ8figLIksMS0xueE,100
2
- code_intelligence-1.2.0.dist-info/RECORD,,
3
- code_intelligence-1.2.0.dist-info/WHEEL,sha256=aD7J6E7Slys9i0J65v6Ehfi0DHYa5rImRhUDp62Iwh0,98
4
- code_intelligence/__init__.py,sha256=gruQfSmjho6PUbWU7ZW7OZP2KZ1fsvx5Z-9vAwfnM1g,475
5
- code_intelligence/_code_intelligence.dll,sha256=LNP8bT3rTDsLKrG-1OHbTIdJN7-VNd3MRi0PI2HzHIQ,6474240
6
- code_intelligence/symdb.py,sha256=r8fkV4YeKKM4Tajr82L389g7Mv4ftMt_K_I7y8LxEZs,15850