gem5-dev@gem5.org

The gem5 Developer List

View all threads

Make m5 internals available to Python interpreter (for syntax highlighting in vscode)

TB
Tiberiu Bucur
Tue, Sep 12, 2023 12:39 PM

Hi!

I use VSCode as my day-to-day text editor and everything in the m5 package (including the package itself) is underlined by the editor, as the underlying Python interpreter cannot locate the package and classes within. Any idea how I can solve this? (I am new to gem5, so explaining in as much detail as possible would be appreciated).

Thanks,
Tiberiu
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

Hi! I use VSCode as my day-to-day text editor and everything in the m5 package (including the package itself) is underlined by the editor, as the underlying Python interpreter cannot locate the package and classes within. Any idea how I can solve this? (I am new to gem5, so explaining in as much detail as possible would be appreciated). Thanks, Tiberiu IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
BB
Bobby Bruce
Tue, Sep 12, 2023 10:28 PM

I've created a pull request here which should help: https://github.com/gem5/gem5/pull/307.

From playing around with this mypy.stubgen fix, it helps the Pylance IntelliSence but it isn't complete. What's notably lacking are doc-strings (so methods, classes, etc don't have documentation on arguments come up) and it still doesn't understand some imports. from m5.objects is still still coming up underlined but System and SrcClockDomain is being parsed correctly.

--
Dr. Bobby R. Bruce
Room 3050,
Kemper Hall, UC Davis
Davis,
CA, 95616

web: https://www.bobbybruce.net

On Sep 12, 2023, at 5:39 AM, Tiberiu Bucur via gem5-dev gem5-dev@gem5.org wrote:

Hi!

I use VSCode as my day-to-day text editor and everything in the m5 package (including the package itself) is underlined by the editor, as the underlying Python interpreter cannot locate the package and classes within. Any idea how I can solve this? (I am new to gem5, so explaining in as much detail as possible would be appreciated).

Thanks,
Tiberiu
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. <Screenshot from 2023-09-11 14-35-04.png>_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org mailto:gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-leave@gem5.org mailto:gem5-dev-leave@gem5.org

I've created a pull request here which should help: https://github.com/gem5/gem5/pull/307. From playing around with this mypy.stubgen fix, it helps the Pylance IntelliSence but it isn't complete. What's notably lacking are doc-strings (so methods, classes, etc don't have documentation on arguments come up) and it still doesn't understand some imports. `from m5.objects` is still still coming up underlined but `System` and `SrcClockDomain` is being parsed correctly. -- Dr. Bobby R. Bruce Room 3050, Kemper Hall, UC Davis Davis, CA, 95616 web: https://www.bobbybruce.net > On Sep 12, 2023, at 5:39 AM, Tiberiu Bucur via gem5-dev <gem5-dev@gem5.org> wrote: > > Hi! > > I use VSCode as my day-to-day text editor and everything in the m5 package (including the package itself) is underlined by the editor, as the underlying Python interpreter cannot locate the package and classes within. Any idea how I can solve this? (I am new to gem5, so explaining in as much detail as possible would be appreciated). > > Thanks, > Tiberiu > IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. <Screenshot from 2023-09-11 14-35-04.png>_______________________________________________ > gem5-dev mailing list -- gem5-dev@gem5.org <mailto:gem5-dev@gem5.org> > To unsubscribe send an email to gem5-dev-leave@gem5.org <mailto:gem5-dev-leave@gem5.org>