summaryrefslogtreecommitdiff
path: root/tools/astro-vscode
diff options
context:
space:
mode:
Diffstat (limited to 'tools/astro-vscode')
-rw-r--r--tools/astro-vscode/contributing.md20
-rw-r--r--tools/astro-vscode/src/index.ts4
2 files changed, 23 insertions, 1 deletions
diff --git a/tools/astro-vscode/contributing.md b/tools/astro-vscode/contributing.md
new file mode 100644
index 000000000..d9f1bd59e
--- /dev/null
+++ b/tools/astro-vscode/contributing.md
@@ -0,0 +1,20 @@
+# Contributing
+
+## Development workflow
+
+In the monorepo first install and build Astro:
+
+```shell
+yarn install
+yarn build
+```
+
+To start the development server run:
+
+```shell
+yarn dev:vscode
+```
+
+Then in the __Debug__ panel select __Launch Extension__ from the dropdown and click the run button.
+
+<img width="558" alt="Screen Shot 2021-05-07 at 8 51 37 AM" src="https://user-images.githubusercontent.com/361671/117452223-807e5580-af11-11eb-8404-dd615784408a.png">
diff --git a/tools/astro-vscode/src/index.ts b/tools/astro-vscode/src/index.ts
index 672a074d0..d48f2723c 100644
--- a/tools/astro-vscode/src/index.ts
+++ b/tools/astro-vscode/src/index.ts
@@ -17,7 +17,7 @@ export async function activate(context: vscode.ExtensionContext) {
/** */
function createLanguageService(context: vscode.ExtensionContext, mode: 'doc', id: string, name: string, port: number) {
const { workspace } = vscode;
- const serverModule = context.asAbsolutePath(require.resolve('astro-languageserver'));
+ const serverModule = require.resolve('astro-languageserver/bin/server.js');
const debugOptions = { execArgv: ['--nolazy', '--inspect=' + port] };
const serverOptions: lsp.ServerOptions = {
run: { module: 'astro-languageserver', transport: lsp.TransportKind.ipc },
@@ -60,6 +60,8 @@ function createLanguageService(context: vscode.ExtensionContext, mode: 'doc', id
};
const disposable = activateTagClosing(tagRequestor, { astro: true }, 'html.autoClosingTags');
context.subscriptions.push(disposable);
+ }).catch(err => {
+ console.error('Astro, unable to load language server.', err);
});
return client;