Commit Graph

4388 Commits

Author SHA1 Message Date
Oleksandr T 1f32fef5a2 fix(51077): skip insertText for jsx attribute with existing initializer (#51093) 2022-12-09 08:38:08 -08:00
George Manning 65bf850a20 Fix #51437 Duplicate "Duplicate identifier" errors (#51594)
* retroactive approach to remove duplicate diagnostics

* use code instead of messageText, update test

* use existing de-dupe function

* rename test and baselines

* add fourslash test for better assertion of fix

* review feedback: move deduplicate to getDiagnosticsHelper

* accept baseline with sorted diagnostics

* remove newline
2022-12-08 19:21:41 -08:00
Oleksandr T e087992134 feat(47977): show completion in jsdoc extends/implements tags (#51028) 2022-12-08 17:10:00 -08:00
Oleksandr T 8f2ee38b52 fix(50888): Organize Imports may delete preceding comments when all members of all import statements are unused (#50983)
* fix(50888): preserve preceding comments of the deleted import

* update tests
2022-12-08 17:05:12 -08:00
Ryan Cavanaugh a3dbe7dc70 Update default target from ES3 to ES5 (#51731)
* Change the default emit target to ES5

* Add baseline update

* Remove tests with a hardcoded sourcemap in it

* Update hardcoded tests

* Merge with main

* Restore tests
2022-12-08 16:43:47 -08:00
Andrew Branch dc3daa6644 Fix namespace import update bug, simplify, comment, and rename (#51797) 2022-12-06 16:38:33 -08:00
Gabriela Araujo Britto a1536358f7 fix & test (#51792) 2022-12-06 16:18:01 -08:00
Isabel Duan ae9c671d59 (fix #50725, #50710) add file extensions in import statements (#51702)
* fixes #50725

* fixed 50710

* fixed broken test

* clean up

* variable rename

* rename variable to newFileBaseName
2022-12-06 09:28:10 -08:00
Oleksandr T 0eca6b0edc fix(40365): handle deprecated properties of merged interfaces (#51640) 2022-12-05 15:06:18 -08:00
Lyu, Wei-Da 0c09d2f172 quick fix for a nullable missing callback function (#51743) 2022-12-05 12:23:59 -08:00
Gabriela Araujo Britto 6a3c9ea125 Exhaustive case completion for switch statements (#50996)
* fix services' type's isLiteral

* update literal completions tests

* initial prototype

* use symbol to expression. TODO: filter existing, replace import nodes

* WIP

* WIP

* remove booleans from literals

* trigger at case keyword positions

* clean up tests

* fix element access expression case

* refactor dealing with existing values into a tracker

* fix merge errors

* cleanup and more tests

* fix lint errors

* more merge conflict fixes and cleanup

* use appropriate quotes

* small indentation fix

* refactor case clause tracker

* experiment: support tabstops after each case clause

* address small CR comments

* fix completion entry details; add test case

* fix lint errors

* remove space before tab stops; refactor
2022-12-01 16:48:32 -08:00
Oleksandr T 1b75edcec6 fix(51053): Extract type on JSDoc causes an assertion failure (#51056)
* fix(51053): allow extract type from the jsdoc without a host

* change diagnostic message
2022-12-01 16:09:31 -08:00
Andrew Branch e6d7b526c8 Fix multiline import specifier sorting (#51634)
* Fix multiline import specifier sorting

* Update baselines

* Switch to EmitFlag, set hasTrailingComma on original node array

* Update API baseline

* Update baselines
2022-11-28 15:35:32 -08:00
Andrew Branch 89ce16ccfd Fix auto-import when paths points to project reference redirect (#51492)
* Fix auto-import when `paths` points to project reference redirect

* Put paths specifiers to redirects in lower priority bucket
2022-11-15 14:19:15 -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
Oleksandr T fa4b49d541 fix(51374): ts(80004): Quick fix... > Annotate with type from JSDoc :: object types (#51378)
* fix(51374): transform JSDocTypeLiteral

* add additional tests

* add additional tests
2022-11-07 11:35:08 -08:00
Anders Hejlsberg 7cf842b42b Enum unification and improvements (#50528)
* Fix enum classification and evaluation

* References in literal enums must be to other enum members

* Accept new baselines

* Unify enum types + template literal constant expressions

* Accept new baselines

* Fix fourslash tests

* Fix new compiler errors

* Fix lint error

* Accept new API baselines

* Fix test

* Better error message + consistently check enum initializers

* Accept new baselines
2022-11-03 11:05:42 -07:00
Gabriela Araujo Britto fdcb2ffd1b Fix services' type's isLiteral implementation (#50929)
* fix services' type's isLiteral

* update literal completions tests

* remove booleans from literals
2022-11-02 11:28:10 -07:00
Wesley Wigham 4d15bb16e1 Fix #50869, only cache calculated type for non-context sensitive parameters (#50976)
* Fix #50869, only cache calculated type for non-context sensitive parameters

* Simplify check, update comment
2022-10-31 17:24:51 -07:00
Oleksandr T 64d0d5ae14 fix(51301): Fixing an unused import at the end of a line removes the newline (#51320)
* fix(51301): keep the line break after removing the unused identifier

* preserve line breaks in import specifiers

* preserve line breaks in parameters and destructuring elements

* remove preserveLineBreak option
2022-10-27 17:27:36 -07:00
Oleksandr T d4f26c840b fix(51245): Class with parameter decorator in arrow function causes "convert to default export" refactoring failure (#51256)
* fix(51245): don't rely on parent nodes in formatting rules

* check existing parent node
2022-10-26 16:59:44 -04:00
Oleksandr T 8b1ecdb701 fix(50654): "Move to a new file" breaks the declaration of referenced variable (#50681)
* fix(50654): remove entire import require call instead of the name

* handle require imports in ts files
2022-10-25 17:05:57 -07:00
Oleksandr T 88d25b4f23 fix(50068): Refactors trigger debug failure when JSX text has a ' and a tag on the same line. (#51299)
* fix(50068): rescan JsxText on JsxElement context

* fix lint errors

* add tests
2022-10-25 13:10:31 -07:00
Andrew Branch ef69116c41 Generate shortest rootDirs module specifier instead of first possible (#51244)
* Generate shortest rootDirs module specifier instead of first possible

* Simplify `min`
2022-10-21 16:05:58 -07:00
Oleksandr T 245a02cbed fix(51222): Go-to-definition on return statements should jump to the containing function declaration (#51227)
* fix(51222): add go-to-definition return statement to containing function

* add additional tests
2022-10-19 11:32:39 -07:00
Mateusz Burzyński 85d405a1d7 Fixed a false positive "await has no effect on the type" diagnostic with mixed generic union (#50833) 2022-10-18 14:10:03 -07:00
Oleksandr T f25bcb7c27 fix(49196): add jsdoc snippet for interface member functions (#51135) 2022-10-17 17:35:08 -07:00
Oleksandr T 7406ee9c14 fix(51170): Completing an unimplemented property overwrites rest of line (#51175)
* fix(51170): skip insertText for class members with existing initializer

* skip insertText for class members with existing tokens
2022-10-17 13:14:23 -07:00
Isabel Duan 2cb7e779d7 fix(50416): correctly names disabled export refactors (#50663)
* added test case to try to retrieve duplicate refactor as in #50416. 'verify.refactorAvailable' correctly retrieves nonduplicate refactors...

* optional arguments in refactorAvailable return `true` even if there is no single refactor that satisfies both

* it still passes :C

* Delete fixExtractToInnerFunctionDuplicaton.ts

* deleted extra test code

* fix 'verify.refactorAvailable' so that tests correctly check for multiple arguments

* fixes #50416

* refactor
2022-10-13 16:44:30 -07:00
Oleksandr T 2bcfed01f3 feat(37440): Provide a quick-fix for non-exported types (#51038)
* feat(37440): add QF to handle missing exports

* change diagnostic message

* add type modifier only if isolatedModules is set or if the export declaration already uses type modifiers
2022-10-13 15:43:49 -07:00
Oleksandr T cf1b6b7333 feat(51163): show QF to fill in the missing properties for the mapped type. (#51165) 2022-10-13 11:29:18 -07:00
Valerian Clerc 503604c884 Overloads shouldn't gain @deprecated tags of other overloads in quick info (#50904)
* Add test case to check for the propogation of @deprecation tag to multiple overloads

* Implement filter to only include @deprecated tag in first signature after JSDoc comment
2022-10-11 16:58:03 -07:00
Nathan Shively-Sanders 299745cb21 Fix crash in goto-def on @override (#51016)
* Fix crash in goto-def on `@override`

When the base type is not defined, getDefinitionFromOverriddenMember
will have its type as errorType, which has no symbol. The error handling
previously only handled the case of no baseType at all -- which I'm not
sure ever actually happens.

* Improve checking

1. getTypeAtLocation never returns undefined, only errorType, so check for that.
2. Return directly after missing baseTypeNode instead of continuing to return later.

* Experiment with making goto-def on `override` more consistent

* Unify static/instance node->symbol->type path

* Make getSymbolAtLocation support class expressions

and parenthesized expressions

* Revert "Make getSymbolAtLocation support class expressions"

This reverts commit 4c1b031355.

* fix semicolon lint
2022-10-03 16:07:57 -07:00
Oleksandr T 7dcf11f139 fix(50750): Object type literal with string literal property in contextual typing position causes language service error on all literal type references (#50757)
* fix(50750): skip unbound symbols from JSDoc tags in typescript

* skip contextual type checking in JsDoc for TypeScript files
2022-10-03 15:57:32 -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
Jack Works 42f9143e11 feat: codefix for for await of (#50623) 2022-09-29 16:13:25 -07:00
Jake Bailey 645d1cd7c1 Fix assert in addIndirectUser in FAR (#50905) 2022-09-22 16:47:27 -07:00
Oleksandr T 7a3de819bf fix(49993): skip the quick fix for an expression with an enum type (#50625) 2022-09-21 16:59:17 -07:00
Oleksandr T 4d91204c9d fix(37030): Expand Selection in function and arrow function skips body block (#50711)
* fix(37030): include curly braces from function body in the selection

* add missed sourceFile argument
2022-09-21 10:47:24 -07:00
Oleksandr T 1d9ab83914 fix(50866): emit modifiers from export declarations (#50874) 2022-09-21 09:59:15 -07:00
Andrew Branch 938a69a526 Fix import statement completions followed by interface declaration (#50350)
* Fix import statement completions followed by interface declaration

* Fix stuff

* Linty

* Fix when named imports is missing closing brace
2022-09-20 13:29:06 -07:00
Oleksandr T e002159ad1 feat(49962): Disallow comparison against NaN (#50626)
* feat(49962): disallow comparison against NaN

* change diagnostic message

* use global NaN symbol for NaN equality comparisons
2022-09-20 13:16:44 -07:00
magic-akari 01cae69e34 fix(50796): omit questionToken in object literal method completions (#50802) 2022-09-16 10:06:03 -07:00
Oleksandr T 08b91f6b82 fix(50717): tsc crashes when it sees a JSDoc tag inside an @override annotation (#50724) 2022-09-13 12:51:17 -07:00
Ron Buckton a4cabe725b Support for auto-accessor fields from the Stage 3 Decorators proposal (#49705)
* Support for auto-accessor fields

* Add tests, ensure accessors are initialized in ctor

* classFields cleanup and PR feedback
2022-09-12 15:12:11 -04:00
Jake Bailey eb40134373 Don't leave space for property access on non-integer literals (#50703) 2022-09-09 14:36:39 -07:00
Jake Bailey 1a1c271675 Don't remove space before dot if in property access on numeric literal (#50695)
* Add failing test

* Don't remove space before dot if in property access on numeric literal
2022-09-08 19:08:51 -07:00
Oleksandr T bcf994996e fix(50079): show deprecated on JSX attributes (#50084) 2022-09-01 16:59:29 -07:00
Oleksandr T 4579245f36 fix(50427): allow convert function expressions (#50430) 2022-08-26 15:43:19 -07:00
Oleksandr T bb3a7aec11 fix(50415): Language server debug failure - Did not expect GetAccessor to have an Identifier in its trivia (#50470)
* fix(50415): clone props for get/set accessors

* add additional tests

* create helpers to create name, body, modifiers, typeName

* cleanup
2022-08-26 14:33:23 -07:00