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

Start java process lazy / if necessary #4

Closed
hirschsn opened this issue Sep 3, 2019 · 4 comments
Closed

Start java process lazy / if necessary #4

hirschsn opened this issue Sep 3, 2019 · 4 comments
Assignees
Labels
1-bug 🐛 Issue type: Bug report (something isn't working as expected) 2-confirmed Issue status: Confirmed, reproducible bug in LTeX 3-fixed Issue resolution: Issue has been fixed on the develop branch

Comments

@hirschsn
Copy link

hirschsn commented Sep 3, 2019

Every new vscode window starts a java process, even if the window is empty or the project does not contain any latex files.

Optimal behaviour: Java-Process starts not until a latex file is opened.

@valentjn
Copy link
Owner

valentjn commented Sep 3, 2019

I think the fact that a new LS is opened for every VS Code window is by design, as it's supposed to work in a multi-user, multi-window (other workspaces can have different extension settings), and multi-editor (other editors can connect to the LS, too) environment. So this would be an upstream issue of the LSP specs or VS Code.

It should, however, not be necessary to have a server if there's no LaTeX file (or none of the supported file types) currently opened. The activationEvents in package.json control when the whole extension is activated. If I open a new VS Code window with a workspace where only a file of some unrelated type (MATLAB) is opened, the extension is still activated. I see this in Output -> Log (Extension Host):

ExtensionService#_doActivateExtension valentjn.vscode-ltex {"startup":false,"activationEvent":"onLanguage:plaintext"}

If I remove onLanguage:plaintext from the activationEvents, the extension is not loaded (you can test it too in .vscode/extensions/.../package.json). So this seems like a bug in VS Code to me.

@valentjn
Copy link
Owner

valentjn commented Sep 3, 2019

See upstream issue for more info: microsoft/vscode#80268

@valentjn valentjn added 1-bug 🐛 Issue type: Bug report (something isn't working as expected) 2-upstream Issue status: Bug is caused by some dependency, might have to wait before continuing labels Sep 7, 2019
@valentjn
Copy link
Owner

valentjn commented Sep 9, 2019

Bug has been confirmed upstream. Seems plaintext is used as a fallback if the language mode cannot be detected.

@valentjn
Copy link
Owner

valentjn commented Sep 9, 2019

Now that I think about it... Most people don't want to check plaintext documents anyway, as an untitled plaintext file can just be some copy/pasted code, data, etc. I could imagine there would be lots of errors for these types of files.

plaintext doesn't necessarily mean "text in some natural language that can be spellchecked," but rather "file with arbitrary text (= not a binary file) that can't be classified as a specific known file type."

So we'll just remove the onLanguage:plaintext activation event. People will still be able to check text files if they switch the language to markdown.

@valentjn valentjn added 3-fixed Issue resolution: Issue has been fixed on the develop branch and removed 2-upstream Issue status: Bug is caused by some dependency, might have to wait before continuing labels Sep 9, 2019
@valentjn valentjn added the 2-confirmed Issue status: Confirmed, reproducible bug in LTeX label Sep 24, 2019
@valentjn valentjn self-assigned this Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-bug 🐛 Issue type: Bug report (something isn't working as expected) 2-confirmed Issue status: Confirmed, reproducible bug in LTeX 3-fixed Issue resolution: Issue has been fixed on the develop branch
Projects
None yet
Development

No branches or pull requests

2 participants