Skip to content

Paste into editor (JS) adding extra tabs #788

Closed

Description

@jridge-ezclocker

NOTE: This could be related to a similar issue reported at: eclipse-wildwebdeveloper/wildwebdeveloper#1525

Searched around but didn't find an issue that seemed to match so forgive me if it is fixed in a future release or already reported :)

Main Issue: Paste Adds Unnecessary Tabs

When pasting code from another file into the editor additional unnecessary tabs get added. Example below:

  1. Starting with a basic JS class:
    initial

  2. Copy a property with getter/setter from another class (could also just be a method or code within a method):
    copy-from-different-file

  3. Paste the copied code into the initial file:
    past-into-initial-file

Notice the tabbing that is applied during the paste.

  1. From the cursor position after the initial paste, paste the code again
    paste-again-into-initial-file

Notice the additional tabbing that is applied during the paste.

  1. Formatting the code in the initial file does fixe most of the tab issues, however, the comments never get formatted properly:
    format-after-paste

Secondary Issue

Finally, an (I'm assuming) related issue involves adding a new line to a method (example), and backspacing to the beginning of the line, at that point the tab key does nothing at all:

  1. Add a New Line to the Method
    add-new-line

  2. Backspace (twice in this case) to the beginning of the line
    back-space-back-space-cannot-tab

  3. Pressing the tab key does nothing in the editor (cursor remains on the first column of line)

To get the tab key to function again I have to type at least one character and then go back to the beginning of the line to use the tab. Formatting normally fixes the issues as well unless a template literal multi-line string was entered (since formatting will ignore the template literal string formatting).

Just let me know if you would like the last item reported separately.

Eclipse Environment

  • Version: 2024-06 (4.32.0)
  • Build id: 20240606-1231

Select Plugin/Feature Versions

  • TM4E Related
    -- Language Configurations (com.genuitec.eclipse.tm4e.languageconfiguration): v2024.3.1.202407230323
    -- Language Configurations (org.eclipse.tm4e.languageconfiguration): v0.12.1.202407191108
    -- Language Pack (org.eclipse.tm4e.language_pack): v0.12.0.202405210827
    -- Registry management (org.eclipse.tm4e.registry): v0.12.1.202406131414
    -- UI (org.eclipse.tm4e.ui): v0.12.1.202407191108
    -- TextMate support in Java (org.eclipse.tm4e.core): v0.12.1.202407191108
  • LS4J Related
    -- LSP4J (org.eclipse.lsp4j): v0.23.1.v20240521-1815
    -- LSP4J Debug (org.eclipse.lsp4j.debug): v0.23.1.v20240521-1815
    -- LSP4J JsonRPC (org.eclipse.lsp4j.jsonrpc): v0.23.1.v20240521-1815
    -- LSP4J JsonPRC Debug (org.eclipse.lsp4j.jsonrpc.debug): v0.23.1.v20240521-1815
  • Wild Web Developer
    -- Wild Web Developer HTML, CSS, JSON, Yaml, JavaScript, TypeScript, Node tools: v1.3.6.202405280856
    -- Wild Web Developer XML tools: v1.3.4.202405270639

More Eclipse Environment Detail

Activity

  1. sebthom commented on Aug 20, 2024

    @sebthom
    Member

    This might be triggered by an indentation rule. Please try to disable them for the JS content type:

    image

  2. jridge-ezclocker commented on Aug 21, 2024

    @jridge-ezclocker
    Author

    Thanks for the time - Can confirm that unchecking that box doesn't result in extra tabs during paste. I'll close the defect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions