Commit Graph
43 Commits
Author SHA1 Message Date
Josh Goldberg 4e1768c170 Added '}' to allowed characters in diagnostic message 2019-09-11 15:32:58 -04:00
Josh Goldberg 92dbb65376 Accepted a few more baselines, why not 2019-09-09 22:29:48 -04:00
Josh Goldberg 49be51dcf3 Added more helpful syntax error for enum member commas
Switches the error message emitted by the parser to the more specific _"An enum member name must be followed by a ',' or '='."_ when the expected comma doesn't follow the member.
2019-09-09 22:11:56 -04:00
Josh Goldberg 79e9bb1c8f Added explicit check for scientific notation 2019-09-07 19:41:03 -04:00
Josh Goldberg 99f9719ab3 Added codefix for numeric literals >= 2 ** 53
`Number.MAX_SAFE_INTEGER` is `2 ** 53 - 1`, so anything greater than that is a 'dangerous' integer to store as a traditional number. This adds a codefix to suggest converting them to a `bigint` literal.
2019-09-07 18:43:32 -04:00
Josh Goldberg 0c832f258d Updated baselines again 2019-04-04 15:04:11 -04:00
Josh Goldberg e767ee0472 Merge branch 'master' into property-use-before-declare 2019-04-04 14:05:19 -04:00
Josh Goldberg 236fed9445 Fixed post-merge introduced lint errors 2019-04-03 18:09:33 -04:00
Josh Goldberg 6661f90b44 Accepted odd new baseline 2019-04-03 09:00:42 -04:00
Josh Goldberg ee4e90c1fb Merge branch 'master' into property-use-before-declare 2019-04-03 08:35:22 -04:00
Josh Goldberg 3c8ce9b316 Addressed quick feedback items 2019-04-03 08:32:51 -04:00
Josh Goldberg 38e1856945 Accepted 'witness' baselines; removed unnecessary !== 2019-01-14 17:30:42 -05:00
Josh Goldberg cd88f6a319 Added error for class properties used within their own declaration
Fixes #5987.

Usages of a class property in a preceding property already gave an error, but the following doesn't yet:

```ts
class Test {
    x: number = this.x;
}
```

As with other use-before-declare checking, IIFEs are not treated as invalid uses.
2019-01-13 13:30:58 -05:00
Josh Goldberg 7b6adae6dd Extracted compilerOptions setting to helper function 2019-01-11 15:05:24 -05:00
Josh Goldberg 8d28f9230c Added codefix to enable experimentalDecorators in the user's config file
Starts on #29035 by creating a codefix to enable the `experimentalDecorators` setting in a user's config file, if one exists. The issue's discussion also mentions giving a more precise error message if the user has a jsconfig or tsconfig or creating one if not; I'd rather tackle those in separate PRs to keep this one small.

Doesn't create the code action if no config file is present. Otherwise keeps to the precedent of returning without action when the config file contents aren't the expected JSON structure (looking at `fixCannotFindModule.ts`).  Moves a couple JSON helpers from that file into the sibling `helpers.ts` so both codefixes can use them.
2019-01-11 09:20:12 -05:00
Josh Goldberg 0d7e3f82d4 Stretched the error to the end of 'n's 2018-12-18 00:56:00 -08:00
Josh Goldberg 773c50f05a Better error message for invalid bigint literals ending with n
Helps with the cases of decimals and exponentials, though not with numbers incorrectly starting with `0`.

Fixes #28887.
2018-12-07 00:40:13 -08:00
Josh Goldberg a211184347 Clarified error message; extended error to identifier end
Lengthening the reported error length to include all of the identifier necessitates scanning for all of the identifier. I also reset the `pos` after so other identifier scanning still happens.
2018-12-06 11:17:06 -08:00
Josh Goldberg 31fca3af4d Accepted new baselines 2018-12-04 18:33:06 -08:00
Josh Goldberg 51d10ee4a0 Removed excess new check 2018-12-04 18:29:58 -08:00
Josh Goldberg 174816fc26 Added error for IdentifierStart immediately after a NumericLiteral
Fixes #4702.
2018-12-04 17:59:20 -08:00
Josh Goldberg 7812e5180f Trailing whitespace, oh no! 2018-04-19 22:01:08 -07:00
Josh Goldberg 351251193d Simplified to one output line 2018-04-19 21:54:08 -07:00
Josh Goldberg 8d6c2bc1b1 Used return value from clearScreenIfNotWatchingForFiles 2018-04-19 21:53:01 -07:00
Josh Goldberg d1b044b72f Standardized for --preserveWatchOutput too 2018-04-18 17:08:43 -07:00
Josh Goldberg c974b2ced7 Helps to check in the test changes, too 2018-04-17 08:57:05 -07:00
Josh Goldberg bc9ad90a81 Adjusted newlines in non-pretty output for consistency
Fixes #23469
2018-04-17 08:28:12 -07:00
Josh Goldberg 9dff614bd2 Combined the "Found X error(s)" and "Compilation" complete --watch messages 2018-04-17 01:47:43 -07:00
Josh Goldberg 0dbebec28f Feedback: correct order in watch.ts; DRY tests 2018-04-04 13:21:19 -04:00
Josh Goldberg cf0a0ec001 Fixed unit tests for error counts 2018-04-01 22:57:38 -07:00
Josh Goldberg d268279c8e Merge branch 'master' into pretty-watch-error-summaries 2018-04-01 21:44:55 -07:00
Josh Goldberg 15b61dcd6b Made watch mode always report summary 2018-03-09 14:09:38 -08:00
Josh Goldberg a4ca0716eb Reverted now-unused ProgramDiagnosticsAndEmit 2018-03-09 09:41:11 -08:00
Josh Goldberg c5d2bb6367 Merge branch 'master' into pretty-watch-error-summaries
# Conflicts:
#	src/compiler/diagnosticMessages.json
#	src/compiler/watch.ts
2018-03-09 09:37:26 -08:00
Josh Goldberg 9cf5538763 Simplified error message counts; internalized reporting to createWatchCompilerHost
Instead of modifying the logic in both `tsc.ts`to `watch.ts` by splitting `emitFilesAndReportErrors` in two, this adds an optional function parameter to report them.
Removes file counting for diagnostic messages, as they might not be coming from files.

Next commit will include tests.
2018-03-08 20:47:45 -08:00
Josh Goldberg e0d067b48f Added an errors summary for --pretty --watch results
Reports a "Found X error(s) across Y file(s)." message on each recompile if in both pretty and watch modes.
This commit intentionally doesn't include tests as I have a few questions about implementation details. Will ask in PR first.
2018-02-28 19:22:42 -08:00
Josh Goldberg b3151707df Converted to enum; marked internal 2017-12-19 12:19:39 -08:00
Josh Goldberg cf9b8baa8c Merge branch 'master' into watch-immediate-clears
# Conflicts:
#	src/harness/unittests/tscWatchMode.ts
2017-12-04 23:22:00 -08:00
Josh Goldberg a389ff5f39 Unit test failure; clearHostScreen function 2017-12-04 23:11:01 -08:00
Josh Goldberg 98b64db811 Re-added blue color, with corrected 94m code 2017-12-04 22:28:56 -08:00
Josh Goldberg a4f83b0835 Added console clearing with a message to --watch starts
I advocated against immediately clearing the console when starting --watch in #17756 because it was confusing to have the console suddenly become blank, wait a while, and _then_ give output. After using the feature for a little while, I think it's a little disorienting how the console will only start clearing after the first recompile. This change clears the console and immediately prints a new "Starting compilation in watch mode..." message.
2017-12-03 14:45:33 -08:00
Josh Goldberg ff7510dc92 Fixed prettyContextNotDebugAssertion.errors baseline 2017-12-02 21:36:36 -08:00
Josh Goldberg eb5d8d0dd7 Prettified timestamps and error reports in --pretty
Timestamps look like Gulp's, with grey times inside white brackets.
Files have cyan filenames, yellow line and column numbers, and grey TS{####} errors. I wonder if those are actually useful for folks using the --pretty CLI: are they used for anything outside Visual Studio... Can we just get rid of them?

Re-uses compiler/program's color logic in compiler/watch. The relevant variables are now exported and marked `@internal`. Is there a preferred way of re-using this code in both those files?
2017-12-02 20:56:35 -08:00