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

When running tests via the Explorer's Run Tests context menu, the Response window disappears #317

Closed
alekdavisintel opened this issue Aug 5, 2024 · 4 comments

Comments

@alekdavisintel
Copy link

The Explorer view's Run Tests context menu is really handy (love it!), but I noticed that whenever I use it, the Response window automatically closes. I run a test using any other option, the Response window comes back, try the context menu and it disappears again. Kind of annoying because I have not yet figured out how to open the Response tab once it gets closed.

@AnWeber
Copy link
Owner

AnWeber commented Aug 5, 2024

@alekdavisintel There is no vscode API that allows me to close documents.. The fact that the document closes could have something to do with the settings (all preview settiings). By naming the document response I think that you have set httpyac.responseViewMode to reuse. Have you changed a few more settings? I would recommend preview, but this assumes that preview is generally allowed (workbench.editor.enablePreview).
To reopen last responses you could use history feature of vscode extension. Just click the last response
image

@alekdavisintel
Copy link
Author

That's really weird, I can duplicate this (closing the response window) in one project, but not in the other. Here is my settings.json file for the project where the window gets closed:

{
  "httpyac.addStreamingResponsesToHistory": false,
  "httpyac.codelens": {
    "generateCode": true,
    "sendAll": true,
    "sendRepeat": true,
    "sendSelected": true,
    "showResponse": true,
    "showResponseHeaders": true,
    "showVariables": true,
    "validateVariables": true,
    "saveResponse": true,
    "resetEnvironment": true,
    "generateCodeSelectLanguage": true,
    "clearHistory": true
  },
  "httpyac.environmentPickMany": false,
  "httpyac.environmentSelectedOnStart": [
    "some-environment"
  ],
  "httpyac.environmentStoreSelectedOnStart": false,
  "httpyac.environmentUseSameForAllFiles": true,
  "httpyac.useDecorationProvider": true,
  "httpyac.useMethodInSendCodeLens": true,
  "httpyac.responseStorage": "global",
  "httpyac.responseViewColumn": "beside",
  "httpyac.environmentShowStatusBarItem": true,
  "httpyac.responseViewMode": "reuse",
  "httpyac.decorationInactiveRegion": {
    "border": "dotted rgba(127, 127, 127, 80%)",
    "borderWidth": "0 0 2px 0",
    "isWholeLine": true
  },
  "httpyac.generateCodeDefaultLanguage": {
    "target": "shell",
    "client": "curl"
  },
  "httpyac.logOutputChannelOptions": {
    "requestOutput": true,
    "requestHeaders": true,
    "requestBodyLength": 2048,
    "responseHeaders": true,
    "responseBodyLength": 4096
  },
  "httpyac.responseViewContent": "full",
  "httpyac.useCodeLensInNotebook": true,
  "httpyac.requestGotOptions": {
    "https": {
      "rejectUnauthorized": false
    }
  },
  "httpyac.testResetEnvBeforeRun": true,
  "breadcrumbs.enabled": false,
  "editor.tabSize": 2,
  "editor.insertSpaces": true,
  "editor.detectIndentation": false,
  "workbench.editor.enablePreview": true,
  "httpyac.maxHistoryItems": 25
}

The enablePreview option made no difference. I also tried setting the responseViewContent to preview, but it did not show the response at all. Basically, I am trying the response window to behave like this: always show response when a test runs, display response in the same window (in the right panel). I will play with options. Maybe I can set it to a physical file in the workspace and add this file (or folder) to the to the .gitignore list. Need to spend a bit more time figuring out what combination of options will work best. Do not worry about it unless there is something obvious.

@alekdavisintel
Copy link
Author

Also, I noticed that when I run tests from the Testing view, the HISTORY option does not appear under the httpYac view:

image

It does appear if I run the test using the arrow or the code lense in the source file.

@AnWeber
Copy link
Owner

AnWeber commented Aug 21, 2024

reproduced
response_gone

If I enable the setting workbench.editor.closeOnFileDelete, then I can reproduce the behavior. The reason is that the file is automatically deleted, on reset of the environment which happens on each test run. I would have adjusted the logic so that visible files are not deleted on reset and thus do not trigger the behavior

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

No branches or pull requests

2 participants