Skip to content

Auto indent on paste is incorrect in strings #209418

Closed

Description

  • 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

Activity

  1. added
    bug
    on Apr 3, 2024
  2. aiday-mar commented on Apr 18, 2024

    @aiday-mar
    Collaborator

    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?

  3. added
    unreleased
    on May 27, 2024
  4. added
    insiders-released
    and removed
    unreleased
    on May 28, 2024
  5. locked and limited conversation to collaborators on Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugeditor-autoindentinsiders-releasedverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions