Uploaded image for project: 'VS Code Extension'
  1. VS Code Extension
  2. VSCODE-620

Update getRunnableContentFromString to allow for multiple code blocks

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.9.1
    • Affects Version/s: None
    • Component/s: None
    • None
    • 3
    • Iteration Light Year
    • Not Needed
    • Developer Tools

      Currently the `

      color: Color value is invalid

      getRunnableContentFromString` doesn't behave well when there are multiple code blocks. It currently will match all of the text between the first code block and the last one, and when the user runs it this will either error or do some unexpected behavior.

      color: Color value is invalid

      Instead we should iterate over the content returned, and when there's a full code block, we then can add the run actions. That way we allow for multiple code actions and also don't end making folks run the wrong code.

      color: Color value is invalid

      We could only return the runnable content from the last code block, this would be the easiest fix, but we should avoid this as ideally folks should be able to run any code block in the response.

      Let's also add tests for this, so we know how it behaves in more edge cases and prevent regressions.

            Assignee:
            rhys.howell@mongodb.com Rhys Howell
            Reporter:
            rhys.howell@mongodb.com Rhys Howell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: