Skip to content

refactor: port ITypeScriptServiceClient #782

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

Merged
merged 16 commits into from
Nov 1, 2023
Merged

refactor: port ITypeScriptServiceClient #782

merged 16 commits into from
Nov 1, 2023

Conversation

rchl
Copy link
Member

@rchl rchl commented Oct 29, 2023

This is a refactor to bring the code closer to the original VSCode implementation and make things easier to port in the future.

This should mostly have no observable differences besides some intentional smaller changes:

  • updated default settings used for projects that don't include tsconfig. New defaults include
    • moduleResolution: 'bundler' (if TS v5+)
    • target: 'es2022'
    • allowImportingTsExtensions: true (if TS v5+)
    • default to unix newlines when we don't know used newlines (LSP only reports newline character in formatting actions)
  • dropped some special cases for TS v2.50 and lower (no longer supported)
  • added handling for canceling some in-flight requests when document changes

@rchl rchl force-pushed the refactor/tsclient branch from ffebfdf to 5b0cfe3 Compare October 29, 2023 22:34
@github-actions
Copy link
Contributor

github-actions bot commented Oct 29, 2023

size-limit report 📦

Path Size
lib/cli.mjs 772.21 KB (+106.77% 🔺)

@rchl
Copy link
Member Author

rchl commented Nov 1, 2023

I'm disabling minification of built bundle since I found that otherwise, if the server crashes and reports an error, the whole minified line will be printed in the error message which hides the real error message and stack trace.

Also, it's easier to audit changes if built code is not aggressively minifed.

@rchl rchl changed the title refactor: track open documents using URI refactor: port ITypeScriptServiceClient Nov 1, 2023
@rchl rchl merged commit ab22e52 into master Nov 1, 2023
@rchl rchl deleted the refactor/tsclient branch November 1, 2023 22:26
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

Successfully merging this pull request may close these issues.

1 participant