Skip to content

Quick fix "Add throws declaration" removes backslashes and qute fragments #4314

@LukasLeppich

Description

@LukasLeppich

There are some unwanted changes made by the "Add throws declaration" Quick fix action.

If you use the QuickFix action Add throws declarat... the java extension will remove the fragment name of the second Template specification and the escaped backslashes from the string.

Before executing the QuickFix:

    String someString = "Escaped\\Test\\Path";

    @CheckedTemplate
    static class Templates {
        public static native TemplateInstance page();
        public static native TemplateInstance page$content();
    }

After performing the QuickFix:

    String someString = "Escaped\Test\Path";

    @CheckedTemplate
    static class Templates {
        public static native TemplateInstance page();
        public static native TemplateInstance page();
    }

Steps to reproduce:

  1. Clone reproducer repository: https://github.com/LukasLeppich/vscode-java-quickfix-bug
  2. Create a new VSCode Profile
  3. Install the Extension Pack for Java extension
  4. Open the SomePage.java class and perform the Add throws declarat... Quick Fix on line 30 service.test();

Tested with the following setup:

Vscode:
Version: 1.108.1 (user setup)
Commit: 585eba7c0c34fd6b30faac7c62a42050bfbc0086
Date: 2026-01-14T14:55:44.241Z

Extensions:
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions