Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open code in external editor #1647

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

samamou
Copy link
Contributor

@samamou samamou commented Dec 27, 2024

  • Reuse previous editor instance instead of launching a new one each time and ending up with 30 sublime / vscode files open for each edit :')
    • before creating a new file, check if it exists?

@samamou samamou linked an issue Dec 27, 2024 that may be closed by this pull request
@jcelerier
Copy link
Member

https://media.tenor.com/5nSKlBlwdkIAAAAi/cat.gif

@samamou
Copy link
Contributor Author

samamou commented Dec 31, 2024

QFileSystemWatcher to monitor if a temp file changes externally + syncs updates back into the score editor? @jcelerier

@jcelerier
Copy link
Member

jcelerier commented Dec 31, 2024

yep ! but keep in mind this issue: https://stackoverflow.com/questions/18300376/qt-qfilesystemwatcher-signal-filechanged-gets-emited-only-once/18304496

so a bit of intelligence is needed - I think the best way is the answer that proposes watching the parent folder for newly created file, and check if it matches.

Also I think this behaviour should be encapsulated in a entirely separate utility class as there is this requirement in multiple other places in ossia :)

@samamou
Copy link
Contributor Author

samamou commented Jan 6, 2025

oki another crash on thread 20 here score-crash.txt
trying to retrace what i did that caused this

Copy link
Member

@jcelerier jcelerier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great, I have small nitpicks but the code looks very clean, !

@samamou
Copy link
Contributor Author

samamou commented Jan 13, 2025

I spoke to Lou and Zach briefly about scripting in other software to discuss the behavior they expect

Feedback:

  • Workflow / sync : they expect the external editor changes to update in score automatically onSave(), aligning with live-coding workflows
  • Error feedback : they both expect visual feedback indicating an issue (syntax error) directly on or near the node in the scenario editor. Feedback from bespoke editor:

Possible quick implementation:
Screenshot 2025-01-13 at 2 50 30 PM

It also got me thinking, is it possible to have this open up and direct the log/output here / to another terminal instead of the QTextEditor + give feedback onCompile()/onRun() such as adding a comment block SUCCESSFULLY COMPILED

Screenshot 2025-01-13 at 2 50 30 PM
  • Code MiniView (Internal viewer) : they appreciate having a quick inline read-only view of the code without needing to open a full external editor. They said "Currently in score, a Dialog blocks your view of the Scenario Editor" blocks feels like a heavy word, and i guess there could be a lighter way of presenting this information, for quick checking. For example, a collapsible inline "peek" panel? (not sure how this would like)

https://nodes.io/

vscode peek window

@jcelerier can you please tell me which is high/ low effort?

@jcelerier
Copy link
Member

Amazing thanks for this analysis !

@jcelerier
Copy link
Member

Workflow / sync : they expect the external editor changes to update in score automatically onSave(), aligning with live-coding workflows

sounds like what we discussed earlier, this is also what i'd expect as behaviour

Error feedback : they both expect visual feedback indicating an issue (syntax error) directly on or near the node in the scenario editor.

yep, that sounds doable (in a further PR!). Should be done here: https://github.com/jcelerier/QCodeEditor ; I also like the "red" error state that you propose, imho this one should be generalised as there are definitely non-code-editor things which can be in erroneous states like this!

For the immediate needs though, I think a bespoke-like thing with the line being underlined is the best bet. (again, in a further PR, this is another feature on top of this one.)

Code MiniView (Internal viewer) : they appreciate having a quick inline read-only view of the code without needing to open a full external editor. They said "Currently in score, a Dialog blocks your view of the Scenario Editor" blocks feels like a heavy word, and i guess there could be a lighter way of presenting this information, for quick checking. For example, a collapsible inline "peek" panel? (not sure how this would like)

yeah, this one's more of a challenge and to be thought of as part of a more general "debug overlays" feature, e.g. to see for instance not only code but also inputs & outputs signals, textures, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add "open in external editor" button to embedded editor
2 participants