From 7929ea58418b698de441801883d56fe2501021af Mon Sep 17 00:00:00 2001 From: Bryan Phelps Date: Wed, 20 Jan 2021 11:22:11 -0800 Subject: [PATCH] fix(extensions/#2974): Add extension override for Ionide.Ionide-fsharp (#3019) __Issue:__ The Ionide.Ionide-fsharp extension depends on `ms-dotnettools.csharp`, which isn't available on open-vsx __Fix:__ The best-case fix would be to have the ionide-fsharp extension published to open-vsx and have proper dependencies. In the meantime, add a temporary override to map `ms-dotnettols.csharp` -> `muhammad-sammy.csharp` to unblock the extension. With this change - basic language features work: ![2021-01-14 16 37 31](https://user-images.githubusercontent.com/13532591/104665774-13effa00-5687-11eb-84f0-054bc8129c6f.gif) Fixes #2974 Related #1058 --- CHANGES_CURRENT.md | 1 + src/Exthost/Extension/InitData.re | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/CHANGES_CURRENT.md b/CHANGES_CURRENT.md index 602add5121..4475d1a75c 100644 --- a/CHANGES_CURRENT.md +++ b/CHANGES_CURRENT.md @@ -6,6 +6,7 @@ - #3007 - Extensions: Show 'missing dependency' activation error to user - #3011 - Vim: Visual Block - Handle 'I' and 'A' in visual block mode (fixes #1633) - #3016 - Extensions: Fix memory leak in extension host language features (fixes #3009) +- #3019 - Extensions: Fix activation error for Ionide.Ionide-fsharp extension (fixes #2974) ### Performance diff --git a/src/Exthost/Extension/InitData.re b/src/Exthost/Extension/InitData.re index bf9d4d73af..adec9af8f4 100644 --- a/src/Exthost/Extension/InitData.re +++ b/src/Exthost/Extension/InitData.re @@ -13,6 +13,20 @@ module Identifier = { }; module Hacks = { + let patchIonideDependencies = (dependencies: list(Yojson.Safe.t)) => { + dependencies + |> List.map( + fun + | `String(str) => + if (str == "ms-dotnettools.csharp") { + `String("muhammad-sammy.csharp"); + } else { + `String(str); + } + | json => json, + ); + }; + // TEMPORARY workarounds for external bugs blocking extensions let hacks = [ // Workaround for https://github.com/open-vsx/publish-extensions/issues/106 @@ -25,6 +39,17 @@ module Hacks = { | _ => Some(`String("2020-08-04")), ), ), + ( + // Workaround for https://github.com/onivim/oni2/issues/2974 + "ionide.ionide-fsharp", + Utility.JsonEx.update( + "extensionDependencies", + fun + | Some(`List(dependencies)) => + Some(`List(dependencies |> patchIonideDependencies)) + | json => json, + ), + ), ]; let apply = (~extensionId, initDataJson) => {