forked from brackets-userland/brackets-electron
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a pref shell.type to use node process instead of websocket (#357)
LSP with the shell.type=process does not work at the moment. Fix #54
- Loading branch information
Showing
10 changed files
with
869 additions
and
21 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,25 @@ | ||
import DomainManager from "./domain-manager"; | ||
|
||
function init(domainManager: typeof DomainManager): void { | ||
domainManager.registerDomain("base", {major: 0, minor: 1}); | ||
|
||
domainManager.registerCommand( | ||
"base", | ||
"loadDomainModulesFromPaths", | ||
(paths: Array<string>): boolean => { | ||
return domainManager.loadDomainModulesFromPaths(paths); | ||
}, | ||
false, | ||
"Attempt to load command modules from the given paths. The paths should be absolute.", | ||
[{name: "paths", type: "array<string>"}], | ||
[{name: "success", type: "boolean"}] | ||
); | ||
|
||
domainManager.registerEvent( | ||
"base", | ||
"newDomains", | ||
[] | ||
); | ||
} | ||
|
||
exports.init = init; |
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,21 @@ | ||
import { log } from "./logging"; | ||
import DomainManager from "./domain-manager"; | ||
|
||
// load the base domain | ||
DomainManager.loadDomainModulesFromPaths(["./BaseDomain"], false); | ||
|
||
process.on("message", async function (obj: any) { | ||
const _type: string = obj.type; | ||
switch (_type) { | ||
case "message": | ||
DomainManager._receive(obj.message); | ||
break; | ||
default: | ||
log.warn(`no handler for ${_type}`); | ||
} | ||
}); | ||
|
||
process.on("uncaughtException", (err: Error) => { | ||
log.error(`uncaughtException: ${err.stack}`); | ||
process.exit(1); | ||
}); |
Oops, something went wrong.