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

Future ts/js language features to apply #2786

Open
phillco opened this issue Jan 28, 2025 · 0 comments
Open

Future ts/js language features to apply #2786

phillco opened this issue Jan 28, 2025 · 0 comments

Comments

@phillco
Copy link
Member

phillco commented Jan 28, 2025

Just for tracking the next time "we" (well, technically VS Code [1]) upgrade the TypeScript compiler version or the runtime, these are the smaller things we can bring along.

TypeScript 5.2 + ES2022 target

using

https://devblogs.microsoft.com/typescript/announcing-typescript-5-2/#using-declarations-and-explicit-resource-management

async function writeCommunityFile(snippetFile: SnippetFile, filePath: string) {
  const snippetText = serializeSnippetFile(snippetFile);
  using file = await fs.open(filePath, "wx");
  await file.write(snippetText);
  // No need to explicitly close - it will be automatically disposed
}

For this to work, you need:

  • TypeScript 5.2 or later
  • The target compiler option set to "ES2022" or later
  • The lib compiler option to include "ES2024.Symbol" or later

[1] although now we also have to include QuickJS, the Cursorless JetBrains embedded JavaScript runtime as well 🤔. Ideally we could have a sense for how easily those are to upgrade

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant