120 Commits

Author SHA1 Message Date
Andy
7e515af240
Copy allowTextChangesInNewFiles property to protocol.ts (#24127) 2018-05-15 12:35:08 -07:00
Andy
ddf20ecd6d
Support '.' as a trigger character (#23890)
* Support '.' as a trigger character

* Add a CompletionsTriggerCharacter type

* Add more trigger characters

* Add another type CompletionsTriggerCharacter

* Update API baselines
2018-05-08 09:52:46 -07:00
Ryan Cavanaugh
ffa0ccba2a Project References Core support 2018-05-07 15:12:50 -07:00
Sheetal Nandi
5133c70e7e
Merge pull request #22167 from Microsoft/requireJson
Resolve the modue names with "modulename.json" to json files when doing node module resolution
2018-05-04 12:42:10 -07:00
Mohamed Hegazy
e52efb04f3 Fix #22419: Add kind field to OutliningSpan 2018-05-03 16:28:55 -07:00
Sheetal Nandi
15f9ea3d14 Merge branch 'master' into requireJson 2018-05-03 15:35:54 -07:00
Armando Aguirre
1d593fd81e
Merge pull request #23191 from armanio123/AddVueSupport
Added deferred ScriptKind and renamed JsFileExtensionInfo to FileExte…
2018-05-02 18:13:34 -07:00
Sheetal Nandi
579748bc2b Merge branch 'master' into requireJson 2018-04-30 11:44:09 -07:00
Andy
5c94bef0e1
Add 'renameFile' command to services (#23573)
* Add 'renameFile' command to services

* renameFile -> getEditsForFileRename

* Support `<reference path>` directives
2018-04-20 13:43:09 -07:00
Andy
22f2b118b7
Add 'triggerCharacter' option for completions requests (#23491)
* Add 'triggerCharacter' option for completions requests

* mhegazy code review

* More code review

* Handle '<' in comment
2018-04-20 10:25:58 -07:00
Armando Aguirre
9923003ee6 Merge branch 'master' into AddVueSupport 2018-04-16 13:45:34 -07:00
Sheetal Nandi
ce08af4dfe Merge branch 'master' into requireJson 2018-04-13 15:26:16 -07:00
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
Armando Aguirre
50eb512566 Added deferred ScriptKind and renamed JsFileExtensionInfo to FileExtensionInfo 2018-04-05 17:30:04 -07:00
Sheetal Nandi
a14396320b Resolve json modules only when --resolveJsonModule is specified 2018-04-05 15:37:13 -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