Armitxes / VSCode_SQF

Visual Studio Code ~ SQF Language plugin
https://armitxes.net/Projects/VSCodeSQF/
Other
48 stars 29 forks source link

SQF Language Server Error #29

Closed bux closed 5 years ago

bux commented 5 years ago

VS Code about output

Version: 1.31.0 (system setup)
Commit: 7c66f58312b48ed8ca4e387ebd9ffe9605332caa
Date: 2019-02-05T22:35:56.624Z
Electron: 3.1.2
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Windows_NT x64 10.0.17134

An error shows up in the output windows after opening an sqf file.

  throw new ERR_INVALID_CALLBACK();
  ^

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
    at maybeCallback (fs.js:157:9)
    at Object.fs.writeFile (fs.js:1290:14)
    at c:\Users\bux\.vscode\extensions\armitxes.sqf-1.0.6\server\events.js:39:20
    at fs.js:753:9
    at FSReqWrap.oncomplete (fs.js:169:20)
[Info  - 10:30:21] Connection to server got closed. Server will restart.
[Error - 10:30:22] Notification handler 'workspace/didChangeConfiguration' failed with message: c:\Users\bux\.vscode\extensions\armitxes.sqf-1.0.6\syntaxes\sqf.min.json: Unexpected end of JSON input

image

After reloading the highlighting doesn't work anymore and I get the following new error message in the output window.

[Error - 10:33:51] Notification handler 'workspace/didChangeConfiguration' failed with message: c:\Users\bux\.vscode\extensions\armitxes.sqf-1.0.6\syntaxes\sqf.min.json: Unexpected end of JSON input

When inspecting the sqf.min.json it's just an empty 0kb file.

image

Tanin69 commented 5 years ago

Same problem for me. Have found any workaround, bux ?

Armitxes commented 5 years ago

Sorry for the late answer. Had to deal with 2 other projects.

This issue occurs since Visual Studio Code introduced a feature which this extension already had. Reloading itself once the config is changed. Had this solved for myself but I can't remember how :/ will try to reproduce and release a fix.

The issue also no longer occurs in milestone branch for fresh installs so the fix must be in there ^^ Give me a bit to test it out ;)

bux commented 5 years ago

image

https://github.com/Armitxes/VSCode_SQF/blob/master/server/events.js#L38

bux commented 5 years ago

^For reference ... how veteran and I fixed it on our side.

Armitxes commented 5 years ago

Yea that's still back from the time where we had absolutely no documentation for VS Code. It was pure learning by reverse engineering, trying things out ^^ and by looking into the extensions of Microsoft itself.

I remember that one of the big issues back then was that we had no possibility to properly change the provided highlighting based on custom settings.

Will fix it.

Armitxes commented 5 years ago

Fixed in development. https://github.com/Armitxes/VSCode_SQF/commit/5b5c991f28a81110479974b53ce0ae15f09559e8

Releasing it this weekend together with some new features.

Armitxes commented 5 years ago

Fixed and released :) Thanks for reporting