-
Notifications
You must be signed in to change notification settings - Fork 498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to TypeScript 2.9.x #1344
Conversation
This caused an error in DocumentFormatter but the TS code action suggested a fix which I applied. Take advantage of string enum in settings class for HelpCompletion.
@@ -37,22 +37,22 @@ | |||
"onCommand:PowerShell.RestartSession" | |||
], | |||
"dependencies": { | |||
"vscode-languageclient": "3.3.0" | |||
"vscode": "^1.1.18", |
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.
How come this was moved to being a dependency vs dev dependency?
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.
Could this be the cause of that unfriendly error?
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 is based on the VSCode tutorial on how to write a language server - https://code.visualstudio.com/docs/extensions/example-language-server
There is a section that displays the dependencies
you would have in your package.json file as:
"dependencies": {
"vscode": "^1.1.5",
"vscode-languageclient": "^3.3.0"
}
RE that error - no, that was pilot error on my part because I forgot that you have to run npm run postinstall
right after you run npm install
and before you try to run npm run compile
.
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.
Hmmm I wonder if that was just to make things simple. Even vscode-languageclient
itself has vscode
as a dev dependency:
https://www.npmjs.com/package/vscode-languageclient
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 could remove vscode
and see if it still compiles. Want me to do that?
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.
It seems that the vscode
dependency is necessary, in addition to vscode-languageclient
. Without the former I get this error at the end of npm install
:
Error: Cannot find module 'C:\Users\Keith\GitHub\rkeithhill\vscode-powershell\node_modules\vscode\bin\install'
|
||
// There is something about having this code in the calling method that causes a TS compile error. | ||
// It causes the following error: | ||
// Type 'import("C:/Users/Keith/GitHub/rkeithhill/vscode-powershell/node_modules/vscode-languageserver-typ...' |
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.
Is this the issue you were hitting that you fixed with npm run postinstall
?
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.
No, that was another issue. The error documented in the comment above happened when I simply changed from TS 2.3.x to 2.4.x - bam I'd get that error. My best guess is that newer versions of TS detect the issue. The nice thing about TS 2.9.1 was that it had a code fix for the issue - which I applied above.
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 tried playing around with this just to see if the type error meant anything... Between vscode
, vscode-languageclient
and vscode-languageserver-types
there seems to be a whole can of worms that I can't find much documentation of. So I think this solution is the most tenable for now.
I've been trying to checkout this branch so I can run it, but haven't been having much luck for the past couple of days |
When you get time, do not forget to run |
I will! For now my issue is that git can't find the branch... (I've tried a few ways, the first being the commandline instructions at the bottom) |
Oh that's weird. I can usually do a |
Aha! The |
I'm far from a Git guru but I use |
Yeah, I mean I'm on a fork, but I followed a StackOverflow post to add your fork as another remote (called |
Anyone hit anything similar to this:
|
I got similar errors when I did not execute |
Just ran it again and made sure I ran |
My sequence for such an update is: ri node_modules -r -for
npm install
npm run postinstall
npm run compile After that, you can use |
Okie doke -- I think I ran |
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.
LGTM!
Yeah, I had started this almost a month ago thinking - should be easy - and ran into the TextEdit multiple definition mess. I messed around with it on/off for a while and tabled it. Started up again played around with minimizing the number of npm pkg updates. That's when I noticed simply moving from TS 2.3.x to 2.4.x surfaced this error message. It seems to me there is one def of TextEdit (and friends) you get with the vscode pkg and a slightly different TextEdit you get with vscode-languageclient. It wasn't until I went to TS 2.9.x that I noticed the code-fix light-bulb, invoked it and voila - compiler error went away. I'm still frankly puzzled by the error. The best I can figure is that the use of |
Yeah I'm imagining they've done something strange like defined a type twice and now there some version-dependent cross pollution that really isn't helped at all by the whole |
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.
LGTM :) thanks @rkeithhill!
PR Summary
Update to latest version of TypeScript.
Update VSCode pkgs.
Update VSCode category list to use updated category name:
"Programming Languages"
The update to TS caused an error in DocumentFormatter but a TS
code action suggested a fix which I applied.
Take advantage of string enum in settings class for HelpCompletion.
PR Checklist
Note: Tick the boxes below that apply to this pull request by putting an
x
between the square brackets.Please mark anything not applicable to this PR
NA
.WIP:
to the beginning of the title and remove the prefix when the PR is ready