jonnyboyC / kos-language-server

A language server for the Kerboscript (kOS) a language for Kerbal Space Program
MIT License
27 stars 6 forks source link

[BUG] VS Code does not let me write my code #70

Closed Gustavo-HR-Martinho closed 4 years ago

Gustavo-HR-Martinho commented 5 years ago

Describe the bug When trying to edit a new/old file in VS Code it keep opening the "Output" tab every time, so we can't write anything as always the "Output" tab is selected.

To Reproduce Steps to reproduce the behavior:

  1. Open/Create a new ".ks" file.
  2. Try to write some code or press backspace sometimes.
  3. OUTPUT TAB SHOWING UP.
  4. Try to close the tab and continue.
  5. Try to write again.
  6. OUTPUT TAB SHOWING UP

Expected behavior Just trying to write some code.

Editor:

jonnyboyC commented 5 years ago

Thanks for the submission! I'll have to take a look at this later this weekend. In the meantime, you can either roll back to 6.2 or you can set the follow settings

"kos-vscode.trace.server": "none" in your settings.json

jonnyboyC commented 5 years ago

Some quick testing, I see that a completely empty file will exhibit this behavior.

Are there other situations you've experienced? Do you have a file or a code snippet you could post here for me to test on?

Gustavo-HR-Martinho commented 5 years ago

Some quick testing, I see that a completely empty file will exhibit this behavior.

Are there other situations you've experienced? Do you have a file or a code snippet you could post here for me to test on?

Yep, testing right now it seems to only exhibit this behavior on a blanc file, but the first time i experienced this was in an non-blanc file.

Gustavo-HR-Martinho commented 5 years ago

I have a code with comments that have the same behavior... spot.txt

jonnyboyC commented 5 years ago

A new version 0.7.2 was just publish, feel free to reopen this issue if this update did not solve the issue.

scimas commented 5 years ago

I have a similar issue. Whenever some error happens in the language server, the Output panel opens and grabs focus. It's happening on

Notification handler 'textDocument/didChange' failed with message: Overlapping edit

for me. I don't mind that it's logging errors, only the focus grabbing part. This might be relevant https://github.com/microsoft/vscode/issues/31474#issuecomment-319032829

jonnyboyC commented 5 years ago

Thanks for the post! Essentially this occurs when I log an error to the console at the error log level. I've been trying to only do this when an exception in the language server occurs. Clearly I still am having to many exception throws for broader use.

Can you provide a specific case where this occurs? For now I can always just log at the warning level to avoid having the focus shift to console. Maybe open a separate issue with specific case you've found

scimas commented 5 years ago

I would open a new issue if I had proper reproduction steps. There is a vague method of reproducing, but it's not guaranteed to work.

  1. Make a bunch of changes to a file.
  2. Spam Undo (Ctrl + Z on windows): error might happen here
  3. Spam Redo (Ctrl + Y on windows): error might happen here

So it's not 100% that these will produce an error, but if it does, then it's reproducible. For example, let's say that an error happened on one of the Undos. Then doing a Redo and Undo again will cause the same error.

jonnyboyC commented 4 years ago

@scimas Is this still an issue, I haven't been able to reproduce the problem. Maybe it was addressed by one of the releases since this issue was filed?

scimas commented 4 years ago

@jonnyboyC The Output panel grabbing focus is not an issue anymore, but it does open. That is, if the Output panel is hidden, and an error is logged, the panel becomes visible. I was able to reproduce with the same steps. Make a bunch of legitimate changes to a .ks file and then spam undo. By legitimate I mean write or edit valid kerboscript code, random lines of text like

afhkahf
ariuqr.
wjwg.
poafkpakf

don't seem to trigger the error logging on undo spam.

The same

Notification handler 'textDocument/didChange' failed with message: Overlapping edit

error happens, usually on Undo spam, and the Output panel opens up.

jonnyboyC commented 4 years ago

Thanks for replying I was finally able to get he error message locally. I believe I have an idea what could be causing the problem. I'll post back here if I find a solution

jonnyboyC commented 4 years ago

I believe that this should be fixed now. I'll likely publish a new version of the extension sometime soon with the fixes included. Feel free to reopen this issue again if it doesn't appear fixed with 0.15.0 or 1.0.0 comes out. Not sure the numbering yet.