Skip to content

Commit

Permalink
fix(extensions/#2974): Add extension override for Ionide.Ionide-fsharp (
Browse files Browse the repository at this point in the history
#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
  • Loading branch information
bryphe authored Jan 20, 2021
1 parent 2885f9f commit 7929ea5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES_CURRENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
25 changes: 25 additions & 0 deletions src/Exthost/Extension/InitData.re
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) => {
Expand Down

0 comments on commit 7929ea5

Please sign in to comment.