Commit Graph

2022 Commits

Author SHA1 Message Date
Sheetal Nandi
df3bec6674 Tweak module resolution failed lookup watching (#53591) 2023-04-13 14:50:50 -07:00
Donald33 Wang
adcc39d2c7 Allow custom switch-case indentation in formatting (#53733) 2023-04-13 08:35:05 -07:00
Isabel Duan
d4c48e1495 Adds linked editing for JSX tags (#53284) 2023-04-07 13:39:10 -07:00
Kat Marchán
d23b7e7c52 export TypingsInstaller from tsserverlibrary (#53394) 2023-04-07 11:32:24 -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
Jake Bailey
913f65c28d Remove most "import * as ts" imports, except for const enum reverse mapping and plugins (#53329) 2023-03-20 10:50:40 -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
Sheetal Nandi
9c5b09cd21 Updates to type reference directive resolution and module resolution when failed (#51715) 2023-03-01 10:57:47 -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
2a8436c529 Use eslint-plugin-simple-import-sort (#52090) 2023-02-02 14:36:21 -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
a097d55f81 Remove long deprecated typingOptions and enableAutoDiscovery (#52339) 2023-01-20 15:39:57 -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
ebbc56d0b3 Derive allCommandNames from CommandTypes enum (#52319) 2023-01-19 16:51:41 -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
Ron Buckton
20182cf848 Organize imports collation (#52115) 2023-01-19 17:53:51 -05:00
Jake Bailey
18794c7945 Enable noImplicitOverride (#52290) 2023-01-18 12:00:10 -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
Andrew Branch
4076ff8fd6 Add option for organize imports case sensitivity (#51733)
* Add ignore case option to organizeImports

* Adopt in auto-imports, use same case-insensitive comparison as eslint

* Fix build/lint

* Mark functions internal

* Update affected auto import test

* Update API baseline

* Update protocol

* Update API baseline

* Short-circuit comparisons that have already failed
2022-12-13 14:37:29 -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
Daniel Rosenwasser
3c99d50da5 Replace a few type assertions with annotations and satisfies. (#51685) 2022-12-06 11:52:17 -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
Sheetal Nandi
2f2a17ad0b Removing some unnecessary methods from host and function parameters (#51499) 2022-11-15 17:34:58 -08:00
Sheetal Nandi
c5aea89230 Add alias ResolutionMode for ModuleKind.ESNext | ModuleKind.CommonJs | undefined (#51482)
* Add alias ResolutionMode for ModuleKind.ESNext | ModuleKind.CommonJs | undefined

* ResolutionMode | undefined = ResolutionMode

* More
2022-11-10 16:47:46 -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
d798493647 Remove no-unnecessary-qualifier from eslintrc (#51456) 2022-11-09 15:02:29 -08:00
Jake Bailey
0993c017ba Fix JSDoc eslint rule for properties and methods (#51462) 2022-11-08 16:35:10 -08:00
Sheetal Nandi
48aebcdcdb TypeReference directive reuse (#49750) 2022-11-07 15:15:11 -08:00
Jake Bailey
c5a9573787 Ensure ts object passed to plugins contains deprecatedCompat declarations
We pass the entire "ts" object into plugins. However, we need to make
sure that that object contains the debug compat helpers.

In the old codebase, the deprecated compat code would tack things onto
the actual ts object, after the server code was executed, and later that
same object would be given to plugins.

But in modules, each TS project only sees the view of the "ts" namespace
that their references implied, not the ts object as some sort of
singleton. To ensure that plugins get the debug compat code, we have to
bring that into each project's view of the ts namespace, and not add it
on later in the executable projects.
2022-11-07 13:36:08 -08:00
Jake Bailey
c65142244c Add dts bundling
This adds a "small" d.ts bundler script. This script is very basic,
using Node printing to produce its output. Generally speaking, this is
inadvisable as it completely disregards name shadowing, globals, etc.
However, in our case, we don't care about the globals, and we can opt to
restructure our codebase in order to avoid conflict, which we largely
had to do anyway when we were namespaces and everything was in scope.
2022-11-07 13:35:48 -08:00
Jake Bailey
4139807e75 Add build via esbuild
This configures the existing build tasks to use esbuild by default. If
using the plain files is desired, passing `--bundle=false` will build
using plain files and still produce a runnable system.

This is only a basic build; a more efficient build is provided later
when gulp is replaced by hereby.
2022-11-07 13:34:44 -08:00
Jake Bailey
36e29448e9 Get codebase building pre bundling
This isn't totally complete, but enough to get everything building and
tests running manually. The next commit will make the build work fully.
2022-11-07 13:34:44 -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
Sheetal Nandi
7b0df1ff99 Pass in information for the module name resolution when resolutions from file are partially used (#49738)
* Test showing wrong resolution is returned because of incorrect mode calculation
Test for #48229

* Pass in information for the module name resolution when resolutions from file are partially used
Fixes #48229

* Make the resolution info complete
2022-11-07 11:51:04 -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
Sheetal Nandi
5f3e6cc498 Plugin probe location is higher priority than peer node_modules (#51079)
Fixes #34616
2022-10-06 13:45:22 -07:00