106 Commits

Author SHA1 Message Date
Andy
ff7ef4a25a
Add fixName property to CodeFixAction (#23350) 2018-04-12 09:05:30 -07:00
Andy
4b706fc479
Add 'disableSuggestions' to UserPreferences (#23283)
* Add 'disableSuggestions' to UserPreferences

* Make mergeMapLikes return a new object

* Avoid additional clone

* mergeMapLikes -> object spread
2018-04-10 11:53:24 -07:00
Andy
556a8010b9
Fix bug: ensure 'reportsUnnecessary' is actually sent by tsserver (#23293) 2018-04-10 10:15:15 -07:00
Andy
24842b4002
When --noUnusedLocals/--noUnusedParameters is disabled, add suggestions instead of errors (#22361)
* When --noUnusedLocals/--noUnusedParameters is disabled, add suggestions instead of errors

* Improve performance: do not add unused suggestion diagnostics unless asking for a suggestion

* Add "unused" flag to diagnostics

* Code review

* reportsUnused -> reportsUnnecessary

* Fix test
2018-04-05 12:33:00 -07:00
Andy
3e32e15895
Add 'fixAllDescription' property to CodeFixAction (#22616)
* Add 'fixAllDescription' property to CodeFixAction

* Code review

* Add to protocol

* Make fixAllDescription be just a string
2018-03-27 18:21:21 -07:00
Andy
cc3921323c
Support services settings (#22236)
* Support services settings

* Code review

* More review

* Use different names for Options and GetCompletionsAtPositionOptions (todo: come up with better names)

* More renames

* More renaming

* Support quote style in importFixes

* Add `importModuleSpecifierPreference` option

* Support quote style for `throw new Error('Method not implemented.')` (#18169)

* options -> preferences
2018-03-20 13:07:59 -07:00
Mohamed Hegazy
c335c3803c
Fix #22133: Expose getOutliningSpans on the server protocol (#22400)
* Fix #22133: Expose getOutliningSpans on the server protocol

* Remove debugger statement from test
2018-03-09 08:50:47 -08:00
Andy
a564912d9a
Apply 'no-unnecessary-qualifier' lint rule (#22009) 2018-03-01 14:20:18 -08:00
Andy
fa4619c5c1
Add 'info' diagnostics (#22204)
* Add 'info' diagnostics

* Code review
2018-02-28 11:16:32 -08:00
Andy
b90a56dc7a
Mark getOccurrences as deprecated in protocol.ts like it is in services/types.ts (#22067) 2018-02-22 13:21:40 -08:00
Andrew Casey
5656f35b6a Introduce an organizeImports command
In phase 1, it coalesces imports from the same module and sorts the
results, but does not remove unused imports.

Some trivia is lost during coalescing, but none should be duplicated.
2018-02-16 10:51:38 -08:00
Armando Aguirre
0aa72a7822 Added backward compatibility and PR comments 2018-02-06 17:11:59 -08:00
Armando Aguirre
cdff95f914 Refactored exceededTotalSizeLimitForNonTsFiles to return the last filename analyzed if the service language is going to be disabled 2018-02-05 19:25:07 -08:00
Andy
f96dc84a70
Make getCombinedCodeFix API public (#21234) 2018-01-17 12:42:31 -08:00
Andy
89ceb4b9b5
Support completions that require changing from dot to bracket access (#20547)
* Support completions that require changing from dot to bracket access

* Use insertText and replacementSpan

* Rename includeBracketCompletions to includeInsertTextCompletions

* Don't add completions that start with space
2018-01-08 18:57:46 -08:00
Wenlu Wang
7154df10df add support for insertSpaceBeforeTypeAnnotation (#20466) 2018-01-08 13:25:02 -08:00
Andy
6f2ba15446
Start linting for double spaces (#20820)
* Start linting for double spaces

* Code review

* Fix cases that were excluded by countDoubleSpaces

* Remove extraneous closing parenthesis
2018-01-08 08:52:13 -08:00
Andy
19ea189b42
Support a "getCombinedCodeFix" service (#20338)
* Support a "getCombinedCodeFix" service

* Rename things

* Code review

* Rename things

* Update API baselines

* CodeActionAll -> CombinedCodeActions

* Take a `scope` parameter instead of `fileName` for flexibility

* Renames and bugfixes

* Make API changes internal

* Code review

* Update comment
2017-12-07 12:14:18 -08:00
Arthur Ozga
0e75c5cc2f update descriptions 2017-12-06 14:02:04 -08:00
Arthur Ozga
a714ece3da add status request 2017-12-04 18:11:23 -08:00
Andy
fd4d8ab96e
Support a 'recommended' completion entry (#20020)
* Support a 'recommended' completion entry

* Code review

* Restore duplicate comments
2017-12-01 13:00:01 -08:00
Andy
e7adb1ce79
Bundle fileName with CodeActionCommand (#19881)
* Bundle fileName with CodeActionCommand

* Update test

* Fix API tests

* Add new overloads in services

* Fix overload

* Update API baselines
2017-11-17 14:16:38 -08:00
Andy
b94940525b
Allow applyCodeActionCommand to take an array (#19870)
* Allow applyCodeActionCommand to take an array

* Use this.host.newLine
2017-11-09 13:17:47 -08:00
Andy
57f247eff4
Add hyphen in completionEntryDetails-full (#19808) 2017-11-07 09:46:40 -08:00
Andy
bb7fb7dda9
For getCompletionsAtPosition, require a flag to provide completions with code actions (#19687)
* For getCompletionsAtPosition, require a flag to provide completions with code actions

* Change name

* Increase API version

* Update API baselines

* Add comment

* Update API baseline
2017-11-03 15:55:31 -07:00
Andy
8b5d8565cf
Add CompletionDetailsFull request (#19689)
* Add CompletionDetailsFull request

* Update API baselines

* Make internal
2017-11-03 15:11:36 -07:00
Armando Aguirre
d5c18a6fb7
Merge branch 'master' into AddDefinitionAndBoundSpan 2017-10-30 17:02:23 -07:00
Andy
9615e54e13 Support multiple completions with the same name but different source module (#19455)
* Support multiple completions with the same name but different source module

* Use optional parameters for source

* Simplify use of `uniques`

* Update test

* Fix `undefined` error
2017-10-26 08:22:17 -07:00
Armando Aguirre
ae266f6aa1 Merge branch 'master' into AddDefinitionAndBoundSpan 2017-10-24 11:18:07 -07:00
Armando Aguirre
8004fec2ce Addressed PR comments: added simplified/full version, changed design 2017-10-18 14:48:06 -07: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
2b566b9a53 Add exported members of all project files in the global completion list (#19069)
* checker.ts: Remove null check on symbols

* tsserverProjectSystem.ts: add two tests

* client.ts, completions.ts, types.ts: Add codeActions member to CompletionEntryDetails

* protocol.ts, session.ts: Add codeActions member to CompletionEntryDetails protocol

* protocol.ts, session.ts, types.ts: add hasAction to CompletionEntry

* session.ts, services.ts, types.ts: Add formattingOptions parameter to getCompletionEntryDetails

* completions.ts: define SymbolOriginInfo type

* completions.ts, services.ts: Add allSourceFiles parameter to getCompletionsAtPosition

* completions.ts, services.ts: Plumb allSourceFiles into new function getSymbolsFromOtherSourceFileExports inside getCompletionData

* completions.ts: add symbolToOriginInfoMap parameter to getCompletionEntriesFromSymbols and to return value of getCompletionData

* utilities.ts: Add getOtherModuleSymbols, getUniqueSymbolIdAsString, getUniqueSymbolId

* completions.ts: Set CompletionEntry.hasAction when symbol is found in symbolToOriginInfoMap (meaning there's an import action)

* completions.ts: Populate list with possible exports (implement getSymbolsFromOtherSourceFileExports)

* completions.ts, services.ts: Plumb host and rulesProvider into getCompletionEntryDetails

* completions.ts: Add TODO comment

* importFixes.ts: Add types ImportDeclarationMap and ImportCodeFixContext

* Move getImportDeclarations into getCodeActionForImport, immediately after the implementation

* importFixes.ts: Move createChangeTracker into getCodeActionForImport, immediately after getImportDeclarations

* importFixes.ts: Add convertToImportCodeFixContext function and reference it from the getCodeActions lambda

* importFixes.ts: Add context: ImportCodeFixContext parameter to getCodeActionForImport, update call sites, destructure it, use compilerOptions in getModuleSpecifierForNewImport

* importFixes.ts: Remove moduleSymbol parameter from getImportDeclarations and use the ambient one

* importFixes.ts: Use cachedImportDeclarations from context in getCodeActionForImport

* importFixes.ts: Move createCodeAction out, immediately above convertToImportCodeFixContext

* Move the declaration for lastImportDeclaration out of the getCodeActions lambda into getCodeActionForImport

* importFixes.ts: Use symbolToken in getCodeActionForImport

* importFixes.ts: Remove useCaseSensitiveFileNames altogether from getCodeActions lambda

* importFixes.ts: Remove local getUniqueSymbolId function and add checker parameter to calls to it

* importFixes.ts: Move getCodeActionForImport out into an export, immediately below convertToImportCodeFixContext

* completions.ts: In getCompletionEntryDetails, if there's symbolOriginInfo, call getCodeActionForImport

* importFixes.ts: Create and use importFixContext within getCodeActions lambda

* importFixes.ts: Use local newLineCharacter instead of context.newLineCharacter in getCodeActionForImport

* importFixes.ts: Use local host instead of context.host in getCodeActionForImport

* importFixes.ts: Remove dummy getCanonicalFileName line

* Filter symbols after gathering exports instead of before

* Lint

* Test, fix bugs, refactor

* Suggestions from code review

* Update api baseline

* Fix bug if previousToken is not an Identifier

* Replace `startsWith` with `stringContainsCharactersInOrder`
2017-10-17 10:20:11 -07:00
Armando Aguirre
b86153da88 Changed command designed based on review input 2017-10-16 17:50:35 -07:00
Armando Aguirre
1cb2d24c5d Added DefinitionAndBoundSpan command 2017-10-12 17:18:38 -07:00
Sheetal Nandi
4bb4711eff Merge branch 'master' into watchImprovements 2017-10-02 16:34:43 -07:00
Andy
eefe5c9706 Fix acquiring format options for getEditsForRefactor (#18848)
* Fix acquiring format options for getEditsForRefactor

* Add test

* Fix test description

* Use `executeCommandSeq`
2017-10-02 13:26:35 -07:00
Sheetal Nandi
23acff5bc8 Merge branch 'master' into watchImprovements 2017-09-25 16:18:26 -07:00
Andy Hanson
0b76e43977 Make formatOptions optional in GetEditsForRefactorRequestArgs 2017-09-15 07:21:38 -07:00
Andy
d96dfeb708 Don't normalize whitespace in fourslash tests (#18447)
* Don't normalize whitespace in fourslash tests

* Only render whitespace when the diff is text-only
2017-09-14 08:23:50 -07:00
Sheetal Nandi
4f7c0e5e1c Simplify event sent on background project update since its anyways just to update the error list 2017-09-12 18:16:31 -07:00
Sheetal Nandi
fdb104b242 Merge branch 'master' into watchImprovements 2017-09-11 13:49:36 -07:00
Andy
193f4be355 Enable interface-over-type-literal lint rule (#17733) 2017-09-07 09:14:59 -07:00
Sheetal Nandi
e71123857c Add api in builder to get changed files and use it to send project changed event 2017-08-22 11:28:10 -07:00
Mohamed Hegazy
07e1d3b13d Ensure string enums are generated in protocol.d.ts (#17914) 2017-08-21 09:44:03 -07:00
Arthur Ozga
19e2fa6fc5 Merge branch 'master' into isInMultiLineComment 2017-08-16 17:57:04 -07:00
Ron Buckton
360dc914c3 Merge pull request #17602 from Microsoft/multiInferredProjects
Adds support for inferred project isolation by projectRootPath
2017-08-11 16:06:49 -07:00
Ron Buckton
c272c3c5cd Comment update 2017-08-11 16:06:24 -07:00
Andy
f64b8ad902 Add "preserveSymlinks" option (#16661)
* Add "preserveSymlinks" option

* Respond to PR comments
2017-08-11 10:03:21 -07:00
Andy
f124e19971 Session: don't return undefined if a response is required (#17165)
* Session: don't return undefined if a response is required

* Use ReadonlyArray and emptyArray

* Remove inferred return type
2017-08-09 13:46:47 -07:00
Arthur Ozga
efdbebaebb Merge branch 'master' into isInMultiLineComment 2017-08-04 14:26:24 -07:00