Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

feat(typescript): upgrade to typescript 2.8.3 #452

Merged
merged 1 commit into from
May 8, 2018

Conversation

matthiaskern
Copy link
Contributor

@matthiaskern matthiaskern commented May 2, 2018

There are some some tests failing due to code location in lib.ts files, are those safe to fix? #448

@@ -27,14 +27,16 @@ export function convertTsDiagnostic(diagnostic: ts.Diagnostic): Diagnostic {
*
* @param category The Typescript DiagnosticCategory
*/
function convertDiagnosticCategory(category: ts.DiagnosticCategory): DiagnosticSeverity {
function convertDiagnosticCategory(category: ts.DiagnosticCategory): DiagnosticSeverity | undefined {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to add a default case due to
TS2366: Function lacks ending return statement and return type does not include 'undefined'

package.json Outdated
@@ -51,7 +51,7 @@
"rxjs": "^5.5.0",
"semaphore-async-await": "^1.5.1",
"string-similarity": "^1.1.0",
"typescript": "2.7.2",
"typescript": "^2.8.3",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please pin this version, any version change can break.

switch (category) {
case ts.DiagnosticCategory.Error:
return DiagnosticSeverity.Error
case ts.DiagnosticCategory.Warning:
return DiagnosticSeverity.Warning
case ts.DiagnosticCategory.Message:
return DiagnosticSeverity.Information
default:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't have a default, the fact that TS will error if not all DiagnosticSeverities are handled is a good thing. This should instead handle the new DiagnosticSeverity. This should map to Hint

@felixfbecker
Copy link
Contributor

Yes, the locations in the tests need to be updated.

@matthiaskern matthiaskern force-pushed the typescript-2.8.3 branch 2 times, most recently from b085afd to c4e74fe Compare May 3, 2018 10:36
@codecov
Copy link

codecov bot commented May 3, 2018

Codecov Report

Merging #452 into master will decrease coverage by 0.08%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #452      +/-   ##
=========================================
- Coverage   83.18%   83.1%   -0.09%     
=========================================
  Files          15      15              
  Lines        2040    2042       +2     
  Branches      482     416      -66     
=========================================
  Hits         1697    1697              
- Misses        341     343       +2     
  Partials        2       2
Impacted Files Coverage Δ
src/diagnostics.ts 68.42% <0%> (-8.05%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 35b0140...d32e5ee. Read the comment docs.

span: { start: 49, length: 13 },
newText: '\t\tthis.missingThis',
span: { start: 51, length: 11 },
newText: 'this.missingThis',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like tabs are not anymore captured

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fine since start is excluding the tabs

@@ -35,6 +35,7 @@ function convertDiagnosticCategory(category: ts.DiagnosticCategory): DiagnosticS
return DiagnosticSeverity.Warning
case ts.DiagnosticCategory.Message:
return DiagnosticSeverity.Information
// unmapped: DiagnosticSeverity.Hint
default:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as said, there shouldn't be a default case, the new ts.DiagnosticSeverity.Suggestion that was introduced and caused this error should be mapped explicitely. Otherwise we won't get errors like this for future updates.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops, I misunderstood. Should the new ts.DiagnosticCategory.Suggestion be mapped to DiagnosticSeverity.Hint then?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe check if a Hint is properly displayed by your client (VS Code, neovim, VS Code, ...)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked with neovim. Also agree it makes the most sense semantically.

@felixfbecker
Copy link
Contributor

Didn't mean to approve yet

@matthiaskern matthiaskern force-pushed the typescript-2.8.3 branch 3 times, most recently from 260a38b to 39119a2 Compare May 6, 2018 19:11
Copy link
Contributor

@felixfbecker felixfbecker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost good to go, but looks like you used npm 5 to install which changed the whole lockfile - please make sure to use npm 6

@matthiaskern matthiaskern force-pushed the typescript-2.8.3 branch 3 times, most recently from 2195211 to a0164c2 Compare May 8, 2018 10:48
@matthiaskern
Copy link
Contributor Author

Not sure what am I missing. Regenerated with v6 but it still seems to have changed a ton? Maybe just a dependency's fault.

@felixfbecker felixfbecker merged commit 15579a1 into sourcegraph:master May 8, 2018
@tsirlucas
Copy link

Hey @felixfbecker, please answer this once the new version is up so I can enable the vscode plugin again haha

@felixfbecker
Copy link
Contributor

@tsirlucas I am not an RSS feed, you can watch the build yourself 😉 https://travis-ci.org/sourcegraph/javascript-typescript-langserver/builds/376491759

@tsirlucas
Copy link

Oh, that's not what I meant! I was afraid that the release to the vscode market would be manual or something. Really sorry if I sounded like an ass. :(

@felixfbecker
Copy link
Contributor

🎉 This PR is included in version 2.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@felixfbecker
Copy link
Contributor

@tsirlucas it is, but there are still other services to subscribe for new releases 😉 . No offense taken though

@felixfbecker
Copy link
Contributor

felixfbecker commented May 8, 2018

@tsirlucas having some problems with vsce access tokens, can't update the extension rn. Sorry.

@tsirlucas
Copy link

tsirlucas commented May 8, 2018

No need to apologize lol

Can you give me the url of some of that services you told me about so I can subscribe for the release?

@felixfbecker
Copy link
Contributor

I use Sibbell which is being shut down soon, but a simple Google search brings up https://coderelease.io/

@tsirlucas
Copy link

@felixfbecker Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants