coala-vs-code icon indicating copy to clipboard operation
coala-vs-code copied to clipboard

Provide clear step by step instructions on how to use this.

Open guanzo opened this issue 6 years ago • 6 comments

I downloaded this plugin from the vscode marketplace, expecting it to "just work", sadly this isn't the case. I'm quite new to coala so please excuse any ignorance.

My project folder has a .coafile and I have installed all the "bears". I'm able to run coala on the cmd line and see the syntax errors. Now I want to use this plugin to show syntax errors directly in vscode.

What I've tried by following the README directions:

  • git clone https://github.com/coala/coala-vs-code
  • my workspace directory now looks like
    • workspace/
      • coala-vs-code
      • myProject
  • cd coala-vs-code
  • Run pip3 install -r requirements.txt.
  • Run python3 langserver-python.py --mode=tcp --addr=2087
    • This fails because can't open file 'langserver-python.py': [Errno 2] No such file or directory
    • I see a file called coala-langserver.py, so I try using that instead of langserver-python.py
    • Run python3 coala-langserver.py --mode=tcp --addr=2087
    • I now see Accepting TCP connections on 0.0.0.0:2087
  • I edit the activate function in coala-vs-code/vs-client/src/extension.ts
  • I open coala-vs-code/vscode-client in vscode.
  • I turn to debug view and launch the extension
  • I see a vscode error: "Build errors have been detected during preLaunchTask 'npm'. extension.ts is trying to import modules. It looks like i need to run npm install. So i do that.
  • I turn to debug view and launch the extension. I get the same error, except the message is now

Argument of type '{ reader: Socket; writer: Socket; }' is not assignable to parameter of type 'ChildProcess | StreamInfo | PromiseLike<ChildProcess | StreamInfo>'. Type '{ reader: Socket; writer: Socket; }' is not assignable to type 'PromiseLike<ChildProcess | StreamInfo>'. Property 'then' is missing in type '{ reader: Socket; writer: Socket; }'.

  • I click "Debug anyway". A new vscode window opens, I navigate to my project folder workspace/myProject.
  • A vscode error notification pops up and says

Activating extension 'coala.coala' failed: Cannot find module '/Users/guanzo/workspace/coala-vs-code/vscode-client/out/src/extension'.

This is what happens when i follow the directions in the README. Please help, what am I doing wrong? I just want red underlines under python syntax errors in my project.

guanzo avatar May 04 '18 22:05 guanzo

Sorry for the documentation. @ksdme is working on his GSoC project: coala Language Server, and we will maintain the documentation well soon.

As for your case, I will take a look ASAP.

gaocegege avatar May 05 '18 03:05 gaocegege

Hi @guanzo

Maybe you could run npm run vscode:prepublish to copy all files to ./out. Then it should work.

gaocegege avatar May 05 '18 04:05 gaocegege

I ran the command. Now, whenever I open a file in my project, i can see the file contents appear in the terminal where i ran python3 coala-langserver.py --mode=tcp --addr=2087, so that's progress. Still no syntax error underlines in vscode though.

It seems that this npm script is failing:

"compile": "python ../setup.py install && node ./node_modules/vscode/bin/compile -watch -p ./"

There's no setup.py file anywhere.

guanzo avatar May 05 '18 06:05 guanzo

Currently, the issues are only reported when a file save occurs. Try making a small change to the file, reverting it and then saving it, this will force a save, which is not always guaranteed by simply pressing Ctrl+S.

ksdme avatar May 05 '18 08:05 ksdme

And a minor observation, If you intend to run coala-vs-code plugin as a client to a standalone TCP server as you doing now, always open your project as a directory i.e using Ctrl+K Ctrl+O otherwise coala will use coala-vs-code's .coafile instead of your config and thereby fail to report.

ksdme avatar May 05 '18 08:05 ksdme

@ksdme I'm not purposefully intending to

run coala-vs-code plugin as a client to a standalone TCP server

I just don't know any better and am following the README instructions. Is there an easier way to get this working?

guanzo avatar May 05 '18 20:05 guanzo