Commit Graph

2512 Commits

Author SHA1 Message Date
Andy ed941c27b8 Don't check modifier legality, highlight anyway (#21335) 2018-02-07 13:51:08 -08:00
Sheetal Nandi 01d160e3b6 Merge pull request #21740 from Microsoft/gotoDefinition
Fix assert when goToDefinition, from location that is new expression target but not a class symbol
2018-02-07 13:50:02 -08:00
Sheetal Nandi dab0dbe6f0 Avoid the class declaration not found assert when the new expression doesnt contain construct signature 2018-02-07 13:30:58 -08:00
Sheetal Nandi 1472b654db Add test case when new expression target is not Class declaration 2018-02-07 13:25:36 -08:00
Andy 786bacfa3b Fix bug: support non-Identifier previousToken in importFixes (#21650)
* Fix bug: support non-Identifier previousToken in importFixes

* Remove intersection type
2018-02-07 12:33:16 -08:00
Priyantha Lankapura 4cfb7a5105 Fix space issue in mapped type formatting (#21712)
* Add the test for mapped type formatting issue

* Fix inconsistent number of spaces within braces when formatting mapped types
2018-02-07 09:23:31 -08:00
Andy c1b4c5b827 Fix bug in normalizeAndPreserveTrailingSlash: For "./", return "", not "/" (#21704) 2018-02-07 09:07:05 -08:00
Andy a1ffa9478c Fix ScriptElementKind for path mapping completions (#21695) 2018-02-06 13:42:32 -08:00
Andy c4c9a00a9f Support incomplete identifier in JSX initializer completions (#21681) 2018-02-06 11:40:39 -08:00
Andy cd22ea73d3 Remove leading directory separator from path mapping completion (#21688) 2018-02-06 11:39:09 -08:00
Andy cde1cd0075 Add top-level completion for path mapping (#21686) 2018-02-06 11:17:06 -08:00
Andy 57a50f4b9d fixInvalidImportSyntax: Preserve comment (#21684) 2018-02-06 10:19:14 -08:00
Andy 044fb53476 Escape quotes in bracketed completions (#21676) 2018-02-06 09:28:03 -08:00
Andy d6f52c3477 importFixes: Bundle module specifiers with import kinds, and replace ImportCodeActionMap with existing functionality (#20700) 2018-02-06 08:57:32 -08:00
Andy 48c0af5d43 Support testing document highlights with "filesToSearch" (#21640)
* Support testing document highlights with "filesToSearch"

* Fix lint
2018-02-05 14:02:50 -08:00
Andy d584f4d97b Fix assertion: class reference location may be 'default' keyword instead of class name (#21630)
* Fix assertion: class reference location may be 'default' keyword instead of class name

* Update API baselines
2018-02-05 13:24:08 -08:00
Andy 120af861f7 Fix bug: replacmentSpan for completion shouldn't include property name that doesn't start with completion name (#21587) 2018-02-05 11:20:22 -08:00
Andy 1784e51929 Fix harness getDirectores implementation to not include directory as prefix (#21633) 2018-02-05 11:11:00 -08:00
Andy 14bd0a2d56 Detect and prevent creation of bad Identifier (#21581) 2018-02-05 09:13:38 -08:00
Anders Hejlsberg 7034d671db Merge branch 'conditionalTypes' into inferTypes 2018-02-03 08:41:54 -08:00
Wesley Wigham 058b2f7f11 Allow boolean literals to be generated from contextual types again (#21503)
* Allow boolean literals to be generated from contextual types again

* Update fourslash test
2018-02-01 12:34:16 -08:00
Andrew Casey 02972899d7 Merge pull request #21379 from amcasey/HighlightingAssert
Check syntax kind in isDeclarationNameOrImportPropertyName
2018-02-01 10:11:10 -08:00
Andy df15d5b977 Don't treat class name contextToken as a completion list blocker if it is not the previousToken (#21534) 2018-02-01 09:24:57 -08:00
Andrew Casey cd0000110d Add FAR test 2018-01-31 11:12:09 -08:00
Anders Hejlsberg 7c241ba2f7 Merge branch 'conditionalTypes' into inferTypes
# Conflicts:
#	src/compiler/checker.ts
#	tests/cases/fourslash/completionInJSDocFunctionNew.ts
#	tests/cases/fourslash/completionInJSDocFunctionThis.ts
2018-01-30 13:40:16 -08:00
Andrew Casey 3020f3d2e6 Handle trivia in code fix forgotten-this
Fixes #21433
2018-01-30 13:25:39 -08:00
Matt McCutchen f0ba16c9a5 Unused type parameters should be checked by --noUnusedParameters, not (#21167)
--noUnusedLocals.

Fixes #20568.
2018-01-25 16:18:35 -08:00
Andy 7c4e755eff When applying // @ts-ignore fix as a group, apply to a line only once. (#21413)
* When applying `// @ts-ignore` fix as a group, apply to a line only once.

* Rename line to lineNumber
2018-01-25 13:53:08 -08:00
Anders Hejlsberg 490d6568f9 Remove pointless fourslash tests 2018-01-25 12:25:56 -08:00
Andy dcd3b5e1f7 At <div x=/**/, completion insertText should be wrapped in braces (#21372) 2018-01-25 09:02:20 -08:00
Andy 0b7f6d5911 Fix bug: Support this. completions even when isGlobalCompletion is false (#21330) 2018-01-25 07:42:01 -08:00
Andy d333d889c1 Test for (and fix) order of import fixes (#21398) 2018-01-24 15:06:52 -08:00
Andrew Casey 6c9b2d9de9 Check syntax kind in isDeclarationNameOrImportPropertyName
Otherwise, keywords are accepted. Assert was

```
fail (e:\ts_gh\src\compiler\core.ts:2867)
assert (e:\ts_gh\src\compiler\core.ts:2837)
isExportSpecifierAlias (e:\ts_gh\src\services\findAllReferences.ts:931)
getLocalSymbolForExportSpecifier
(e:\ts_gh\src\services\findAllReferences.ts:926)
skipPastExportOrImportSpecifierOrUnion
(e:\ts_gh\src\services\findAllReferences.ts:411)
getReferencedSymbolsForSymbol
(e:\ts_gh\src\services\findAllReferences.ts:359)
getReferencedSymbolsForNode
(e:\ts_gh\src\services\findAllReferences.ts:271)
getReferenceEntriesForNode
(e:\ts_gh\src\services\findAllReferences.ts:91)
getSemanticDocumentHighlights
(e:\ts_gh\src\services\documentHighlights.ts:25)
getDocumentHighlights (e:\ts_gh\src\services\documentHighlights.ts:13)
getDocumentHighlights (e:\ts_gh\src\services\services.ts:1584)
getOccurrencesAtPositionCore (e:\ts_gh\src\services\services.ts:1588)
getOccurrencesAtPosition (e:\ts_gh\src\services\services.ts:1567)
Session.getOccurrences (e:\ts_gh\src\server\session.ts:718)
Session.handlers.ts.createMapFromTemplate._a.(anonymous function)
(e:\ts_gh\src\server\session.ts:1999)
(anonymous function) (e:\ts_gh\src\server\session.ts:2079)
Session.executeWithRequestId (e:\ts_gh\src\server\session.ts:2069)
Session.executeCommand (e:\ts_gh\src\server\session.ts:2079)
Session.onMessage (e:\ts_gh\src\server\session.ts:2101)
(anonymous function) (e:\ts_gh\src\server\server.ts:593)
```
2018-01-23 15:51:23 -08:00
Andy d4b3bd16c4 Add KeywordCompletionFilters.TypeKeywords (#21364) 2018-01-23 10:57:35 -08:00
Andy 588716926d Fix bug: result of createUnionOrIntersectionProperty may be undefined (#21332) 2018-01-22 10:15:57 -08:00
Esakki Raj 92bde084c1 Fix formatting between for and await (#21254)
* Fix issue 21084

* Removed unwanted rules.
2018-01-21 09:45:58 -08:00
Wenlu Wang d1ff12e0a6 add completion filter for function like body (#21257) 2018-01-19 17:26:58 -08:00
Andy 6224d51f84 For { type: "a" } | { type: "b" }, find references for the union property (#21298) 2018-01-19 16:04:30 -08:00
Andy 0a90c67c07 Support testing definition range of a reference gruop (#21302) 2018-01-19 12:15:41 -08:00
Andrew Casey ebbb3a4dc4 Merge pull request #21158 from amcasey/NewlineConsistency
Handle linebreaks consistently in code fixes and refactorings
2018-01-18 16:02:27 -08:00
Andy 9436b1cc0b Fix formatter crash for const { ...a: b } = {};: forEachChild and emitBindingElement should handle ... before the propertyName (#21268) 2018-01-18 10:36:41 -08:00
Andy 73922301bc In formatter, get lineAction directly from applyRuleEdits (#21245) 2018-01-17 16:02:42 -08:00
Andrew Casey 3ca1cc406a Clean up TODOs for #18445 2018-01-17 15:29:41 -08:00
Andrew Casey db3f7c538e Update test baselines 2018-01-17 15:18:54 -08:00
Andrew Casey 5de6ac1a2f Simplify test cases 2018-01-17 15:06:54 -08:00
Andrew Casey 3b5689fa1f Add more test coverage for unusedParameterInLambda 2018-01-17 15:06:54 -08:00
Andy 8ed885db3e Add completions from the 'this' type (#21231)
* Add completions from the 'this' type

* Code review
2018-01-17 12:05:31 -08:00
Andy c549bb5737 Fix bug: getNonNullableType before getting signatures of method (#21212) 2018-01-17 11:27:21 -08:00
Wesley Wigham 76d9524866 Fully deprecate the symbol display builder, reimplement in terms of node builder (#18860)
* Remove SymbolWriter, give methods to EmitTextWriter

* Unification of writers is done-ish

* Make node builder support more flags

* Write out mixins like we used to

* Accept prototype-free baselines

* Use instantiated constraint when building mapped type nodes

* Accept better mapped type baselines

* Report inaccessible this in node builder

* Turns out there was a bug in our codefix, too

* Symbol display builder usage falling

* Replace signatureToString with a nodeBuilder solution

* Replace the last internal usages of the symbol writer

* Accept semicolon additions

* Accept updated symbol baseline output

* Start using node builder for some LS operations

* Remove those pesky trailing semicolons on signatures

* Get signature printing much closer to old output

* Parameter lists should not be indented by default, especially when single-line

* Signatures up to snuff

* Type quickinfo emit is up to snuff

* Start of symbol writer replacement, needs a bit more for full compat

* Slightly mor accurate to old behavior

* Replicate qualified name type argument output correctly

* Bring back the old symbol baselines

* Mostly identical to old symbol emit now

* Perfectly matches old behavior thus far

* Replace another usage of the symbol builder

* Another usage removed

* Another usage removed

* Remove final uses of symbol display builder

* Remove implementation and types for unused symbol display builder

* Cleanup in the checker

* monomorphize new emitter code

* Replace emitWithSuffix

* Push space character to interface with writer

* List emit

* Fix lack of usage of emitExpression

* writeList, not printList

* Remove listy writes and replace with new printer calls

* Move ListFormat into types.ts

* Remove most new XToString functions in favor of node builder functions

* Accept API breaks

* Add getSymbolDisplayBuilder polyfill

* Accept updated API baseline

* Move definition to make diff easier to read

* Reinternalize some things

* Remove trailign whitespace

* Reorder for zero diff

* Remove newline

* Make shim mor eperfectly imitate old behavior

* Style feedback

* Rename reset to clear to maintain backcompat with SymbolWriter

* Fix quickfix

* Keep EmitTextWriter internal

* Remove EmitTextWriter from public API

* Mimic default name declaration emit fix

* Fix tests broken by merge

* use isFunctionLike

* Cleanup, sync TypeFormat and NodeBuilder flags

* Reorder Node initialization so pos and end are first, so a TextRange hidden class is made first to reduce future polymorphism

* Use variable instead of ternary

* Write helper for emitNodeWithWriter

* Emitter cleanup

* Cleanup whitespace, comment

* Reuse printer

* Raise error if display parts writer uses rawWrite

* Hide writer parameter through different function instead of overload, rename function in emitter

* Make less printer

* fix lint
2018-01-16 09:53:42 -08:00
Alan Agius bcb9fd7825 fix: formatting for chaining methods (#21027)
Closes: #20996
2018-01-16 08:53:43 -08:00