tokoro10g / matlab-langserver

Language Server using MATLAB Engine
13 stars 1 forks source link

Cannot use with lsp-mode on Emacs #9

Closed tokoro10g closed 4 years ago

tokoro10g commented 4 years ago

Reported by @karthink :

It seems to be running fine:

matlab-langserver> java -Djava.library.path=$MATLABROOT/bin/glnxa64 -cp $MATLABROOT/extern/engines/java/jar/engine.jar:$MATLABROOT/java/jar/jmi.jar:./build/libs/lsp-matlab-0.1.jar org.tokor.lspmatlab.Application
2019-11-27 11:47:58.961 [main] INFO  org.tokor.lspmatlab.Application {} - Starting server
2019-11-27 11:47:59.250 [main] INFO  org.tokor.lspmatlab.MATLABEngineSingleton {} - Could not find existing sessions. Starting MATLAB Engine...

and I connected to it from emacs lsp-mode by putting the above java command in a shell script and registering the script with lsp-mode. When I edit m files it starts up and connects to the language server just fine, but the server doesn't seem to be doing anything, i.e. not providing any documentation, help or autocompletion.

I understand that setting up the editing environment is out of the scope of this discussion. However, I was wondering if there's some way to check if the server is working as intended, by feeding it some test json data or something else. That way I can narrow the problem down to Emacs.

Source: https://github.com/tokoro10g/matlab-langserver/issues/8#issuecomment-559231243

I generated a log of inputs to the server in emacs. Here is some sample output from *lsp-log*

[Trace - 12:41:59 PM] Sending request 'textDocument/signatureHelp - (14)'.
Params: {
  "textDocument": {
    "uri": "file:///home/user/Documents/freq_resp_with_damping.m"
  },
  "position": {
    "line": 33,
    "character": 16
  }
}

[Trace - 12:41:59 PM] Received response 'textDocument/signatureHelp - (14)' in 10ms.
Result: null

[Trace - 12:42:07 PM] Sending request 'textDocument/signatureHelp - (15)'.
Params: {
  "textDocument": {
    "uri": "file:///home/user/Documents/freq_resp_with_damping.m"
  },
  "position": {
    "line": 60,
    "character": 27
  }
}

[Trace - 12:42:07 PM] Received response 'textDocument/signatureHelp - (15)' in 10ms.
Result: null

Should I take this to mean the server is not functioning as intended?

Source: https://github.com/tokoro10g/matlab-langserver/issues/8#issuecomment-559247740

tokoro10g commented 4 years ago

@karthink Could not reproduce this, and it worked fine for me.

I used lsp-mode and company-mode for auto completion. This file is used for the test. init.el is here.

scrot_20200108_06:16:59_PM scrot_20200108_06:17:07_PM

The log should look like this: https://gist.github.com/tokoro10g/a8cddc559e6d9d585ebd5ae13a122d11 Are there anything missing in your log?

tokoro10g commented 4 years ago

Close this for now as there is no activity.