Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
I am cleaning up java code in vscode to make it more readable. When I format my document there are instances when vscode inserts new line character when I don't want it. Here I show 2 examples of w...
#3: Post edited
- I am cleaning up java code in vscode to make it more readable. When I format my document there are instances when vscode inserts new line character when I don't want it. Here I show 2 examples of when it does that.
- 1.
- I write:
- ```
if(a = 1) b = true;- ```
- When I format document vscode inserts new line before "b" like so:
- ```
if(a = 1)- b = true;
- ```
- 2.
- When I have a function with a lot of parameters which makes it very long (more than 120 characters, maybe?) it inserts new line in between parameters. Say I write:
- ```java
- a = abc(this_, function, takes, very1, very2, very3, very5, many, parameters);
- ```
- and vscode formats it like so:
- ```java
- a = abc(this_, function, takes, very1, very2, very3,
- very5, many, parameters);
- ```
- **How can I stop vscode from insert all of these new lines that I didn't ask for?**
- I am cleaning up java code in vscode to make it more readable. When I format my document there are instances when vscode inserts new line character when I don't want it. Here I show 2 examples of when it does that.
- 1.
- I write:
- ```
- if(a == 1) b = true;
- ```
- When I format document vscode inserts new line before "b" like so:
- ```
- if(a == 1)
- b = true;
- ```
- 2.
- When I have a function with a lot of parameters which makes it very long (more than 120 characters, maybe?) it inserts new line in between parameters. Say I write:
- ```java
- a = abc(this_, function, takes, very1, very2, very3, very5, many, parameters);
- ```
- and vscode formats it like so:
- ```java
- a = abc(this_, function, takes, very1, very2, very3,
- very5, many, parameters);
- ```
- **How can I stop vscode from insert all of these new lines that I didn't ask for?**
#2: Post edited
- I am cleaning up java code in vscode to make it more readable. When I format my document there are instances when vscode inserts new line character when I don't want it. Here I show 2 examples of when it does that.
- 1.
- I write:
- ```
- if(a = 1) b = true;
- ```
- When I format document vscode inserts new line before "b" like so:
- ```
- if(a = 1)
- b = true;
- ```
- 2.
- When I have a function with a lot of parameters which makes it very long (more than 120 characters, maybe?) it inserts new line in between parameters. Say I write:
- ```java
- a = abc(this_, function, takes, very1, very2, very3, very5, many, parameters);
- ```
- and vscode formats it like so:
- ```java
a = abc(this_, function, has, very1, very2, very3,- very5, many, parameters);
- ```
How can I stop vscode from insert all of these new lines?
- I am cleaning up java code in vscode to make it more readable. When I format my document there are instances when vscode inserts new line character when I don't want it. Here I show 2 examples of when it does that.
- 1.
- I write:
- ```
- if(a = 1) b = true;
- ```
- When I format document vscode inserts new line before "b" like so:
- ```
- if(a = 1)
- b = true;
- ```
- 2.
- When I have a function with a lot of parameters which makes it very long (more than 120 characters, maybe?) it inserts new line in between parameters. Say I write:
- ```java
- a = abc(this_, function, takes, very1, very2, very3, very5, many, parameters);
- ```
- and vscode formats it like so:
- ```java
- a = abc(this_, function, takes, very1, very2, very3,
- very5, many, parameters);
- ```
- **How can I stop vscode from insert all of these new lines that I didn't ask for?**
#1: Initial revision
Prevent vscode from inserting new lines in the middle of my code on format.
I am cleaning up java code in vscode to make it more readable. When I format my document there are instances when vscode inserts new line character when I don't want it. Here I show 2 examples of when it does that. 1. I write: ``` if(a = 1) b = true; ``` When I format document vscode inserts new line before "b" like so: ``` if(a = 1) b = true; ``` 2. When I have a function with a lot of parameters which makes it very long (more than 120 characters, maybe?) it inserts new line in between parameters. Say I write: ```java a = abc(this_, function, takes, very1, very2, very3, very5, many, parameters); ``` and vscode formats it like so: ```java a = abc(this_, function, has, very1, very2, very3, very5, many, parameters); ``` How can I stop vscode from insert all of these new lines?