дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-26 11:18:20 +02:00
tsserver's method/member tokens were mapped to the plain function class. Methods now also get an instance- or static-method class, with Identifiers › Instance method and Static method on the JavaScript and TypeScript colour scheme page; unset, they keep the function declaration/call styles so existing themes look the same. JetBrains scheme import maps INSTANCE_MEMBER_FUNCTION and STATIC_MEMBER_FUNCTION to them. Fixes #5623
22 рядки
1.3 KiB
TypeScript
22 рядки
1.3 KiB
TypeScript
import { expect, test } from "@playwright/test";
|
|
|
|
const line = (page: import("@playwright/test").Page, n: number) => page.locator(".cm-line").nth(n).locator("span");
|
|
|
|
test("JavaScript methods keep the function colours until the scheme sets method colours", async ({ page }) => {
|
|
await page.goto("/e2e/jsMethodStyle.html");
|
|
// Unset: a method declaration looks like a function declaration, its calls like function calls.
|
|
await expect(line(page, 0)).toHaveClass(/cm-sem-js-instance-method/);
|
|
await expect(line(page, 0)).toHaveCSS("color", "rgb(102, 136, 170)");
|
|
await expect(line(page, 1)).toHaveCSS("color", "rgb(153, 187, 221)");
|
|
await expect(line(page, 2)).toHaveCSS("color", "rgb(153, 187, 221)");
|
|
await expect(line(page, 2)).toHaveCSS("font-style", "italic");
|
|
await expect(line(page, 3)).toHaveCSS("color", "rgb(153, 187, 221)");
|
|
|
|
await page.goto("/e2e/jsMethodStyle.html?methods");
|
|
// Set: declarations and calls of a method share its colour; plain functions keep theirs.
|
|
await expect(line(page, 0)).toHaveCSS("color", "rgb(224, 108, 117)");
|
|
await expect(line(page, 1)).toHaveCSS("color", "rgb(224, 108, 117)");
|
|
await expect(line(page, 2)).toHaveCSS("color", "rgb(207, 142, 109)");
|
|
await expect(line(page, 3)).toHaveCSS("color", "rgb(153, 187, 221)");
|
|
});
|