Alien
June 12, 2024, 7:58am
1
Bit of a gripe, or maybe there’s a function I’m unaware of (I hope)…
In Dynamo I have a perfectly fine looking bit of code:
However, I get an indent error, which I get a lot…
I constantly have Visual Studio open which instantly shows me where the issue is:
And in VS I can really easily shift +tab…
Any chance this functionality can be added to the Python window in Dynamo?
Please submit this as an Idea to the roadmap, I think it would be a good idea to make the Python node in to a better “IDE”
Roadmap - Dynamo BIM
Alien
June 12, 2024, 8:11am
3
How do you submit an idea, that link takes me to the roadmap and shows me what they’re doing / not doing. I couldn’t see anywhere to submit.
Don’t you have the button in the upper right corner?
Do you know if there is any special demands to be able to Submit ideas to the roadmap?@zachri.jensen @jacob.small
Alien
June 12, 2024, 8:21am
7
Tbh it’s probably my browser… I get a lot of vanishing stuff.
I can fix the submitting to the road map if you want me to.
Alien
June 12, 2024, 8:25am
9
Thanks, my usual work around worked:
I think it’s got something to do with my cache… but further than that I have no clue why it does this.
I have loads of issues with wikipedia.
It is your cache. Clear it out and you should be fine. Stop trying to eat the cookies to prevent the issue from recurring; they aren’t tasty anyway.
Switching on the 'show white space" in your Python preferences makes finding these pretty easy, though not as easy as VS as Dynamo’s editor doesn’t check the code until it attempts to execute (otherwise it’d have to periodically call the functions you’re building which would eventually crash Revit/Civil/Dynamo).
Alien
June 12, 2024, 8:42am
14
I cleared my cache last week and I regretted it… All my lovely cookies gone and I had to dredge my memory for passwords…
1 Like
Hi,
it has a feature that was recently added
DynamoDS:master
← ivaylo-matov:DYN-6794-Python-script-editor-convert-legacy-tabs-to-spaces
opened 03:54PM - 25 Apr 24 UTC
### Purpose
PR to address https://jira.autodesk.com/browse/DYN-6794 & https:/… /github.com/DynamoDS/Dynamo/issues/15033 .
Added button in the Python script editor to convert tab indentations from legacy Python code to space indentations.
Includes test.
![DYN-6794-fix](https://github.com/ivaylo-matov/Dynamo/assets/48355182/744e4589-0621-4984-907e-bbfff9c79c0e)
### Declarations
Check these if you believe they are true
- [ ] The codebase is in a better state after this PR
- [ ] Is documented according to the [standards](https://github.com/DynamoDS/Dynamo/wiki/Coding-Standards)
- [ ] The level of testing this PR includes is appropriate
- [ ] User facing strings, if any, are extracted into `*.resx` files
- [ ] All tests pass using the self-service CI.
- [ ] Snapshot of UI changes, if any.
- [ ] Changes to the API follow [Semantic Versioning](https://github.com/DynamoDS/Dynamo/wiki/Dynamo-Versions) and are documented in the [API Changes](https://github.com/DynamoDS/Dynamo/wiki/API-Changes) document.
- [ ] This PR modifies some build requirements and the readme is updated
- [ ] This PR contains no files larger than 50 MB
### Release Notes
Added button in Python to convert tab indentations to space indentations so that users can run legacy code.
Icon for the convert button is a place holder.
PS: Tried a few options where we suppress the conversion to spaces in PythonIndentationStrategy but ultimately they all lead to problems beyond just pasting code with tab indentations. Preserving the current strategy and converting legacy code to the modern convention seem a better solution.
### Reviewers
@dnenov
@reddyashish
### FYIs
@Amoursol
2 Likes
Use this comment as an “I hate being forced to use spaces” button.
(Hate from space bar losers incoming in 3,2,1…)
2 Likes
Count me in.
4x the file size for formatting
Increased compiler time
Increased memory consumption
Increased accessibility for people using screen readers (some of which are limited to 12 characters, and white spaces count)
The only ‘benefit’ I have seen for spaces is that they ensure consistency across environments - a space in notepad is the same dimension as a space in VisualStudio as a space in the Dynamo Python Ecitor is the same as a web page… but even that isn’t true as people can (and will) adjust kerning and font selection, so… yeah.
I would be happy if the ‘paste’ command forced tabs to become spaces, but until then I’ll point out that we aren’t being as welcoming as we could to all any time the topic comes up.