Skip to content

Commit 1738c15

Browse files
authored
Update to vscode-languageclient 8 (ionide#1713)
* most of the things * minimal changes * add null coalescing support * try to load vscode dependencies as well * update webpack and remove unnecessary babel loader dependency
1 parent f9f7346 commit 1738c15

27 files changed

+943
-3562
lines changed

.config/dotnet-tools.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
]
1010
},
1111
"fable": {
12-
"version": "3.7.8",
12+
"version": "3.7.11",
1313
"commands": [
1414
"fable"
1515
]
1616
},
17-
"fantomas-tool": {
18-
"version": "4.7.0",
17+
"fantomas": {
18+
"version": "5.0.0-alpha-007",
1919
"commands": [
2020
"fantomas"
2121
]

.github/workflows/pr.yml

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
# need to add linux commands first
1515
os: [windows-latest, macos-latest]
1616
dotnet: [6.0.101]
17+
fail-fast: false # we have timing issues on some OS, so we want them all to run
1718
runs-on: ${{ matrix.os }}
1819

1920
steps:

package.json

+3-7
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,19 @@
77
"semver": "^7.3.5"
88
},
99
"devDependencies": {
10-
"@babel/core": "^7.11.6",
11-
"@babel/plugin-transform-runtime": "^7.11.5",
12-
"@babel/preset-env": "^7.11.5",
1310
"@types/semver": "^7.3.8",
1411
"@types/showdown": "^1.9.3",
1512
"@types/vscode": "^1.52.0",
1613
"@types/ws": "^7.2.6",
1714
"axios": "^0.20.0",
18-
"babel-loader": "^8.1.0",
1915
"mocha": "^8.1.3",
2016
"showdown": "^1.9.1",
2117
"toml": "^3.0.0",
2218
"ts2fable": "^0.8.0-build.618",
2319
"vscode-debugadapter": "^1.44.0",
24-
"vscode-languageclient": "^7.0.0",
25-
"webpack": "^4.44.1",
26-
"webpack-cli": "^3.3.12",
20+
"vscode-languageclient": "^8.0.0",
21+
"webpack": "^5.73.0",
22+
"webpack-cli": "^4.10.0",
2723
"ws": "^7.3.1",
2824
"xhr2": "^0.2.0",
2925
"xmldom": "^0.6.0",

paket.lock

+33-35
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ NUGET
2222
Fable.Browser.Event (>= 1.5)
2323
Fable.Core (>= 3.0)
2424
FSharp.Core (>= 4.7.2)
25-
Fable.Core (3.6.2)
25+
Fable.Core (3.7.1)
2626
Fable.HtmlConverter (2.1)
2727
Fable.Core (>= 3.1.5)
2828
Thoth.Json (>= 4.1)
@@ -32,19 +32,19 @@ NUGET
3232
Fable.Promise (3.1.3)
3333
Fable.Core (>= 3.1.5)
3434
FSharp.Core (>= 4.7.2)
35-
FSharp.Core (6.0.3)
35+
FSharp.Core (6.0.4)
3636
Thoth.Json (7.0)
3737
Fable.Core (>= 3.1.6)
3838
FSharp.Core (>= 4.7.2)
3939
GIT
4040
remote: https://github.com/ionide/ionide-fsgrammar.git
41-
(8825a76681cdc14801b5d9490372ff67ec6b9711)
41+
(33c42ce4b0960c86837a978fa06c45bc3dec0521)
4242
GITHUB
4343
remote: ionide/ionide-vscode-helpers
44-
src/Fable.Import.Showdown.fs (6ed5341be68452af4f93f7c6e462cdfb58dd0464)
45-
src/Fable.Import.VSCode.fs (6ed5341be68452af4f93f7c6e462cdfb58dd0464)
46-
src/Fable.Import.VSCode.LanguageServer.fs (6ed5341be68452af4f93f7c6e462cdfb58dd0464)
47-
src/Helpers.fs (6ed5341be68452af4f93f7c6e462cdfb58dd0464)
44+
src/Fable.Import.Showdown.fs (8d2fca6c1d49172bdd50b3fcdd6a5d66019dffd0)
45+
src/Fable.Import.VSCode.fs (8d2fca6c1d49172bdd50b3fcdd6a5d66019dffd0)
46+
src/Fable.Import.VSCode.LanguageServer.fs (8d2fca6c1d49172bdd50b3fcdd6a5d66019dffd0)
47+
src/Helpers.fs (8d2fca6c1d49172bdd50b3fcdd6a5d66019dffd0)
4848
GROUP build
4949
STORAGE: NONE
5050
RESTRICTION: == net6.0
@@ -174,12 +174,12 @@ NUGET
174174
FSharp.Core (>= 6.0)
175175
FParsec (1.1.1)
176176
FSharp.Core (>= 4.3.4)
177-
FSharp.Control.Reactive (5.0.2)
177+
FSharp.Control.Reactive (5.0.5)
178178
FSharp.Core (>= 4.7.2)
179-
System.Reactive (>= 5.0)
180-
FSharp.Core (6.0.3)
181-
Microsoft.Build (17.1)
182-
Microsoft.Build.Framework (>= 17.1)
179+
System.Reactive (>= 5.0 < 6.0)
180+
FSharp.Core (6.0.4)
181+
Microsoft.Build (17.2)
182+
Microsoft.Build.Framework (>= 17.2)
183183
Microsoft.NET.StringTools (>= 1.0)
184184
Microsoft.Win32.Registry (>= 4.3)
185185
System.Collections.Immutable (>= 5.0)
@@ -189,12 +189,12 @@ NUGET
189189
System.Text.Encoding.CodePages (>= 4.0.1)
190190
System.Text.Json (>= 6.0)
191191
System.Threading.Tasks.Dataflow (>= 6.0)
192-
Microsoft.Build.Framework (17.1)
192+
Microsoft.Build.Framework (17.2)
193193
Microsoft.Win32.Registry (>= 4.3)
194194
System.Security.Permissions (>= 4.7)
195-
Microsoft.Build.Tasks.Core (17.1)
196-
Microsoft.Build.Framework (>= 17.1)
197-
Microsoft.Build.Utilities.Core (>= 17.1)
195+
Microsoft.Build.Tasks.Core (17.2)
196+
Microsoft.Build.Framework (>= 17.2)
197+
Microsoft.Build.Utilities.Core (>= 17.2)
198198
Microsoft.NET.StringTools (>= 1.0)
199199
Microsoft.Win32.Registry (>= 4.3)
200200
System.CodeDom (>= 4.4)
@@ -205,14 +205,12 @@ NUGET
205205
System.Security.Cryptography.Xml (>= 4.7)
206206
System.Security.Permissions (>= 4.7)
207207
System.Threading.Tasks.Dataflow (>= 6.0)
208-
Microsoft.Build.Utilities.Core (17.1)
209-
Microsoft.Build.Framework (>= 17.1)
208+
Microsoft.Build.Utilities.Core (17.2)
209+
Microsoft.Build.Framework (>= 17.2)
210210
Microsoft.NET.StringTools (>= 1.0)
211211
Microsoft.Win32.Registry (>= 4.3)
212212
System.Collections.Immutable (>= 5.0)
213213
System.Configuration.ConfigurationManager (>= 4.7)
214-
System.Security.Permissions (>= 4.7)
215-
System.Text.Encoding.CodePages (>= 4.0.1)
216214
Microsoft.NET.StringTools (1.0)
217215
System.Memory (>= 4.5.4)
218216
System.Runtime.CompilerServices.Unsafe (>= 5.0)
@@ -221,27 +219,27 @@ NUGET
221219
System.Security.Principal.Windows (>= 5.0)
222220
Microsoft.Win32.SystemEvents (6.0.1)
223221
Mono.Posix.NETStandard (1.0)
224-
MSBuild.StructuredLogger (2.1.630)
222+
MSBuild.StructuredLogger (2.1.669)
225223
Microsoft.Build (>= 16.10)
226224
Microsoft.Build.Framework (>= 16.10)
227225
Microsoft.Build.Tasks.Core (>= 16.10)
228226
Microsoft.Build.Utilities.Core (>= 16.10)
229227
Newtonsoft.Json (13.0.1)
230-
NuGet.Common (6.1)
231-
NuGet.Frameworks (>= 6.1)
232-
NuGet.Configuration (6.1)
233-
NuGet.Common (>= 6.1)
228+
NuGet.Common (6.2)
229+
NuGet.Frameworks (>= 6.2)
230+
NuGet.Configuration (6.2)
231+
NuGet.Common (>= 6.2)
234232
System.Security.Cryptography.ProtectedData (>= 4.4)
235-
NuGet.Frameworks (6.1)
236-
NuGet.Packaging (6.1)
233+
NuGet.Frameworks (6.2)
234+
NuGet.Packaging (6.2)
237235
Newtonsoft.Json (>= 13.0.1)
238-
NuGet.Configuration (>= 6.1)
239-
NuGet.Versioning (>= 6.1)
236+
NuGet.Configuration (>= 6.2)
237+
NuGet.Versioning (>= 6.2)
240238
System.Security.Cryptography.Cng (>= 5.0)
241239
System.Security.Cryptography.Pkcs (>= 5.0)
242-
NuGet.Protocol (6.1)
243-
NuGet.Packaging (>= 6.1)
244-
NuGet.Versioning (6.1)
240+
NuGet.Protocol (6.2)
241+
NuGet.Packaging (>= 6.2)
242+
NuGet.Versioning (6.2)
245243
Octokit (0.49)
246244
System.CodeDom (6.0)
247245
System.Collections.Immutable (6.0)
@@ -252,7 +250,7 @@ NUGET
252250
System.Drawing.Common (6.0)
253251
Microsoft.Win32.SystemEvents (>= 6.0)
254252
System.Formats.Asn1 (6.0)
255-
System.Memory (4.5.4)
253+
System.Memory (4.5.5)
256254
System.Reactive (5.0)
257255
System.Reflection.Metadata (6.0.1)
258256
System.Collections.Immutable (>= 6.0)
@@ -261,7 +259,7 @@ NUGET
261259
System.Security.AccessControl (6.0)
262260
System.Security.Cryptography.Cng (5.0)
263261
System.Formats.Asn1 (>= 5.0)
264-
System.Security.Cryptography.Pkcs (6.0)
262+
System.Security.Cryptography.Pkcs (6.0.1)
265263
System.Formats.Asn1 (>= 6.0)
266264
System.Security.Cryptography.ProtectedData (6.0)
267265
System.Security.Cryptography.Xml (6.0)
@@ -275,7 +273,7 @@ NUGET
275273
System.Runtime.CompilerServices.Unsafe (>= 6.0)
276274
System.Text.Encodings.Web (6.0)
277275
System.Runtime.CompilerServices.Unsafe (>= 6.0)
278-
System.Text.Json (6.0.3)
276+
System.Text.Json (6.0.4)
279277
System.Runtime.CompilerServices.Unsafe (>= 6.0)
280278
System.Text.Encodings.Web (>= 6.0)
281279
System.Threading.Tasks.Dataflow (6.0)

src/Components/CodeLensHelpers.fs

+1-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,10 @@ open System
44
open Fable.Core.JsInterop
55
open Fable.Import.VSCode
66
open Fable.Import.VSCode.Vscode
7-
open global.Node
8-
9-
module node = Node.Api
107

118
module CodeLensHelpers =
129

13-
let showReferences (args: string) (args2: obj) (args3: obj []) =
10+
let showReferences (args: string) (args2: obj) (args3: obj[]) =
1411
let uri = vscode.Uri.parse args
1512
let pos = vscode.Position.Create(!!args2?Line, !!args2?Character)
1613

src/Components/Debugger.fs

+20-14
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ module Debugger =
9191

9292
let debuggerRuntime project = Some "coreclr"
9393

94-
let debugProject (project: Project) (args: string []) =
94+
let debugProject (project: Project) (args: string[]) =
9595
promise {
9696
//TODO check if portablepdb, require info from FSAC
9797

@@ -158,13 +158,11 @@ module Debugger =
158158
promise {
159159
match Project.getLoaded () with
160160
| [] -> return None
161-
| project::[] -> return Some project
161+
| project :: [] -> return Some project
162162
| projects ->
163163
let picks =
164164
projects
165-
|> List.map (fun p ->
166-
createObj [ "data" ==> p
167-
"label" ==> p.Project ])
165+
|> List.map (fun p -> createObj [ "data" ==> p; "label" ==> p.Project ])
168166
|> ResizeArray
169167

170168
let! proj = window.showQuickPick (unbox<U2<ResizeArray<QuickPickItem>, _>> picks)
@@ -198,7 +196,7 @@ module Debugger =
198196
abstract member Item: string -> 't
199197

200198
[<Emit("Object.keys($0)")>]
201-
abstract member Keys: string []
199+
abstract member Keys: string[]
202200

203201
[<Interface>]
204202
type LaunchSettingsConfiguration =
@@ -268,35 +266,42 @@ module Debugger =
268266
c.request <- "launch"
269267
c?program <- projectExecutable
270268
c?args <- cliArgs
269+
271270
match buildTaskOpt with
272271
| Some bt -> c?preLaunchTask <- $"Build: {bt.name}"
273272
| None -> ()
274273

275-
c?cwd <- ls.workingDirectory
276-
|> Option.defaultValue "${workspaceFolder}"
274+
c?cwd <-
275+
ls.workingDirectory
276+
|> Option.defaultValue "${workspaceFolder}"
277277

278278

279279

280280
match ls.launchBrowser with
281281
| Some true ->
282-
c?serverReadyAction <- {| action = "openExternally"
283-
pattern = "\\bNow listening on:\\s+(https?://\\S+)" |} // TODO: make this pattern extendable?
282+
c?serverReadyAction <-
283+
{| action = "openExternally"
284+
pattern = "\\bNow listening on:\\s+(https?://\\S+)" |} // TODO: make this pattern extendable?
284285
| _ -> ()
285286

286287
if JS.isDefined ls.environmentVariables then
287288
let vars =
288289
ls.environmentVariables.Keys
289290
|> Array.choose (fun k ->
290291
let value = ls.environmentVariables[k]
292+
291293
if JS.isDefined value then
292294
let replaced = Environment.expand value
293-
Some (k, box replaced)
294-
else None
295-
)
295+
Some(k, box replaced)
296+
else
297+
None)
296298

297299
c?env <- createObj vars
298300

299-
if not (JS.isDefined ls.environmentVariables["ASPNETCORE_URLS"]) && Option.isSome ls.applicationUrl then
301+
if
302+
not (JS.isDefined ls.environmentVariables["ASPNETCORE_URLS"])
303+
&& Option.isSome ls.applicationUrl
304+
then
300305
c?env?ASPNETCORE_URLS <- ls.applicationUrl.Value
301306

302307
c?console <- "internalConsole"
@@ -335,6 +340,7 @@ module Debugger =
335340

336341
c?console <- "internalConsole"
337342
c?stopAtEntry <- false
343+
338344
match buildTaskOpt with
339345
| Some bt -> c?preLaunchTask <- $"Build: {bt.name}"
340346
| None -> ()

src/Components/FSharpLiterate.fs

+7-5
Original file line numberDiff line numberDiff line change
@@ -228,13 +228,15 @@ module FSharpLiterate =
228228
| Some p -> p.reveal (!! -2, true)
229229
| None ->
230230
let opts =
231-
createObj [ "enableCommandUris" ==> true
232-
"enableFindWidget" ==> true
233-
"retainContextWhenHidden" ==> true ]
231+
createObj
232+
[ "enableCommandUris" ==> true
233+
"enableFindWidget" ==> true
234+
"retainContextWhenHidden" ==> true ]
234235

235236
let viewOpts =
236-
createObj [ "preserveFocus" ==> true
237-
"viewColumn" ==> -2 ]
237+
createObj
238+
[ "preserveFocus" ==> true
239+
"viewColumn" ==> -2 ]
238240

239241
let p =
240242
window.createWebviewPanel ("fsharpLiterate", "F# Literate", !!viewOpts, opts)

src/Components/FakeTargetsOutline.fs

+9-9
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ module FakeTargetsOutline =
4242
| DependencyModel of DependencyType
4343

4444
type Model =
45-
{ AllTargets: Target []
45+
{ AllTargets: Target[]
4646
Label: string
4747
Description: string
4848
Declaration: Declaration option
@@ -117,11 +117,11 @@ module FakeTargetsOutline =
117117
Some
118118
<| getIconPath "auto-reveal-light.svg" "auto-reveal-dark.svg"
119119

120-
let tryFindTarget (allTargets: Target []) (name: string) =
120+
let tryFindTarget (allTargets: Target[]) (name: string) =
121121
allTargets
122122
|> Seq.tryFind (fun t -> t.Name.ToLowerInvariant() = name.ToLowerInvariant())
123123

124-
let rec depAsModel (allTargets: Target []) (t: DependencyType) (d: Dependency) =
124+
let rec depAsModel (allTargets: Target[]) (t: DependencyType) (d: Dependency) =
125125
let mutable children = None
126126

127127
{ AllTargets = allTargets
@@ -147,7 +147,7 @@ module FakeTargetsOutline =
147147
children <- Some n
148148
n }
149149

150-
and targetAsModel (allTargets: Target []) (t: Target) =
150+
and targetAsModel (allTargets: Target[]) (t: Target) =
151151
let mutable children = None
152152

153153
{ AllTargets = allTargets
@@ -380,7 +380,7 @@ module FakeTargetsOutline =
380380
window.onDidChangeActiveTextEditor.Invoke(unbox onDidChangeActiveTextEditor)
381381
|> context.Subscribe
382382

383-
refresh.event.Invoke (fun uri ->
383+
refresh.event.Invoke(fun uri ->
384384
if isEnabledFor uri then
385385
reallyRefresh.fire (None)
386386

@@ -400,8 +400,9 @@ module FakeTargetsOutline =
400400
let line = decl.Line
401401

402402
let args =
403-
createObj [ "lineNumber" ==> line
404-
"at" ==> "center" ]
403+
createObj
404+
[ "lineNumber" ==> line
405+
"at" ==> "center" ]
405406

406407
commands.executeCommand ("revealLine", Some(box args))
407408
|> unbox
@@ -482,8 +483,7 @@ module FakeTargetsOutline =
482483
let procExp =
483484
vscode.ProcessExecution.Create(
484485
dotnet,
485-
ResizeArray [| yield fakeRuntime
486-
yield! args |],
486+
ResizeArray [| yield fakeRuntime; yield! args |],
487487
opts
488488
)
489489

0 commit comments

Comments
 (0)