Commit Graph

693 Commits

Author SHA1 Message Date
Maria José Solano 5fe88ea044 [Interactive inlay hints] Get source file from parameter node (#55476) 2023-08-23 16:40:49 -07:00
Jake Bailey 5e8c261b6a dprint the codebase (#54820) 2023-08-16 14:26:38 -07:00
Jake Bailey 87c986cae8 Modify interactive inlay hints API to be more backwards compatible (#55274) 2023-08-04 17:11:58 -07:00
Maria José Solano 97310107d0 Interactable parameter inlay hints (#54734) 2023-07-20 14:29:51 -07:00
Sheetal Nandi 3c4c060dff Adds tests and fixes issues by verifying incremental project updates are handling language service ref counting correctly (#54504) 2023-06-06 11:11:14 -07:00
Oleksandr T ce1c97f4f0 fix(54283): Provide better UX when an invalid file is selected for 'move to file' refactoring (#54300) 2023-05-18 10:36:34 -07:00
Gabriela Araujo Britto 24ac9e75c2 Improve class member snippet completions and keyword completions interaction (#52525) 2023-05-17 15:14:34 -07:00
Sheetal Nandi bbb9f2ebcf Just like request and response, events are also logged as formatted json for readability (#54105) 2023-05-02 13:32:12 -07:00
navya9singh 9d4c291e06 Adding missing parameter (#54045) 2023-04-27 12:36:55 -07:00
navya9singh d3bbef390d 'Move to file' refactor (#53542) 2023-04-21 11:48:53 -07:00
Maria José Solano e02ef9fddb Add quotes when renaming numerical indices (#53596) 2023-04-20 16:58:29 -07:00
Jake Bailey 5402998c55 Declare typingsInstaller as optional for ProjectService (#53896) 2023-04-18 14:10:30 -07:00
Isabel Duan d4c48e1495 Adds linked editing for JSX tags (#53284) 2023-04-07 13:39:10 -07:00
Sheetal Nandi 0ee51b96dc More baselining for timeouts that make furture changes easier (#53579) 2023-03-30 09:48:34 -07:00
Jake Bailey ac55b297b7 Upgrade "boolean-trivia" lint to new "argument-trivia" lint that uses type info, has quick fixes, etc. (#53002) 2023-03-23 16:26:39 -07:00
Sheetal Nandi 905a0b4e69 Create baselines for tsserver event tests (#53330) 2023-03-17 16:56:01 -07:00
Jake Bailey a727ca1571 Make perfLogger potentially undefined rather than using a noop logger (#53229) 2023-03-15 15:58:26 -07:00
Sheetal Nandi 1da6d87a05 ScriptInfo versioning improvements (#53001) 2023-03-01 15:55:37 -08:00
Sheetal Nandi dcc766f2b2 Remove long deprecated occurrences request (#52347) 2023-03-01 10:59:07 -08:00
Gabriela Araujo Britto 4775381811 Ensure projects are updated for find all references (#52583) 2023-02-06 15:42:05 -08:00
Jake Bailey 10941888dc Plumb formatting to getDocCommentTemplateAtPosition (#52349)
Fixes https://github.com/microsoft/TypeScript/issues/52348
2023-01-23 15:31:58 -08:00
Sheetal Nandi d76f3612c1 More removals of long deprecated APIs (#52343) 2023-01-20 15:25:06 -08:00
Sheetal Nandi e5515164eb Remove older deprecated APIs (#52338) 2023-01-20 12:55:04 -08:00
Jake Bailey ddac387c3e Deprecate CommandNames in favor of protocol.CommandTypes, direct import for better bundler output (#52208) 2023-01-19 16:31:50 -08:00
Jake Bailey 22b362ceac Enable strictFunctionTypes (#49929) 2023-01-17 17:20:51 -08:00
Jake Bailey f1ff0de943 Use native generators/iterables, remove helper cruft (#51921) 2023-01-06 14:40:56 -08:00
Andrew Branch e0bfac531b Rename module resolution option node to node10 (preserving backward-compatible alias) (#51901)
* Rename `node` to `node10` (preserving alias)

* Revert dogfooding change because of LKG

* Update baselines
2022-12-15 10:07:33 -08:00
Sheetal Nandi 3716ffe748 Make getSupportedCodeFixes on LS so it can be proxied by plugins (#51769)
Fixes #28966
2022-12-08 09:52:25 -08:00
Sheetal Nandi 9e845d2248 Api cleanup for Module and Type Reference directive resolution (#51546)
* Refactoring so CacheWithRedirects has Key and Value type parameters

* ModuleResolutionCache or TypeRefDirectiveCache will look in directory before solving, so ResolutionCache doesnt need this check

* Test showing module resolution is not shared because resolution cache doesnt update own options

* Enable traceResolution on some of the project reference tests

* Simplify CacheWithRedirects and ensure the options are set in all common scenarios so cache can be shared between redirects

* Make failedlookup etc optional in ResolvedModule/TypeRefefWithFailedLookupLocations
Also make accidental public failed lookup internal

* Add new API for module and type ref resolution

* Store auto type reference resolutions

* Modify test to show how using program partially doesnt report resolution diagnostics

* Ensure that resolution diagnostics are reported in filePreocessingDiagnostics so they can be reused when program is reused

* Some cleanup

* Remove the newly added ReoslutionInfo in favor of new APIs

* update
2022-12-05 11:56:33 -08:00
Jake Bailey 00dc0b6674 Flip imports to case insensitive sorting (#51579) 2022-11-17 15:35:28 -08:00
Jake Bailey 2d2a4343b8 Reformat imports to be one identifier per line (#51565) 2022-11-17 13:42:18 -08:00
Jake Bailey 9f64a3a58c Remove ts.{Map,Set,ESMap,Iterator} and associated types (#51439) 2022-11-09 15:06:31 -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 39e27fbb6b Fix up linting, make lint clean
Now that we are modules, there's no reason to ban multiple namespaces
per file; each file is its own scope and declaring a namespace won't
merge it into any other files.
2022-11-07 13:33:07 -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
Oleksandr T dbeae5d943 fix(51017): Make lineText in the references response opt-out (#51081)
* add option to exclude lineText from the response

* add comments

* update baseline
2022-10-07 09:13:22 -07:00
Andrew Branch 0ce72ef6c8 Add option to OrganizeImports for removal only (#50931)
* Remove unused imports

* Lint

* Update baselines

* Make mode paramter required

* Clean up
2022-09-29 16:30:02 -07:00
Sheetal Nandi 09368bcbae Handle if project for open file will get recollected because of pending cleanup from closed script info (#50908)
* Handle if project for open file will get recollected because of pending cleanup from closed script info
Fixes #50868

* Rename
2022-09-26 12:40:23 -07:00
Jake Bailey 16156b1baf Add rules from eslint's recommended set that triggered good lints (#50422) 2022-09-19 16:20:55 -07:00
Sheetal Nandi 6b890f93c4 Handle more places where package direcroy is converted to canonical file path (#50740)
* Add test for node16 resolution with package json lookup making casing incorrect

* Handle more places where package direcroy is converted to canonical file path
2022-09-12 15:11:35 -07:00
Sheetal Nandi b9a5bbc9af Syntax operations also need to ensure project is present for the open script infos since update could be pending to make sure open script info has project (#50418)
Also convert one relevant test case to baseline
Fixes #50131
2022-08-24 10:28:23 -07:00
Sheetal Nandi 5d790526a1 Pass correct module resolution state when reading package.json info so that they are correctly tracked in the resolution (#50085) 2022-07-28 17:19:10 -07:00
Andrew Casey 8402d657ab Document order-dependence of isLocal flag (#49959) 2022-07-19 14:38:35 -07:00
Andrew Casey 020ef41543 Add a simple queue implementation with better performance than Array.shift (#49623)
* Add a simple queue implementation with better performance than `Array.shift`

This lets us clean up the hack introduced in #49581

* Correct typo

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
2022-06-24 10:07:28 -07:00
Gabriela Araujo Britto 86d5040031 Fix renaming of node_modules (#49568)
* add bug repro test

* add test and start fix implementation

* adjust for useAlias preference

* fix existing renaming test

* refactor to get rid of options

* fix named bindings & other imports cases

* fix eslint error

* address cr comments

* hopefully actually fix eslint

* clean up stale baseline

* make API change non-breaking

* add/fix comments
2022-06-16 17:01:44 -07:00
Andrew Casey 01ba3a426b Tune FAR aggregation (#49581)
* Tune FAR aggregation

In making the work queue management more intelligible, we centralized the redundancy check at dequeue time.  As a result, the queue tends to get very large (~1.6M items for `SyntaxKind` in this repo) and dequeuing via `shift` is too slow to do that many times.  This change makes a few tweaks:

1. Use `Project` identity for de-duping and only maintain a set of keys for `loadAncestorProjectTree`
2. Attempt to filter prior to insertion
3. Use `splice` if many consecutive work queue items will be discarded.

On my box, this cuts FAR for `SyntaxKind` in parser.ts from 38 minutes to 20 seconds (we could do better, but effectively decided not to optimize this worst case scenario).
2022-06-16 16:11:55 -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