ctypes IntelliSense/Autocomplete #4438
Replies: 4 comments
-
Hi @TheRealQuantam, thanks for the suggestion. Could you please provide a code example that illustrates the problem you mentioned about PTVS not supporting ctypes structures and instead only displaying the members of the metaclass. By providing this code snippet, we will be able to have a clearer understanding of the specific feature you'd like to see in PTVS. Thank you! |
Beta Was this translation helpful? Give feedback.
-
Oddly enough while getting a screen shot I got two very similar but slightly different behaviors: from ctypes import *
class NsfHeader(LittleEndianStructure):
_pack_ = True
_fields_ = (
("magic", c_char * 5),
("version", c_uint8),
("num_tracks", c_uint8),
("start_track", c_uint8), # 1-based
("load_addr", c_uint16),
("init_addr", c_uint16),
("play_addr", c_uint16),
("game_name", c_char * 32),
("artist_name", c_char * 32),
("copyright_name", c_char * 32),
("ntsc_speed", c_uint16),
("start_banks", c_uint8 * 8),
("pal_speed", c_uint16),
("machine_flags", c_uint8),
("expansion_chips", c_uint8),
("_reserved", c_uint8),
("prg_size_lo", c_uint16),
("prg_size_hi", c_uint8),
)
hdr = NsfHeader()
hdr. In either case, it's showing inherited members but not the fields of the structure itself (no, they're not further scrolled down in the list). This is on: |
Beta Was this translation helpful? Give feedback.
-
Moving this issue to discussion as an enhancement request for comments and upvotes. |
Beta Was this translation helpful? Give feedback.
-
To me this is an essencial feature. |
Beta Was this translation helpful? Give feedback.
-
Describe the feature you are requesting
Python has by far the best support for binary structured data of any scripting language I'm familiar with in ctypes - better even than many compiled languages. PTVS supports IS/AC for classes, named tuples, and probably others I'm not familiar with. However, it does not appear to support ctypes structures et al, instead only showing the members of the metaclass. This issue requests IS/AC support for ctypes structures/unions/etc. in at least Visual Studio 2022+.
Beta Was this translation helpful? Give feedback.
All reactions