alefragnani / vscode-separators

Separators Extension for Visual Studio Code
GNU General Public License v3.0
41 stars 6 forks source link

[FEATURE] - An option to have the separators below or above symbols #74

Closed zuhairtaha closed 2 years ago

zuhairtaha commented 2 years ago

Currently all separators appear before or at the beginning of symbols (functions, classes, ...) I would live to have them below (after) symbols. It will be nice to have an option to do that

That is because I use JavaScript with JsDocs comments before functions. the separator appear after JsDocs which doesn't look good to me. By having this option it will be great

alefragnani commented 2 years ago

Hi @zuhairtaha ,

I see. Yes, if you have docs above the symbols it can be quite noise.

But, do you mean the separator to be at:

a)

export async function readFile(filePath: string): Promise<string> {
--------------------------->> HERE <<---------------------------
    const bytes = await workspace.fs.readFile(Uri.parse(filePath));
    return JSON.parse(new TextDecoder('utf-8').decode(bytes));
}

or b)

export async function readFile(filePath: string): Promise<string> {
    const bytes = await workspace.fs.readFile(Uri.parse(filePath));
    return JSON.parse(new TextDecoder('utf-8').decode(bytes));
}
--------------------------->> HERE <<---------------------------

BTW, #21 asks to put the separator above the comments, which would be an alternative for your scenario.

Hope this helps

zuhairtaha commented 2 years ago

I want the second option Example

class MyMath {
  /**
   * @param {number} a
   * @param {number} b
   * @return {number}
   */
  add(a, b) {
    return a + b;
  }
---------------------------------
  /**
   * @param {number} a
   * @param {number} b
   * @return {number}
   */
  subtract(a, b) {
    return a - b;
  }
-----------------------------------
}