Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
octref committed Oct 29, 2020
1 parent fbca725 commit 3a61e2c
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ assignees: ''

<!-- Check those before opening an issue -->

- [ ] I have restart VSCode or restart Vue language server.
- [ ] I have searched through existing issues
- [ ] I have read through [docs](https://vuejs.github.io/vetur)
- [ ] I have read [FAQ](https://github.com/vuejs/vetur/blob/master/docs/FAQ.md)
Expand Down
4 changes: 3 additions & 1 deletion .github/PERF_ISSUE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Performance Issue Reporting

Performance issues are hard to track down, and a good report is necessary for fixing them.
Performance issues are hard to track down, and a good report is crucial for fixing them.

Although you can use the command `Vetur: Restart VLS (Vue Language Server)` to restart VLS and temporarily avoid performance issues, we would appreciate it if you can file a report to help us fix the issue.

In addition to the normal issues, please include a profile in performance-related issues and below information:

Expand Down
16 changes: 10 additions & 6 deletions client/vueMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export async function activate(context: vscode.ExtensionContext) {
.then(() => {
registerCustomClientNotificationHandlers(client);
registerCustomLSPCommands(context, client);
registerRestartServerCommand(context, client);
registerRestartVLSCommand(context, client);
})
.catch(e => {
console.log('Client initialization failed');
Expand All @@ -62,7 +62,7 @@ export async function activate(context: vscode.ExtensionContext) {
return displayInitProgress(promise);
}

async function displayInitProgress (promise: Promise<void>) {
async function displayInitProgress(promise: Promise<void>) {
return vscode.window.withProgress(
{
title: 'Vetur initialization',
Expand All @@ -72,11 +72,15 @@ async function displayInitProgress (promise: Promise<void>) {
);
}

function registerRestartServerCommand (context: vscode.ExtensionContext, client: LanguageClient) {
function registerRestartVLSCommand(context: vscode.ExtensionContext, client: LanguageClient) {
context.subscriptions.push(
vscode.commands.registerCommand(
'vetur.restartVLSServer',
() => displayInitProgress(client.stop().then(() => client.start()).then(() => client.onReady()))
vscode.commands.registerCommand('vetur.restartVLS', () =>
displayInitProgress(
client
.stop()
.then(() => client.start())
.then(() => client.onReady())
)
)
);
}
Expand Down
6 changes: 6 additions & 0 deletions docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,9 @@ Now you'll find `vetur-{version}.vsix`, you can install it by editor command "In

You can enable `Vetur: Use Workspace Dependencies` setting so that it uses the same version of TypeScript in your workspace.
NB: It will use `typescript.tsdk` setting as the path to look for if defined, defaulting to `node_modules/typescript`. This enables tools like Yarn PnP to set their own custom resolver.

## Vetur is slow

You can run the command `Vetur: Restart VLS (Vue Language Server)` to restart VLS.

However, we'd appreciate it if you can file a [performance issue report with a profile](https://github.com/vuejs/vetur/blob/master/.github/PERF_ISSUE.md) to help us fix the issue.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
"contributes": {
"commands": [
{
"command": "vetur.restartVLSServer",
"title": "Vetur: Restart vue language server"
"command": "vetur.restartVLS",
"title": "Vetur: Restart VLS (Vue Language Server)"
},
{
"command": "vetur.generateGrammar",
Expand Down

0 comments on commit 3a61e2c

Please sign in to comment.