[issue45447] IDLE: Support syntax highlighting for .pyi stub files

2022-02-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: For the open dialog, we only need the expanded extension list. People with no-extension python code file must select 'all files'. Once the file is open, we need the issource function to decide whether to turn on the colorizer. I intend to review the patch

[issue45447] IDLE: Support syntax highlighting for .pyi stub files

2022-01-15 Thread Terry J. Reedy
Terry J. Reedy added the comment: A minimal version of util.py just for this issue is fine. What is blocking the issue deciding exactly what the minimum should be. Are both the extension list and function needed? Alex says somewhere in PR comments that ispythonsource passes directories.

[issue45447] IDLE: Support syntax highlighting for .pyi stub files

2022-01-15 Thread Alex Waygood
Alex Waygood added the comment: @terry, have you had a chance to glance at my PR at all? I'd really appreciate your review! :) -- ___ Python tracker ___ _

[issue45447] IDLE: Support syntax highlighting for .pyi stub files

2021-10-16 Thread Terry J. Reedy
Terry J. Reedy added the comment: We can add the mac change once it is manually tested on some system. I may try on my macbook. Windows will be another PR or even issue. -- ___ Python tracker

[issue45447] IDLE: Support syntax highlighting for .pyi stub files

2021-10-16 Thread Alex Waygood
Alex Waygood added the comment: Shall I add the change to the mac file to my PR, or would it be better to leave it for a separate PR? (I'm not confident enough to make the changes to the Windows files.) -- ___ Python tracker

[issue45447] IDLE: Support syntax highlighting for .pyi stub files

2021-10-16 Thread Steve Dower
Steve Dower added the comment: Bit more complicated. It'll need changes to Tools/msi/launcher/launcher_reg.wxs, Tools/msi/tcltk/tcltk_reg.wxs, and PC/layout/support/appxmanifest.py, but I don't think it's that obvious where (we don't want these files to open with py.exe by default, so they'l

[issue45447] IDLE: Support syntax highlighting for .pyi stub files

2021-10-15 Thread Terry J. Reedy
Terry J. Reedy added the comment: Steve, how do we make it so that "Edit with IDLE" appears when right-clicking on a .pyi file in Windows explorer? As easy as on mac (see Ronald's answer above)? -- nosy: +steve.dower ___ Python tracker

[issue45447] IDLE: Support syntax highlighting for .pyi stub files

2021-10-15 Thread Ronald Oussoren
Ronald Oussoren added the comment: The most straightforward change for macOS is to add “pyi” to the list of extensions in “Mac/IDLE/IDLE.app/Contents/Info.plist”. That way IDLE will be seen as a valid editor for .pyi files. -- nosy: +ronaldoussoren __

[issue45447] IDLE: Support syntax highlighting for .pyi stub files

2021-10-15 Thread Terry J. Reedy
Terry J. Reedy added the comment: Yes. After this issue is done, we should open a new issue and nosy Steve Dower, who is in charge of that for Windows, and Ned Deily, in case anything should be done on mac. -- ___ Python tracker

[issue45447] IDLE: Support syntax highlighting for .pyi stub files

2021-10-15 Thread E. Paine
E. Paine added the comment: Would it make sense, since this issue pretty much makes IDLE officially support .pyi files, to add the "Edit with IDLE" menu when right-clicking on a .pyi file in Windows explorer? -- ___ Python tracker

[issue45447] IDLE: Support syntax highlighting for .pyi stub files

2021-10-14 Thread Alex Waygood
Alex Waygood added the comment: Have posted my PR. I've tested it manually and run the IDLE test suite on it with the `-u all` setting; it seems fine. The new tests I've written are a bit thin on the ground right now, though. I may need some guidance/help if more extensive tests are needed -

[issue45447] IDLE: Support syntax highlighting for .pyi stub files

2021-10-14 Thread Alex Waygood
Change by Alex Waygood : -- keywords: +patch pull_requests: +27239 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/28950 ___ Python tracker

[issue45447] IDLE: Support syntax highlighting for .pyi stub files

2021-10-14 Thread E. Paine
Change by E. Paine : -- nosy: +epaine ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org

[issue45447] IDLE: Support syntax highlighting for .pyi stub files

2021-10-14 Thread Alex Waygood
Alex Waygood added the comment: Oh — I've already nearly finished a PR. Do you mind if I submit mine? Happy to make any changes you like, obviously. -- ___ Python tracker ___

[issue45447] IDLE: Support syntax highlighting for .pyi stub files

2021-10-13 Thread Terry J. Reedy
Terry J. Reedy added the comment: I am going to call the file util.py and will work on a PR. -- ___ Python tracker ___ ___ Python-b

[issue45447] IDLE: Support syntax highlighting for .pyi stub files

2021-10-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: Thank you for doing the research. I have been thinking about adding a file containing idlelib 'leaf' objects, those with no idlelib dependencies, which are needed in more than one file. would be to reduce the complexity of the idlelib dependency graph, which

[issue45447] IDLE: Support syntax highlighting for .pyi stub files

2021-10-12 Thread Alex Waygood
Alex Waygood added the comment: It looks like support for .py files is hardcoded into IDLE's source code in the following places: * browser.ModuleBrowserTreeItem.OnDoubleClick * browser.ModuleBrowserTreeItem.IsExpandable * browser.ModuleBrowserTreeItem.listchildren * editor.ispythonsource <

[issue45447] IDLE: Support syntax highlighting for .pyi stub files

2021-10-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: It should be fairly easy to recognize x.pyi as a python file. Just have to find the place. Something like def f(i:int) -> int: ... would have 'def' and 'int' highlighted. -- ___ Python tracker

[issue45447] IDLE: Support syntax highlighting for .pyi stub files

2021-10-12 Thread Alex Waygood
Change by Alex Waygood : -- title: Support syntax highlighting for .pyi stub files -> IDLE: Support syntax highlighting for .pyi stub files ___ Python tracker ___