Skip to content

Commit

Permalink
fix(extension/#2640): Elm - Fix diagnostic display (#2999)
Browse files Browse the repository at this point in the history
__Issue:__ Diagnostics weren't displaying in the elm extension

__Defect:__ Diagnostics are computed on save, but we weren't sending the appropriate event to the extension host to let it know when a save occurred.

__Fix:__ Notify extension host on save

With that, we get diagnostics:
![image](https://user-images.githubusercontent.com/13532591/104788805-02225b80-5748-11eb-819b-2f5dc06b2b6d.png)

Fixes #2640 
Related #1058
  • Loading branch information
bryphe authored Jan 16, 2021
1 parent a4661f7 commit 645ca07
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES_CURRENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
- #2993 - CodeLens: Handle null command id & label icons
- #2997 - Syntax: Fix regression in syntax highlighting for PHP (fixes #2985)
- #2995 - Extensions: Fix bug with 3-param http/https request (fixes #2981)
- #2999 - Extensions: Elm - fix bug with diagnostics not displaying (fixes #2640)

### Performance

Expand Down
7 changes: 7 additions & 0 deletions src/Service/Exthost/Service_Exthost.re
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ module Effects = {
dispatch(toMsg());
})
);

let modelSaved = (~uri, client, toMsg) => {
Isolinear.Effect.createWithDispatch(~name="exthost.modelSaved", dispatch => {
Exthost.Request.Documents.acceptModelSaved(~uri, client);
dispatch(toMsg());
});
};
};
module FileSystemEventService = {
let onFileEvent = (~events, extHostClient) =>
Expand Down
4 changes: 4 additions & 0 deletions src/Service/Exthost/Service_Exthost.rei
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ module Effects: {
unit => 'msg
) =>
Isolinear.Effect.t('msg);

let modelSaved:
(~uri: Oni_Core.Uri.t, Exthost.Client.t, unit => 'msg) =>
Isolinear.Effect.t('msg);
};

module FileSystemEventService: {
Expand Down
8 changes: 7 additions & 1 deletion src/Store/Features.re
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,13 @@ let update =
},
extHostClient,
);
(state, eff);

let modelSavedEff =
Service_Exthost.Effects.Documents.modelSaved(
~uri=Buffer.getUri(buffer), extHostClient, () =>
Noop
);
(state, Isolinear.Effect.batch([eff, modelSavedEff]));

| BufferUpdated({update, newBuffer, oldBuffer, triggerKey}) =>
let fileType =
Expand Down

0 comments on commit 645ca07

Please sign in to comment.