Commit Graph

234 Commits

Author SHA1 Message Date
Matt Bierner
052f6405c7 Enable dot completions in a few more contexts 2017-01-13 15:05:36 -08:00
Benjamin Pasero
a6175d0756 Fix build (#18492) 2017-01-13 07:15:26 +01:00
Matt Bierner
4f4df044b7 Fixes #18487 2017-01-12 19:41:50 -08:00
Matt Bierner
269d1f3aae Fix 17584 (#18477)
* Fixes #17584

* Remove logging statement
2017-01-12 17:55:53 -08:00
Matt Bierner
d9d41f7cd0 Prototype Using Commit Characters for JS and TS Completions (#18380)
* Prototype Using Commit Characters for JS and TS Completions

Part of #7326

Adds a prototype for using specific characters to complete TS/JS completion items automatically.

* Tune path completion items

* Disable dot commit in js files

* Don't complete on / in module names
2017-01-12 15:21:46 -08:00
Matt Bierner
0f2c51fc22 Fixes #18425 2017-01-12 15:13:38 -08:00
Matt Bierner
9d611d4dfd Add Go To Implementation Api (#18346)
* Add Go To Implementation Api

For #10806

Adds a new API for supporting  `go to implementation` command for languages. Implements an example for TS

* Rename

* Cleanup
2017-01-12 12:16:48 -08:00
Matt Bierner
5f1828b731 Fix failure to match some ref count names 2017-01-11 16:57:10 -08:00
Joao Moreno
31997b32c3 Revert "Only apply TS Dot Accept Suggestion if Previous Character is a valid identifier (#18063)"
This reverts commit 41cb5ee5ae.
2017-01-10 10:11:52 +01:00
Matt Bierner
db0d72e663 Fixes #18347 2017-01-09 20:19:13 -08:00
Martin Aeschlimann
d12f865650 [jsx] Automatic HTML indentation and cursor position in JSX. Fixes #18284 2017-01-09 21:47:42 -04:00
Matt Bierner
450778c177 Exclude Definition From TS code lens (#18338)
Fixes #18335

Removes the definition itself from the list of references shown in the TS code lens
2017-01-09 11:37:15 -08:00
Matt Bierner
41cb5ee5ae Only apply TS Dot Accept Suggestion if Previous Character is a valid identifier (#18063)
* Only apply TS Dot Accept Suggestion if previous character is a valid identifier char

Fixes #17825
Fixes #17770
Fixes #17584

**Bug**
When typing two or more `.` in a row, we end up unexpectedly accepting suggestions in TS files. This is caused by the custom keybinding that ts registers for `.`.

**Fix**
Only accept the suggestion on `.` if the previous character is a valid identifier character.

* Move title to nls
2017-01-09 10:43:59 -08:00
Matt Bierner
265803b0c9 Add TypeScript References Code Lens Provider (#18205)
Fixes #18054

Adds an references code lens provide for JS and TS
2017-01-06 15:18:06 -08:00
Matt Bierner
9eb91d2de4 Show Error Message if TypeScript Settings Update Fails (#18130)
Fixes #18127

Show error messages if the workspace or user settings update fails
2017-01-05 12:33:29 -08:00
Matt Bierner
5cf85c73d5 Use Better Range When Formatting TS Quick Fixes (#18135)
**Bug**
TS 2.2 includes a number of new code actions, such as implementing missing interface methods on classes. TS returns these in unedited form, so we have to format the document after applying these fixes. This formatting is not always correct using the current logic.

**Fix**
Try to determine the range to format using the set of text edits that TS returns to us. This is not perfect, but it should better match the actual edit that we make using the quick action
2017-01-05 12:32:53 -08:00
Matt Bierner
97ba3fddce Pick up ts 2.1.4 (#18061) 2017-01-05 12:30:42 -08:00
Matt Bierner
80481edbdf Remove logging statement 2017-01-04 15:43:52 -08:00
Matt Bierner
e753f86984 Use Word Based Completion Range by Default in TS (#17918)
Fixes #17906

**bug**
To support completion items that span multiple words, I added extra logic in 1.9 insiders to use the word prefix to compute the completion range. This introduced a few regressions for completions that do start with the replacement.

**fix**
Use the old, word based range logic by default. Use the prefix completion if it is longer.
2016-12-29 15:26:23 -08:00
Benjamin Pasero
8b82f0de8f fix compile issue 2016-12-21 09:28:14 +01:00
Matt Bierner
1505b3dcbf Monitor Typings Acqusition Events for TS Completion Item Provider (#17098)
Monitors the status of typings acqusition from TS. If we are acquiring typings, in the completion item provider, return an error result that informs the user that the results are incomplete. Typings acqusition is currently capped at 30 seconds per typings install event so that we don't block intellisense forever if something goes wrong
2016-12-20 18:33:30 -08:00
Matt Bierner
04f541160e Map TS completion to Class CompletionItemKind (#17571) 2016-12-19 16:52:54 -08:00
Matt Bierner
9101a4a875 Add TS Code Action Provider (#16299)
* Initial work using ts2.1 and TS Code Actions

* Clean up implementation and fix a few issues

* Gate provider to ts2.1+

* Switch gate to use 2.1.3 instead

* Fix a few null checks

* Format after completion
2016-12-19 16:38:03 -08:00
Matt Bierner
08b89952fb Fix case sensitivy for completionItemProvider 2016-12-19 16:30:26 -08:00
Matt Bierner
ab481aac77 Fix TypeScript Verbose Logging not Printing Out Argument Values (#17559)
Fixes #17488

**Bug**
In the calls to `JSON.stringify`, we are currently passing in `[]` as a whitelist. This results in no argument values being printed.

**Fix**
Pass in null instead so that we print all argument values
2016-12-19 13:36:59 -08:00
Matt Bierner
67d5d26274 Use Module Symbol for Module Name Completions (#17558) 2016-12-19 13:28:18 -08:00
Matt Bierner
5162e3b5b5 Add CompletionItemKind.Folder (#17438)
* Add CompletionItemKind.Folder

Fixes #17435

Adds a new completion item kind for folder/directories. This is useful for path intellisense

For the icons, I copied the icons for folders into the suggestion icon set. Let me know if new ones are needed instead.

* Fix monaco.d.ts
2016-12-19 13:09:54 -08:00
Matt Bierner
70f25d0187 Use File Icon for TS Path Completions (#17434)
Part of #17331

Updates path completions for directories and files to use a file icon instead of the generic icon they currently use.
2016-12-16 15:10:54 -08:00
Matt Bierner
bbe153da22 Fix TS/JS Completion Item Provider for Completions that are not whole words (#16955)
Fixes #16888

**Bug**
The js/ts completion provide can currently only complete whole words (as defined by `TextDocument.getWordRangeAtPosition`). This causes completion of literal string types to fail if they are not a whole word.

**Fix**
Instead of relaying on the default range, compute a range by taking the longest match of the replacement text from the current position.
2016-12-16 12:55:47 -08:00
Matt Bierner
89bdb7c35a Update ts extension to use es6 (#17134) 2016-12-14 11:40:00 -08:00
Johannes Rieken
24d2d5119f storagePath can be undefined, #17089 2016-12-13 10:06:14 +01:00
Matt Bierner
598ece67e4 Workaround for #16909 (#17088)
* Workaround for #16909

Fixes #16909

Worksaround TS2.1+ returning strings in the occurrences response we use for highlighting occurrences in documents

The workaround is to look at the text surrounding the first occurrence to see if it is a string literal.

* Small cleanup

* Add gate for ts 2.1.x

* Added check to make sure we don't compare the same character
2016-12-12 11:08:31 -08:00
Matt Bierner
ac052e01cf Add link to Ts work item 2016-12-12 10:19:52 -08:00
Matt Bierner
6dc2c6049c Blacklist typescript.useCodeSnippetsOnMethodSuggest in certain contexts (#16415)
Issue #2092

**bug**
With typescript.useCodeSnippetsOnMethodSuggest enabled, we will automatically complete function calls inside some contexts where they should not be completed. For example,  destructing assigment.

**fix**
Add a quickinfo check on the position before attempting to insert a function call. Create a blacklist of invalid contexts. Otherwise, assume that we want to complete the function call.
2016-12-12 10:17:22 -08:00
Matt Bierner
cd26980006 Fixes #16984 2016-12-09 11:39:26 -08:00
Matt Bierner
6cb45c55e3 Use No Implicit Any In TS Extension (#16878)
Use noImplicitAny in the TS Extension (the TS team suggests enabling this option for most code).
2016-12-08 17:23:10 -08:00
Matt Bierner
59e53d6070 Remove mocha.d.ts from extension projects that don't need it 2016-12-07 17:06:27 -08:00
Matt Bierner
e592f7cc6d Remove unused functions in is 2016-12-07 17:06:27 -08:00
Matt Bierner
e9b68079a9 Merge branch 'fix-ts-js-symbols-showing-undefined' 2016-12-07 16:53:32 -08:00
Matt Bierner
68725a72c8 Fix undefined showing in TS Symbol List
Fixes #16879
2016-12-07 16:52:26 -08:00
Matt Bierner
9c3084c45c Fix #16846 (#16863) 2016-12-07 15:10:32 -08:00
Benjamin Pasero
1616c6491e Merge pull request #16779 from mjbvz/fix-16432
Fix #16432 - rejected promise not handled
2016-12-07 08:46:49 +01:00
Matt Bierner
f181861ec3 Update alert to more clearly indicate the impact of this 2016-12-06 19:48:08 -08:00
Matt Bierner
55513deead Fix #16432 - rejected promise not handled
Fixes #16432

Introducing during null check refeactoring. Before the promise was set to null inside the promise. I added a rejection because the promise value should never be used before that point, but it seems that introduced a regression.

Fix is to use `p` inside of the promise instead.
2016-12-06 15:59:50 -08:00
Matt Bierner
e551807483 Consume languageServiceEnabled Events from TS (#16355)
* Initial work on large proejct warnings

* Update to use projectName from ts

* Use event to clean up code

* Remove unused interface

* Revert a few testing changes

* Remove languageServiceEnabled member
2016-12-02 11:21:39 -08:00
Matt Bierner
615ea2b4a4 Allow Enabling useCodeSnippetsOnMethodSuggest for JS As Well As TS (#16351)
Fixes #13952

**Bug**
The `typescript.useCodeSnippetsOnMethodSuggest` setting only applies to Typescript files. I believe it should also apply to JavaScript files.

**Fix**
Use `typescript.useCodeSnippetsOnMethodSuggest` to control this behavior for js files as well.

Also delete unused configuration file.

An alternate design would be to add a `javascript.useCodeSnippetsOnMethodSuggest` configuration option, if users really do want to have different behavior between JS and TS.
2016-12-02 11:08:27 -08:00
Matt Bierner
22deff959d Use Strict Null Checks In TS Extension (#16244)
* Use Strict Null Checks In TS Extension

Updates the Ts extension to use strict null checks.

* Throw instead of returning undefined in some linkedmap cases

* fix small null check in buffersync

* Fix for request item null
2016-12-01 13:48:03 -08:00
Matt Bierner
5e0e79610b Adopt TS 2.1.3-insiders (#16295)
Adopts the 2.1.3 insiders build of TS in the TS extension
2016-11-30 16:00:58 -08:00
Matt Bierner
8c313fcae0 Assume Jsx For Implicit TS Projects (#15925)
Issue #15814

**Bug**
1. Open a tsx file on its own.
2. See a error about passing `--jsx` to tsc.

**Fix**
For implicit projects, assume `"jsx": "preserve"`.

Closes #15814
2016-11-28 10:48:27 -08:00
Matt Bierner
c6566148cf Fix TS/JS Implicit Project Too Large Exclude Action (#15678)
Issue #15610

**bug**
For implicit js/ts projects that trigger the large project warning in vscode, the action currently tries to create a jsconfig.json file in `/dev/null/...`

**Fix**
In cases where the `jsconfig.json` file returned by tsserver is not under the root worspace, create an empty `jsconfig.json` at the root of the project instead.
2016-11-22 14:24:52 -08:00