openfl / lime-vscode-extension

Visual Studio Code extension for OpenFL and Lime projects written in Haxe
https://marketplace.visualstudio.com/items?itemName=openfl.lime-vscode-extension
MIT License
27 stars 4 forks source link

Language server error #93

Closed tobil4sk closed 1 year ago

tobil4sk commented 1 year ago

Hi, I'm experiencing an issue with the language server. It usually happens for any lime/flixel project I open in VSCode, on Linux. Occasionally it starts working fine but then randomly stops working again, but I have no idea what causes it to randomly start working.

It is slightly similar to #35 but that seems to be caused by a different issue.

Firstly, I should mention that I don't experience these issues with the regular haxe extension.

Here are the exact details:

  1. I open up a lime/flixel project which compiles perfectly fine via the cli tools. For example, the template lime project. (lime create project)
  2. I get an error pop up saying:
    Unable to build cache - completion features may be slower than expected. Try fixing the error(s) and restarting the language server.
  3. If I try to build the project, it gets stuck at Executing task: lime test linux --connect 6000 and nothing happens. Completion dosen't work either.
  4. If I click retry, or if I manually restart the lanugage server, the pop up appears again.
  5. If I click Show Error, it shows me the haxe output:
    
    Haxe language server started
    Haxe Path: haxe
    Using --server-connect
    Haxe connected!
    Listening on port 6000
    Failed - try fixing the error(s) and restarting the language server:

Failure("Couldn't connect on 127.0.0.1:6000") Client connected

and in verbose mode:

Haxe language server started Haxe Path: haxe Using --server-connect Haxe connected! Processing Arguments [--display,{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"supportsResolve":true,"exclude":["zpp_nape"],"maxCompletionItems":1000}}] 0, x: Cached 0 modules Completion Response = {"jsonrpc":"2.0","id":0,"result":{"result":{"methods":["display/definition","server/contexts","server/moduleCreated","server/invalidate","server/module","server/files","initialize","display/completion","typer/compiledTypes","display/references","server/modules","server/memory/context","display/completionItem/resolve","display/typeDefinition","server/memory","display/implementation","display/hover","display/package","display/signatureHelp","server/type","server/memory/module","server/readClassPaths","server/configure"],"haxeVersion":{"major":4,"minor":3,"patch":0,"pre":"rc.1","build":null},"protocolVersion":{"major":0,"minor":5,"patch":0}},"timestamp":1664644875.022806}} Stats = 0 files, 0 classes, 0 methods, 0 macros Time spent : 0.000s Processing Arguments [--display,{"jsonrpc":"2.0","id":1,"method":"server/configure","params":{"noModuleChecks":true,"print":{"completion":false,"reusing":false},"legacyCompletion":false}}] 0, x: Cached 0 modules Stats = 0 files, 0 classes, 0 methods, 0 macros Time spent : 0.000s Listening on port 6000 Processing Arguments [--no-output,--each,--no-output,-main,ApplicationMain,--macro,lime._internal.macros.DefineMacro.run(),-cp,/path/to/project/.haxelib/lime/8,0,0/src,-D,lime=8.0.0,-cp,Source,-D,tools=8.0.0,-D,lime-canvas,-D,howlerjs,-D,no-compilation,-D,disable_preloader_assets=1,-D,lime-webgl,-D,lime-dom,-D,lime-howlerjs,-D,lime-html5,-D,html5,-D,web,--connect,6000,-js,Export/html5/bin/Test.js,-cp,Export/html5/haxe,-D,html5,-D,html,--cwd,/path/to/project] Uncaught Error : Failure("Couldn't connect on 127.0.0.1:6000") Failed - try fixing the error(s) and restarting the language server:

Failure("Couldn't connect on 127.0.0.1:6000") Processing Arguments [--cwd,/path/to/project,-D,display-details,--no-output,-main,ApplicationMain,--macro,lime._internal.macros.DefineMacro.run(),-cp,/path/to/project/.haxelib/lime/8,0,0/src,-D,lime=8.0.0,-cp,Source,-D,tools=8.0.0,-D,lime-canvas,-D,howlerjs,-D,no-compilation,-D,disable_preloader_assets=1,-D,lime-webgl,-D,lime-dom,-D,lime-howlerjs,-D,lime-html5,-D,html5,-D,web,--connect,6000,-js,Export/html5/bin/Test.js,-cp,Export/html5/haxe,-D,html5,-D,html,--cwd,/path/to/project,--display,/path/to/project/Source/Main.hx@0@diagnostics] Client connected



A new `Client connected` message is added everytime I try to build, but nothing else. Running `lime test linux --connect 6000` or even `haxe --connect 6000` in the terminal also hangs. But there is never a `Client disconnected` message.

Also, it's not like there's nothing on the port, the port is in use by vscode: `TCP 127.0.0.1:6000 (LISTEN)`

Also, there are no errors in the vscode developer console.
tobil4sk commented 1 year ago

This is due to haxe nightly not being able to handle duplicate --connect 6000 flags. So not an issue with this extension luckily 😄.

See https://github.com/HaxeFoundation/haxe/issues/10813