-
Notifications
You must be signed in to change notification settings - Fork 73
feat(typescript): upgrade to typescript 2.8.3 #452
Conversation
src/diagnostics.ts
Outdated
@@ -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 { |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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.
src/diagnostics.ts
Outdated
switch (category) { | ||
case ts.DiagnosticCategory.Error: | ||
return DiagnosticSeverity.Error | ||
case ts.DiagnosticCategory.Warning: | ||
return DiagnosticSeverity.Warning | ||
case ts.DiagnosticCategory.Message: | ||
return DiagnosticSeverity.Information | ||
default: |
There was a problem hiding this comment.
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
Yes, the locations in the tests need to be updated. |
b085afd
to
c4e74fe
Compare
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
span: { start: 49, length: 13 }, | ||
newText: '\t\tthis.missingThis', | ||
span: { start: 51, length: 11 }, | ||
newText: 'this.missingThis', |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
src/diagnostics.ts
Outdated
@@ -35,6 +35,7 @@ function convertDiagnosticCategory(category: ts.DiagnosticCategory): DiagnosticS | |||
return DiagnosticSeverity.Warning | |||
case ts.DiagnosticCategory.Message: | |||
return DiagnosticSeverity.Information | |||
// unmapped: DiagnosticSeverity.Hint | |||
default: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would think so? Semantically the words seem similar
Examples for Suggestion
: https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/Microsoft/TypeScript%24+Suggestion+f:%5Esrc/compiler/diagnosticMessages.json%24
Examples for Message
: https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/Microsoft/TypeScript%24+Message+f:%5Esrc/compiler/diagnosticMessages.json%24
There was a problem hiding this comment.
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, ...)?
There was a problem hiding this comment.
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.
Didn't mean to approve yet |
260a38b
to
39119a2
Compare
There was a problem hiding this 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
2195211
to
a0164c2
Compare
Not sure what am I missing. Regenerated with v6 but it still seems to have changed a ton? Maybe just a dependency's fault. |
a0164c2
to
d32e5ee
Compare
Hey @felixfbecker, please answer this once the new version is up so I can enable the vscode plugin again haha |
@tsirlucas I am not an RSS feed, you can watch the build yourself 😉 https://travis-ci.org/sourcegraph/javascript-typescript-langserver/builds/376491759 |
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. :( |
🎉 This PR is included in version 2.9.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@tsirlucas it is, but there are still other services to subscribe for new releases 😉 . No offense taken though |
@tsirlucas having some problems with vsce access tokens, can't update the extension rn. Sorry. |
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? |
I use Sibbell which is being shut down soon, but a simple Google search brings up https://coderelease.io/ |
@felixfbecker Thanks! |
There are some some tests failing due to code location in lib.ts files, are those safe to fix? #448