-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extension Host: Send initialization data (#189)
* Initial integration * Revert vsync change * Start adding extension host client Reason API * Initial ExtensionHost client start-up * Get extension host running * Hook up entry point to process messages * Add basic test case to verify we get 'Ready' message from extension host * Formatting * Tweak runner * Factor protocol out * Fix ExtHostProtocol path * Formatting * Fix merge conflict * Start stubbing out InitDat * Get ExtensionHostInitData compiling * Formatting * Debugging exception on startup * Refactor interface, test for 'initialized' event * Formatting * Remove logging
- Loading branch information
Showing
8 changed files
with
181 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* ExtensionHostInitData.re | ||
* | ||
* Module documenting the initialization data required for spinning up | ||
* and activating the extension host | ||
*/ | ||
|
||
open Oni_Core; | ||
|
||
module ExtensionInfo = { | ||
[@deriving (show({with_path: false}), yojson({strict: false, exn: true}))] | ||
type t = {identifier: string}; | ||
}; | ||
|
||
module Workspace = { | ||
[@deriving (show({with_path: false}), yojson({strict: false, exn: true}))] | ||
type t = {__test: string}; | ||
}; | ||
|
||
module Environment = { | ||
[@deriving (show({with_path: false}), yojson({strict: false, exn: true}))] | ||
type t = {globalStorageHomePath: string}; | ||
|
||
let create = (~globalStorageHomePath=Filesystem.unsafeFindHome(), ()) => { | ||
let ret: t = {globalStorageHomePath: globalStorageHomePath}; | ||
ret; | ||
}; | ||
}; | ||
|
||
[@deriving (show({with_path: false}), yojson({strict: false, exn: true}))] | ||
type t = { | ||
extensions: list(ExtensionInfo.t), | ||
parentPid: int, | ||
environment: Environment.t, | ||
logsLocationPath: string, | ||
autoStart: bool, | ||
}; | ||
|
||
let create = | ||
( | ||
~parentPid=Unix.getpid(), | ||
~extensions=[], | ||
~environment=Environment.create(), | ||
~logsLocationPath=Filesystem.unsafeFindHome(), | ||
~autoStart=true, | ||
(), | ||
) => { | ||
parentPid, | ||
extensions, | ||
environment, | ||
logsLocationPath, | ||
autoStart, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* ExtensionHostProtocol.re | ||
* | ||
* This module documents & types the protocol for communicating with the VSCode Extension Host. | ||
* | ||
*/ | ||
|
||
module MessageType = { | ||
let initialized = 0; | ||
let ready = 1; | ||
let initData = 2; | ||
let terminate = 3; | ||
let requestJsonArgs = 4; | ||
}; | ||
|
||
module LogLevel = { | ||
let trace = 0; | ||
let debug = 1; | ||
let info = 2; | ||
let warning = 3; | ||
let error = 4; | ||
let critical = 5; | ||
let off = 6; | ||
}; | ||
|
||
module Environment = { | ||
type t = { | ||
/* isExtensionDevelopmentDebug: bool, */ | ||
/* appRootPath: string, */ | ||
/* appSettingsHomePath: string, */ | ||
/* extensionDevelopmentLocationPath: string, */ | ||
/* extensionTestsLocationPath: string, */ | ||
globalStorageHomePath: string, | ||
}; | ||
|
||
let create = (~globalStorageHomePath, ()) => { | ||
globalStorageHomePath; | ||
}; | ||
}; | ||
|
||
module Notification = { | ||
exception NotificationParseException(string); | ||
|
||
type t = { | ||
msgType: int, | ||
reqId: int, | ||
payload: Yojson.Safe.json, | ||
}; | ||
|
||
let of_yojson = (json: Yojson.Safe.json) => { | ||
switch (json) { | ||
| `Assoc([ | ||
("type", `Int(t)), | ||
("reqId", `Int(reqId)), | ||
("payload", payload), | ||
]) => { | ||
msgType: t, | ||
reqId, | ||
payload, | ||
} | ||
| _ => | ||
raise( | ||
NotificationParseException( | ||
"Unable to parse: " ++ Yojson.Safe.to_string(json), | ||
), | ||
) | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,8 @@ | |
(libraries | ||
yojson | ||
Oni_Core_Test | ||
Oni_Model_Test | ||
Oni_Extensions_Test | ||
Oni_Model_Test | ||
Oni_Neovim_Test | ||
)) | ||
|
||
|