postmanlabs / postman-app-support

Postman is an API platform for building and using APIs. Postman simplifies each step of the API lifecycle and streamlines collaboration so you can create better APIs—faster.
https://www.postman.com
5.83k stars 838 forks source link

Code Snippet indentation settings are inconsistent #11963

Open sbettwieser opened 1 year ago

sbettwieser commented 1 year ago

Is there an existing issue for this?

Describe the Issue

Changing the indentation type from "space" to "tab" causes the indentation count setting to change both tab size and number of tabs for several languages (tested JS & Python options so far).

Steps To Reproduce

  1. Open or create a request
  2. Open the Code Snippet sidebar
  3. Select a JavaScript code option
  4. Click the cog to edit the language options
  5. Set indentation type to "Tab"
  6. Set indentation count to any number
  7. Observe that both number of tabs and the tab size (in spaces) have changed to the indentation count

Screenshots or Videos

image image

Operating System

Windows

Postman Version

10.13.4

Postman Platform

Postman App

User Account Type

Signed In User

Additional Context?

No response

VShingala commented 2 weeks ago

@sbettwieser Thanks for reporting the issue! But isn't this expected behaviour? i.e. Changing the indentation settings (type and count) also does change the indentation in generated snippet correctly. i.e. In your example 4 Tabs are indented wherever indentation is needed.

Could you explain more on what exactly the issue is or what's the expected behaviour you were looking for?

sbettwieser commented 2 weeks ago

@VShingala Hello, it's been a while since I made this post. I thought I had added more screenshot examples back then, so here you go:

Snippet Settings: Indentation count: 4 Indentation type: tab Result: Indentation is 4 tabs of size 4 image

Snippet Settings: Indentation count: 2 Indentation type: tab Result: Indentation is 2 tabs of size 2 image

The script editor works correctly (in my opinion): changing indentation count while using tabs only changes the tab size. It is just the code snippets that are acting weird, changing both.

VShingala commented 1 week ago

@sbettwieser Thanks for the explanation! It makes sense. Code Snippets seems to also add actual 4 tabs on top of editor making the tab indentation of 4 space. We'll work on fix for this and inform here once it's fixed.

aman-v-singh commented 6 days ago

This issue will be fixed in the 11.16 version of the Postman App.