Skip to content

Commit

Permalink
Add windows support
Browse files Browse the repository at this point in the history
Closes #4
  • Loading branch information
amiralies committed Sep 16, 2019
1 parent eba3c59 commit e0a0279
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// @flow

import { LanguageClient, services, ExtensionContext, workspace } from 'coc.nvim';
import os from 'os';

export function activate(context: ExtensionContext) {
const config = workspace.getConfiguration().get('elixir', {});
Expand All @@ -15,7 +16,8 @@ export function activate(context: ExtensionContext) {
return pathToElixirLS;
}

return context.asAbsolutePath('./els-release/language_server.sh');
const lsFileExtension = os.platform() === 'win32' ? 'bat' : 'sh';
return context.asAbsolutePath(`./els-release/language_server.${lsFileExtension}`);
};

const command = getElsPath();
Expand Down

0 comments on commit e0a0279

Please sign in to comment.