Skip to content

Commit

Permalink
support Electron runtime (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
rchl authored Mar 28, 2023
1 parent 831e355 commit 7d53fe2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion LSP-graphql.sublime-settings
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"command": ["${node_bin}", "${server_path}", "server", "--method", "stream"],
"command": ["${node_bin}", "${server_path}"],
"auto_complete_selector": "- comment",
"initializationOptions": {},
"settings": {},
Expand Down
14 changes: 14 additions & 0 deletions language-server/start-server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const graphql_language_service_server_1 = require("graphql-language-service-server");
process.on('uncaughtException', error => {
process.stderr.write('An error was thrown from GraphQL language service: ' + String(error));
});
try {
(0, graphql_language_service_server_1.startServer)({ method: 'stream' });
}
catch (error) {
const logger = new graphql_language_service_server_1.Logger();
logger.error(String(error));
}
process.stdin.on('close', () => {
process.exit(0);
});
4 changes: 1 addition & 3 deletions plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@ def plugin_unloaded() -> None:
class LspGraphqlPlugin(NpmClientHandler):
package_name = __package__
server_directory = 'language-server'
server_binary_path = os.path.join(
server_directory, 'node_modules', 'graphql-language-service-cli', 'bin', 'graphql.js'
)
server_binary_path = os.path.join(server_directory, 'start-server.js')

0 comments on commit 7d53fe2

Please sign in to comment.