Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto indent on paste is incorrect in strings #209418

Closed
alexdima opened this issue Apr 3, 2024 · 1 comment · Fixed by #210761
Closed

Auto indent on paste is incorrect in strings #209418

alexdima opened this issue Apr 3, 2024 · 1 comment · Fixed by #210761
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug editor-autoindent Editor auto indentation issues insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Milestone

Comments

@alexdima
Copy link
Member

alexdima commented Apr 3, 2024

  • Use the following TS code:
test('should run folder', async ({ runUITest }) => {
  const { page } = await runUITest({
    'a/folder-b/folder-c/inC.test.ts': `
      import { test, expect } from '@playwright/test';
      test('passes', () => {});
    `,
    'a/folder-b/in-b.test.ts': `
      import { test, expect } from '@playwright/test';
      test('passes', () => {});
    `,
    'a/in-a.test.ts': `
      import { test, expect } from '@playwright/test';
      test('passes', () => {});
    `,
  });

  await page.getByText('folder-b').hover();
  await page.getByRole('listitem').filter({ hasText: 'folder-b' }).getByTitle('Run').click();

  await expect.poll(dumpTestTree(page)).toContain(`
    ▼ ✅ folder-b <=
      ► ✅ folder-c
      ► ✅ in-b.test.ts
    ▼ ◯ in-a.test.ts
        ◯ passes
  `);
});
  • select
  • copy it
  • paste on top of itself
  • observe that the line unindents
  • I suggest we try to skip auto-indenting inside multiline strings
Kapture.2024-04-03.at.10.45.55.mp4
Version: 1.84.0 (Universal)
Commit: d037ac076cee195194f93ce6fe2bdfe2969cc82d
Date: 2023-11-01T11:30:19.406Z
Electron: 25.9.2
ElectronBuildId: 24603566
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Darwin arm64 23.4.0
@alexdima alexdima added the editor-autoindent Editor auto indentation issues label Apr 3, 2024
@aiday-mar aiday-mar added the bug Issue identified by VS Code Team member as probable bug label Apr 3, 2024
@aiday-mar
Copy link
Contributor

I assume you mean we should skip indentation in multi line strings in all cases, not just on pasting. Meaning that on typing enter for example, we should ignore indentation of previous lines when inside of a multi line string?

@vscodenpa vscodenpa added the unreleased Patch has not yet been released in VS Code Insiders label May 27, 2024
@vscodenpa vscodenpa added this to the May 2024 milestone May 27, 2024
@vscodenpa vscodenpa added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels May 28, 2024
@alexdima alexdima added the verified Verification succeeded label May 28, 2024
@microsoft microsoft locked and limited conversation to collaborators Jul 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug editor-autoindent Editor auto indentation issues insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants