@tsrx/language-server 0.6.3 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,8 +5,8 @@
5
5
 
6
6
  Language Server Protocol implementation for `.tsrx` files. It uses Volar and
7
7
  TypeScript to provide diagnostics, completions, hover information, navigation,
8
- document symbols, highlighting, and automatic closing tags. It formats `.tsrx`
9
- files with the project's Prettier (see [Formatting](#formatting)).
8
+ document symbols, code folding, highlighting, and automatic closing tags. It
9
+ formats `.tsrx` files with the project's Prettier (see [Formatting](#formatting)).
10
10
 
11
11
  The language server resolves the compiler selected by the active TypeScript
12
12
  project, so the same tooling works with React, Preact, Solid, Vue, Ripple, Octane,
@@ -69,7 +69,7 @@ pnpm add -D typescript
69
69
  When the server does not find `typescript`, or finds TypeScript 7, it still starts
70
70
  and shows one warning that says what it found and what to do. `.tsrx` files then
71
71
  do not get type checking, hover or completions. TSRX compile errors, CSS in
72
- `<style>`, the outline, formatting and closing tags still work.
72
+ `<style>`, the outline, code folding, formatting and closing tags still work.
73
73
 
74
74
  To use another TypeScript than the one it finds, pass that TypeScript's `lib`
75
75
  folder:
@@ -105,8 +105,8 @@ the `classic` backend cannot run it. For `.tsrx` files on TypeScript 7:
105
105
  `.tsrx` files, with the initialization option `runExternalCode: true`. It
106
106
  serves types, hover, completions and errors, TSRX compile errors included.
107
107
  3. Run this server next to it with `--typescript-backend=native`, for what
108
- TypeScript 7 does not do: CSS in `<style>`, the outline, formatting and closing
109
- tags. It loads no TypeScript in that mode.
108
+ TypeScript 7 does not do: CSS in `<style>`, the outline, code folding,
109
+ formatting and closing tags. It loads no TypeScript in that mode.
110
110
 
111
111
  ## TypeScript backends
112
112
 
@@ -262,8 +262,23 @@ Code's TypeScript closes the tags, or on TypeScript 7 the extension sends
262
262
  ## Restarts after package changes
263
263
 
264
264
  When a `package.json` or a lockfile changes (`pnpm install`, for example), the
265
- server must restart to load the TSRX compiler again. By default it exits with code
266
- 0, and the editor must start it again.
265
+ server must restart to load the TSRX compiler again. It waits until these files
266
+ have stopped changing for a second, and at most ten seconds.
267
+
268
+ Dev servers and builds write files under `node_modules` and framework build
269
+ directories (`.next`, `.nuxt`, `.output`, `.svelte-kit`, `.turbo`, `.vercel`) all
270
+ the time, so a file there restarts the server only when it shows that an install
271
+ finished: the file a package manager writes at the end of an install
272
+ (`node_modules/.modules.yaml`, `.package-lock.json`, `.yarn-state.yml` or
273
+ `.yarn-integrity`), or the `package.json` of a package installed directly in a
274
+ `node_modules` folder. A lockfile alone is not enough: `git pull` can change it
275
+ before the install that changes the compiler. Paths are read relative to the
276
+ workspace folder. By default the server exits with code 0, and the editor must
277
+ start it again.
278
+
279
+ On the `plugin` and `native` backends, the server watches only `.tsrx` files, JSON
280
+ files, lockfiles and these install files: the editor's TypeScript reads the
281
+ TypeScript and JavaScript sources.
267
282
 
268
283
  An editor that can restart the server itself sets the `restartNotification`
269
284
  initialization option. The server then sends a `tsrx/restartServer` notification
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- const require_server = require('./server-CpRcmosU.js');
2
+ const require_server = require('./server-B_LRzE1h.js');
3
3
 
4
4
  //#region src/language-server.js
5
5
  require_server.createTsrxLanguageServer();