Function argument wrapping + non-working Alt+Shift+ArrowUp


1. Having troubles with function argument wrapping. Anybody knows how to disable this feature from autotriggering (map it to a key would be the best solution) or disable it at all?

2. Anybody knows how to enable Alt+Shift+ArrowUp to copy a line of code in the above direction, like VS Code does? I use VS Code  key mapping, and Alt+Shift+ArrowDown works ok, it copies a line or block to a line below, but Alt+Shift+ArrowUp isn't working. 
 

0

1. Wrapping must be a result of the code re-formatting that is triggered on Ctrl+Alt+L (or whatever shortcut is assigned to Code > Reformat Code) or on saving if Reformat Code is enabled in Settings | Tools | Actions on Save.

2. Unfortunately it's not possible at the moment; please vote for IJPL-28604 to get notified of any progress with this feature.

0

Dear Elena, thank you for your response. 

I'm ok with all the reformatting, I use it and do not want to do anything with it, it works great. It's just the function argument wrapping in both plain JS and in React (props wrapping). Also I have to mention that wrapping is happening not because of space scarcity, it is triggered in cases where there's plenty of space available, it's clearly a formatting style decision that the IDE makes on my behalf. I just need that specific thing off. Like “Webstorm, you are doing great, thank you, just don't ever touch function params/args, not your thing, forget about them”.

0

Please could you share your code style preferences (<IDE config dir>/codestyles/<scheme name>.xml if you are using IDE-level scheme, or .idea\codeStyles\Project.xml when using a project scheme) plus a .js file that reproduces the issue?

0

There's only 1 file input on this page, and it accepts images only, so, I guess, I have to paste the code..)

XML: 

<component name="ProjectCodeStyleConfiguration">
 <code_scheme name="Project" version="173">
   <HTMLCodeStyleSettings>
     <option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
     <option name="HTML_ENFORCE_QUOTES" value="true" />
   </HTMLCodeStyleSettings>
   <JSCodeStyleSettings version="0">
     <option name="FORCE_SEMICOLON_STYLE" value="true" />
     <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
     <option name="FORCE_QUOTE_STYlE" value="true" />
     <option name="ENFORCE_TRAILING_COMMA" value="Remove" />
     <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
     <option name="SPACES_WITHIN_IMPORTS" value="true" />
   </JSCodeStyleSettings>
   <TypeScriptCodeStyleSettings version="0">
     <option name="FORCE_SEMICOLON_STYLE" value="true" />
     <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
     <option name="FORCE_QUOTE_STYlE" value="true" />
     <option name="ENFORCE_TRAILING_COMMA" value="Remove" />
     <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
     <option name="SPACES_WITHIN_IMPORTS" value="true" />
   </TypeScriptCodeStyleSettings>
   <VueCodeStyleSettings>
     <option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
     <option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
   </VueCodeStyleSettings>
   <codeStyleSettings language="HTML">
     <option name="SOFT_MARGINS" value="100" />
     <indentOptions>
       <option name="CONTINUATION_INDENT_SIZE" value="4" />
     </indentOptions>
   </codeStyleSettings>
   <codeStyleSettings language="JavaScript">
     <option name="SOFT_MARGINS" value="100" />
   </codeStyleSettings>
   <codeStyleSettings language="TypeScript">
     <option name="SOFT_MARGINS" value="100" />
   </codeStyleSettings>
   <codeStyleSettings language="Vue">
     <option name="SOFT_MARGINS" value="100" />
     <indentOptions>
       <option name="INDENT_SIZE" value="4" />
       <option name="TAB_SIZE" value="4" />
     </indentOptions>
   </codeStyleSettings>
 </code_scheme>
</component>


React


const {
  subscriptionLinksData,
  addSubscriptionLink
} = useStore();
const [linkState, setLinkState] = useState(initialState);

return <ModalCore title="Create New Free Trial Link" onCancel={exit} onAction={saveCreate} cancelTxt="Cancel"
                    actionTxt="Save">

    <form action="" onChange={handleLinkState}>
      <AnimatedInput fn={handleLinkState} id="name" value={linkState.name} label="Trial Link Name"/>
      <div className="link-options">

        {subscriptionLinksData.options.map(({
                                              name,
                                              text,
                                              options,
                                              label
                                            }) => <div className="select-container" key={name}>
          <label htmlFor={name}>{label}</label>
          <select name={name} id={name}>
            {options.map((option) => <option key={option}
                                             value={option}>{option ? `${option} ${text}` : "Unlimited"}</option>)}
          </select>

        </div>)}

      </div>
    </form>
  </ModalCore>;
}

0

Unfortunately I failed to reproduce the issue using the settings and code you have provided.

Do you use Prettier or .editorconfig in your project? They can override the IDE own code style preferences.

0

I don't use Prettier or anything along those lines

 {subscriptionLinksData.options.map(({
                                              name,
                                              text,
                                              options,
                                              label
                                            }) => 
this is the exact part I wanna avoid, the wrapping, also it wrapped the destructured return values from useStore()

___

But, I mean, I thought it's a setting somewhere I can't find, so asked for help. It's not the global issue that needs to be investigated, reproduced or something. I appreciate you time and your will to help. I think I'll live with what I've got, let them be randomly wrapped) 

Thank you for your time!

0

Normally this behavior is controlled by Settings | Editor | Code Style | JavaScript | Wrapping and Braces, Objects; but you have it set to Chop down if long, and I can't reproduce the issue when using your preferences.

Please note that you have the custom line breaks preserved, so the existing wrapping will persist regardless of the wrapping preferences. You need turning the Keep when reformatting > Line breaks off to have them removed.

 

0

请先登录再写评论。