Fix VS Code extension (#467)

* chore: astro-languageserver => @astrojs/language-server

* chore: astro-vscode => vscode

* chore: move devDeps to deps

* chore: bump language-server to 0.5.0-next.0

* chore: remove astro-docs

* chore: update changelog

* fix: expose `astro-ls` bin

* fix: vscode extension

* chore: update changelog
This commit is contained in:
Nate Moore 2021-06-16 13:20:29 -05:00 committed by GitHub
parent 382868abfc
commit 0dd278810e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
54 changed files with 46 additions and 22 deletions

View file

@ -26,7 +26,7 @@ export default async function build(...args) {
const { type = 'module', dependencies = {} } = await fs.readFile('./package.json').then((res) => JSON.parse(res.toString()));
const format = type === 'module' ? 'esm' : 'cjs';
const external = [...Object.keys(dependencies), 'source-map-support', 'source-map-support/register.js', 'vscode'];
const external = [...Object.keys(dependencies), '@astrojs/language-server/bin/server.js', 'source-map-support', 'source-map-support/register.js', 'vscode'];
const outdir = 'dist';
await clean(outdir);

View file

@ -1,7 +0,0 @@
# astro-languageserver
## 0.4.0
### Minor Changes
- 06e2597: Adds support for import suggestions

View file

@ -0,0 +1,20 @@
# @astrojs/language-server
## 0.5.0
- Fix `bin` file
## 0.5.0-next.1
- Expose `bin/server.js` as `astro-ls`
## 0.5.0-next.0
- Moved to scoped `@astrojs/language-server` package
- Removed some `devDependencies` from the bundle and added them to `dependencies`
## 0.4.0
### Minor Changes
- 06e2597: Adds support for import suggestions

View file

@ -1,6 +1,7 @@
#! /usr/bin/env node
// @ts-ignore
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { startServer } = require('../dist/index');
const { startServer } = require('@astrojs/language-server/dist/index.js');
startServer();

View file

@ -1,22 +1,24 @@
{
"name": "astro-languageserver",
"version": "0.4.0",
"name": "@astrojs/language-server",
"version": "0.5.0",
"author": "Skypack",
"license": "MIT",
"type": "commonjs",
"main": "dist/index.js",
"types": "types/index.d.ts",
"bin": {
"astro-ls": "./bin/server.js"
},
"files": [
"dist",
"bin",
"types"
],
"scripts": {
"build": "astro-scripts build 'src/index.ts'",
"dev": "astro-scripts dev 'src/index.ts'"
},
"devDependencies": {
"astro": "^0.13.0",
"astro-scripts": "0.0.1",
"dependencies": {
"source-map": "^0.7.3",
"typescript": "^4.3.1-rc",
"vscode-css-languageservice": "^5.1.1",
@ -24,5 +26,9 @@
"vscode-html-languageservice": "^3.0.3",
"vscode-languageserver": "6.1.1",
"vscode-languageserver-textdocument": "^1.0.1"
},
"devDependencies": {
"astro": "^0.13.0",
"astro-scripts": "0.0.1"
}
}

View file

@ -1,5 +1,8 @@
# astro-vscode
## 0.5.0
- Bug fixes, dependency updates
## 0.4.3
### Patch Changes

View file

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View file

@ -8,11 +8,12 @@
"color": "#FFBE2D",
"theme": "dark"
},
"version": "0.4.3",
"version": "0.5.0",
"author": "Astro",
"license": "MIT",
"publisher": "astro-build",
"scripts": {
"vscode:prepublish": "yarn build",
"vscode:publish": "node ./scripts/publish.mjs",
"build": "astro-scripts build 'src/index.ts'",
"dev": "astro-scripts dev 'src/index.ts'"
@ -24,15 +25,15 @@
"onLanguage:astro"
],
"dependencies": {
"astro-languageserver": "^0.4.0"
"@astrojs/language-server": "0.5.0",
"vscode-emmet-helper": "2.1.2",
"vscode-html-languageservice": "^3.0.3",
"vscode-languageclient": "~7.0.0"
},
"devDependencies": {
"@types/vscode": "^1.52.0",
"astro-scripts": "file:../../scripts",
"execa": "^5.0.0",
"vscode-emmet-helper": "2.1.2",
"vscode-html-languageservice": "^3.0.3",
"vscode-languageclient": "~7.0.0"
"execa": "^5.0.0"
},
"main": "./dist/index.js",
"files": [

View file

@ -16,10 +16,10 @@ 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 = require.resolve('astro-languageserver/bin/server.js');
const serverModule = require.resolve('@astrojs/language-server/bin/server.js');
const debugOptions = { execArgv: ['--nolazy', '--inspect=' + port] };
const serverOptions: lsp.ServerOptions = {
run: { module: 'astro-languageserver', transport: lsp.TransportKind.ipc },
run: { module: serverModule, transport: lsp.TransportKind.ipc },
debug: {
module: serverModule,
transport: lsp.TransportKind.ipc,