29 Commits

Author SHA1 Message Date
Jake Bailey
5e8c261b6a
dprint the codebase (#54820) 2023-08-16 14:26:38 -07:00
Jake Bailey
2d2a4343b8
Reformat imports to be one identifier per line (#51565) 2022-11-17 13:42:18 -08:00
Jake Bailey
d12116d8da Fix all internal JSDoc comments
If these are regular comments, then they won't appear in our d.ts files.
But, now we are relying on an external d.ts bundler to produce our final
merged, so they need to be present in the "input" d.ts files, meaning
they have to be JSDoc comments.

These comments only work today because all of our builds load their TS
files from scratch, so they see the actual source files and their
non-JSDoc comments.

The comments also need to be attached to a declaration, not floating,
otherwise they won't be used by api-extractor, so move them if needed.
2022-11-07 13:34:44 -08:00
Jake Bailey
07758c08ab Generated module conversion step - inlineImports
This step converts as many explicit accesses as possible in favor of direct imports from the modules in which things were declared. This restores the code (as much as possible) back to how it looked originally before the explicitify step, e.g. instead of "ts.Node" and "ts.Symbol", we have just "Node" and "Symbol".
2022-11-07 13:33:07 -08:00
Jake Bailey
b6c0538826 Generated module conversion step - stripNamespaces
This step converts each file into an exported module by hoisting the namespace bodies into the global scope and transferring internal markers down onto declarations as needed.

The namespaces are reconstructed as "barrel"-style modules, which are identical to the old namespace objects in structure. These reconstructed namespaces are then imported in the newly module-ified files, making existing expressions like "ts." valid.
2022-11-07 13:32:03 -08:00
Jake Bailey
9a0b85ce2a Generated module conversion step - explicitify
This step makes all implicit namespace accesses explicit, e.g. "Node" turns into "ts.Node".
2022-11-07 13:29:05 -08:00
Jake Bailey
94724a8c2e Generated module conversion step - unindent
This step makes further commits look clearer by unindenting all of the top level namespaces preemptively.
2022-11-07 13:28:13 -08:00
Sheetal Nandi
d293e723a2
Rename API to importPlugin (#50554)
* Rename API to importPlugin

* Make it internal too
2022-08-31 14:21:56 -07:00
Matt Bierner
3fc5f968ca
Enable TS Server plugins on web (#47377)
* Prototype TS plugins on web

This prototype allows service plugins to be loaded on web TSServer

Main changes:

- Adds a new host entryPoint called `importServicePlugin` for overriding how plugins can be loaded. This may be async
- Implement `importServicePlugin` for webServer
- The web server plugin implementation looks for a `browser` field in the plugin's `package.json`
- It then uses `import(...)` to load the plugin (the plugin source must be compiled to support being loaded as a module)

* use default export from plugins

This more or less matches how node plugins expect the plugin module to be an init function

* Allow configure plugin requests against any web servers in partial semantic mode

* Addressing some comments

- Use result value instead of try/catch (`ImportPluginResult`)
- Add awaits
- Add logging

* add tsserverWeb to patch in dynamic import

* Remove eval

We should throw instead when dynamic import is not implemented

* Ensure dynamically imported plugins are loaded in the correct order

* Add tests for async service plugin timing

* Update src/server/editorServices.ts

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>

* Partial PR feedback

* Rename tsserverWeb to dynamicImportCompat

* Additional PR feedback

Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2022-06-14 12:35:53 -07:00
Sheetal Nandi
236012e47b
Add watchOptions to tsconfig and allow supplying them on command line as well (#35615)
* Create different watch options in compiler options

* Thread through the new watch options

* Actually use the options passed through for watch strategy

* Support delay on updating child directory watches

* Make watchOptions separate from compilerOptions

* Support passing watch options from command line

* Handle displaying of watchOptions
2019-12-11 13:26:44 -08:00
Wesley Wigham
a78342a160
Move most harness globals into namespaces (#35530)
* Move most harness globals into namespaces

* Remove forward declaration from `createMapShim` and move all `Map` declarations into one file

* A small pile of more changes to get the harness transforming
2019-12-06 15:20:49 -08:00
Ryan Cavanaugh
ab10b86205 Almost working? 2018-06-10 19:28:38 -07:00
Sheetal Nandi
db9620d8f0 Use watch recursive directories instead of watchFile for node_modules and bower components 2018-04-17 14:27:21 -07:00
Ryan Cavanaugh
3ca1d2d7e3 Remove all reference comments from server/ 2018-04-11 15:38:26 -07:00
Benjamin Lichtman
f989ef7261
Merge pull request #21004 from uniqueiniquity/updateATA
Enable typings cache entries to expire and be updated
2018-02-09 14:17:26 -08:00
Wesley Wigham
871e71d4ef
Move insertSorted from server to core, use for diagnostic collections (#21401)
* Move insertSorted from server to core, use for diagnostic collections

* All keep the overall list sorted, too

* Increase timeout for js verification

* Use knowledge of how diagnostics are sorted to make all diagnostic list creation lazy and more efficient

* Staunchly avoid array allocation in favor of resizing an existing array
2018-02-07 17:00:59 -08:00
uniqueiniquity
a21f73f862 Remove timestamp checking and move registry check into jstyping 2018-01-11 12:58:22 -08:00
uniqueiniquity
e72ea6f7b1 Update installed types if older than those listed in the registry 2018-01-11 12:58:22 -08:00
uniqueiniquity
9d298a13a1 [WIP] enable updating ATA files 2018-01-11 12:58:21 -08:00
Sheetal Nandi
8cc2936352 Move watchFile and watchDirectory to WatchCompilerHost 2017-12-05 18:09:10 -08:00
Andrew Casey
35545d4a0a Update project on PackageInstalledResponse
As with `SetTypings`, new typings have been installed so the project
should be updated and the client should be notified (via event).

Changed PackageInstalledResponse from "event" to "action" for the sake
of explicitness.

Fixes #20084.
2017-11-21 15:59:46 -08:00
Andy
d05443bb1d Add quickfix and refactoring to install @types packages (#19130)
* Add quickfix and refactoring to install @types packages

* Move `validatePackageName` to `jsTyping.ts`

* Remove combinePaths overloads

* Respond to code review

* Update api baselines

* Use native PromiseConstructor

* Return false instead of undefined

* Remove getProjectRootPath

* Update api
2017-10-17 15:04:09 -07:00
Andy
382785a528 Fix logging of module resolution errors (#17144) 2017-08-08 07:54:08 -07:00
Andy
555776eb3c Minor cleanups in builder (#17208)
* Minor cleanups in builder

* Use enumerateInsertsAndDeletes
2017-07-17 12:24:56 -07:00
Andy
d2ec45f354 Remove unnecessary 'ts.' qualifications (#17163) 2017-07-13 13:08:59 -07:00
Vladimir Matveev
17cb68cbbf send error if obtaining of types-registry package failed (#14573) 2017-03-10 10:34:01 -08:00
Ryan Cavanaugh
aec310996c Language service extensibility 2017-02-14 13:35:16 -08:00
Joel Day
3a9a136e51 Changes based on feedback.
Whitespace cleanup.
Switching back to protocol.ts and reenabling stripInternal.
Marking internal symbols indirectly exported by dependencies of protocol.ts as internal.
2017-01-04 15:56:16 -08:00
Joel Day
8b44ce2fd7 Emitting tsserverlibrary as an external module. 2016-12-31 17:37:51 -08:00