Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve Deno Language Server #187

Closed
axetroy opened this issue Sep 7, 2020 · 4 comments
Closed

improve Deno Language Server #187

axetroy opened this issue Sep 7, 2020 · 4 comments

Comments

@axetroy
Copy link
Contributor

axetroy commented Sep 7, 2020

The current Deno Language Server seems to work very well, but it has many improvements

1. Deno Language Server always starts running even deno.enable = false

this.watchConfiguration(() => {
this.sync(window.activeTextEditor?.document);
});
await this.StartDenoLanguageServer();
const treeView = new TreeViewProvider(this);

even if it is not a Deno project, the Deno Language Server is started.

When deno.enable is changed, the LSP should be enabled/disabled

2. deno formatting is always enabled even deno.enable = false

ref: #101

3. Deno Language Server is a singleton even multiple workspaces have been opened

This will cause many problems, such as different workspaces and different environment variables. I think multiple LSP instances can solve these problems.

One LSP instance serves only one workspace.

This greatly simplifies the code and mental burden.

We don’t worry about what happens when an instance serves multiple workspaces

example: https://github.com/microsoft/vscode-extension-samples/tree/master/lsp-multi-server-sample

NOTE: Multiple instances will increase memory consumption, Average 50-70M per instance

@David-Else
Copy link

Regarding point 2, I don't think Deno formats your code unless you tell it to?!

  "[typescript]": {
    "editor.defaultFormatter": "denoland.vscode-deno"

If you tied the formatter to deno.enable then it would not work on non-deno code, which would be a disaster. I assume it is meant to work for all JS/TS?

@kyeotic
Copy link

kyeotic commented Sep 8, 2020

@David-Else That is not the case, the deno formatter will run even without that configuration. It will run in JS files even if you have

"[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },

@David-Else
Copy link

@kyeotic Well, that is not good! I thought that bug had gone.

I just want to make sure that we can always run the formatter without the language server running with"editor.defaultFormatter": "denoland.vscode-deno". Hopefull Markdown with code blocks will be supported soon too denoland/deno#7352

@lucacasonato lucacasonato mentioned this issue Sep 8, 2020
10 tasks
@kitsonk
Copy link
Contributor

kitsonk commented Apr 6, 2021

This is now stale, closing.

@kitsonk kitsonk closed this as completed Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants