- 
                Notifications
    You must be signed in to change notification settings 
- Fork 748
Click filenames in stack trace to open locally in editor #6556
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
Conversation
| The latest updates on your projects. Learn more about Vercel for GitHub. 
 | 
| All contributors have signed the CLA  ✍️ ✅ | 
| I have read the CLA Document and I hereby sign the CLA | 
| # otherwise it silently opens the terminal in the same window that is | ||
| # running marimo. | ||
| if editor and not _is_terminal_editor(editor): | ||
| args = [path] | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can add tests for the arguments generation, maybe by moving it out to a separate function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extracted it to a separate function. Ideally it could even be in a separate package so various projects which open files in editors would share this logic. I took this snippet from my srcview package which iirc took it from git-mediate.
The main thing to test is that the editors really expect arguments this way but testing for that seems difficult.
        
          
                frontend/src/components/editor/output/MarimoTracebackOutput.tsx
              
                Outdated
          
            Show resolved
            Hide resolved
        
      831290f    to
    10167ab      
    Compare
  
    | The previously failing CI tests pointed me to the additional tests I needed to maintain so can now say the changes have tests :) Btw,  | 
1646c2b    to
    cf872ed      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @yairchu , I think it looks good overall.
By tests, I meant some Python ones to test the [args] generation.
Feel free to implement what you can, we can also help to add stuff and merge it in.
        
          
                frontend/src/components/editor/output/MarimoTracebackOutput.tsx
              
                Outdated
          
            Show resolved
            Hide resolved
        
      cf872ed    to
    98a4b34      
    Compare
  
    98a4b34    to
    844e999      
    Compare
  
    844e999    to
    da4c9a5      
    Compare
  
    da4c9a5    to
    89322d7      
    Compare
  
    Took editor arguments snippet from my srcview package. Can potentially extract that specific tidbit to a reusable function.
471fbf4    to
    d8aa727      
    Compare
  
    | I fixed the previous CI errors and I think this time this should be good! | 
| there is an error with the precommit, I created another PR for that. Thanks for the contribution! | 
| Looks like this time the 3 failing CIs aren't this PR's fault: 
 | 
| @yairchu this looks great! the failing tests are likely bc you are on a fork and our GH workflows likely don't handle that well, they are just red-herring, but the main tests do pass | 
📝 Summary
Fixes #6390
🔍 Description of Changes
EDITORto open the filemarimo._server.files.OSFileSystem.open_in_editornow supports opening a file in a specific line, which the traceback uses to open the relevant line from the trace📋 Checklist
Btw (devops)
I tried to follow the instructions according to
CONTRIBUTING.md, but:pnpmto work so had to usemake fefor an >1min dev feedback cycle. (btw I'm a front-end noob so I might be missing basic things)