Skip to content

arktypeio.arkdark syntax highlighting does not close strings in type() calls #1581

@BinToss

Description

@BinToss

Report a bug

Search Terms

ArkType VSCode Extension ArkDark syntax highlighting strings

Context

  • System:
    • OS: Linux 6.18 CachyOS Linux
    • CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12800H
    • Memory: 17.76 GB / 31.03 GB
    • Container: Yes
    • Shell: 4.3.3 - /bin/fish
  • Binaries:
    • code-oss: 1.107.1@994fd12 x64 - /usr/bin/code
      • w/ tweak to access VSCode marketplace
    • Node: 25.4.0 - /usr/bin/node
    • npm: 11.7.0 - /home/noah/repos/HaloSPV3/HCE.Shared/node_modules/.bin/npm
    • Deno: 2.6.5 - /usr/bin/deno
  • npmPackages:
    • @ark/schema: 0.56.0
    • @ark/util: 0.56.0
    • arktype: ^2.1.20 => 2.1.29
    • typescript: ^5.8.3 => 5.9.3
  • arktype.arkdark: 6.6.0

Repro

The playground does not exhibit the issue.
Playground Link: https://arktype.io/playground?code=%252F%252F%250A%252F%252F%2520arktype%2520syntax%2520bug%2520minimum%2520reproduction%250Aimport%2520%257B%2520type%2520%257D%2520from%2520%27arktype%27%253B%250A%250Aconst%2520nullableString%2520%253D%2520type%28%27string%2520%257C%2520undefined%27%29%253B%250A%252F**%250A%2520*%2520%257B%2540link%2520Thing%257D%253B%2520A%2520comment%2520following%2520a%2520%2560type%28%29%2560%2520call%2520behaves%2520oddly.%2520Especially%2520with%2520a%2520string%2520opener%252Fcloser%2520e.g.%2520%2560%252C%2520%2522%252C%2520or%2520%27.%250A%2520*%252F%250Aconst%2520Thing%2520%253D%2520nullableString%253B%250Aconst%2520out%2520%253D%2520Thing.from%28%27%27%29%253B%250Aconsole.log%28out%29%253B%250A%250A%252F%252F%250A

//
// arktype syntax bug minimum reproduction
import { type } from 'arktype';

const nullableString = type('string | undefined');
/**
 * {@link Thing}; A comment following a `type()` call behaves oddly. Especially with a string opener/closer e.g. `, ", or '.
 */
const Thing = nullableString;
const out = Thing.from('');
console.log(out);

//

The string syntax highlighting bug affects VSCode's typescript language mode, but not when set to typescriptreact.
The following screenshots are arranged according to this table:

ArkLight typescript typescriptreact
ArkDark typescript typescriptreact
Light Modern typescript typescriptreact
Dark Modern typescript typescriptreact
Image

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

To do

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions