HvyIndustries / crane

PHP Intellisense/code-completion for VS Code
https://hvy.io/crane
Other
240 stars 25 forks source link

Standalow usage? #375

Closed josecanciani closed 6 years ago

josecanciani commented 6 years ago

I would love to use your server for other projects like vim or sublime.

Is it possible to run it with stdio or tcp support? It would be nice if the project includes such a possibility out of the box. If not, can you point me out to a similar implementation I can use?

Thanks! Jose

josecanciani commented 6 years ago

https://github.com/tomv564/LSP/issues/259

nevadascout commented 6 years ago

Hi, thanks for your interest but currently Crane can only be from within VS Code.

I don't have any plans to change this in future, sorry!

josecanciani commented 6 years ago

But isn't the point of LSP to be a client/server thing so that any editor can work with it?

If you are interested, using Sublime's LSP plugin, tried with Crane the same way I did for for bmewburn/intelephense (see https://github.com/tomv564/LSP/issues/259#issuecomment-361000909 )

I got the server running and this is the debug I got:

LSP: starting ['node', '/home/joe/www/crane/server/src/server.js']
LSP:  --> initialize
[rsub] Server running on localhost:52698...
LSP:      {'capabilities': {'workspaceSymbolProvider': True, 'documentSymbolProvider': True, 'definitionProvider': True, 'textDocumentSync': 1, 'completionProvider': {'resolveProvider': True, 'triggerCharacters': ['.', ':', '$', '>', '\\']}}}
LSP:  --> initialized
LSP: phpls client registered for window 2
LSP:  --> textDocument/didOpen
Package Control: Skipping automatic upgrade, last run at 2018-01-27 13:54:38, next run at 2018-01-27 14:54:38 or after
LSP:  --> textDocument/didChange
LSP:  --> textDocument/didChange
LSP:  --> textDocument/didChange
LSP:  --> textDocument/completion
LSP: <--  serverDebugMessage
LSP:      {'type': 'errorTelemetry', 'message': 'Unable to find filenode for path /home/iats1/www/iats/code/module/customreport/builder/Function.php'}
LSP: Unhandled notification: serverDebugMessage
LSP: <--  serverDebugMessage
LSP:      {'type': 'errorTelemetry', 'message': "Cannot read property 'classes' of undefined :: STACK TRACE :: TypeError: Cannot read property 'classes' of undefined\n    at SuggestionBuilder.getScope (/home/joe/www/crane/server/src/suggestionBuilder.js:500:50)\n    at SuggestionBuilder.build (/home/joe/www/crane/server/src/suggestionBuilder.js:50:26)\n    at /home/joe/www/crane/server/src/server.js:80:38\n    at handleRequest (/home/joe/www/crane/server/node_modules/vscode-jsonrpc/lib/main.js:361:27)\n    at processMessageQueue (/home/joe/www/crane/server/node_modules/vscode-jsonrpc/lib/main.js:252:17)\n    at Immediate._onImmediate (/home/joe/www/crane/server/node_modules/vscode-jsonrpc/lib/main.js:242:13)\n    at runCallback (timers.js:756:18)\n    at tryOnImmediate (timers.js:717:5)\n    at processImmediate [as _immediateCallback] (timers.js:697:5)"}
LSP: Unhandled notification: serverDebugMessage
LSP: <--  serverDebugMessage
LSP:      {'type': 'error', 'message': "Completion error: Cannot read property 'classes' of undefined\nTypeError: Cannot read property 'classes' of undefined\n    at SuggestionBuilder.getScope (/home/joe/www/crane/server/src/suggestionBuilder.js:500:50)\n    at SuggestionBuilder.build (/home/joe/www/crane/server/src/suggestionBuilder.js:50:26)\n    at /home/joe/www/crane/server/src/server.js:80:38\n    at handleRequest (/home/joe/www/crane/server/node_modules/vscode-jsonrpc/lib/main.js:361:27)\n    at processMessageQueue (/home/joe/www/crane/server/node_modules/vscode-jsonrpc/lib/main.js:252:17)\n    at Immediate._onImmediate (/home/joe/www/crane/server/node_modules/vscode-jsonrpc/lib/main.js:242:13)\n    at runCallback (timers.js:756:18)\n    at tryOnImmediate (timers.js:717:5)\n    at processImmediate [as _immediateCallback] (timers.js:697:5)"}
LSP: Unhandled notification: serverDebugMessage
LSP:      None
Error handling server payload

Jose

nevadascout commented 6 years ago

You're right; that is the point, however I wasn't aware that the LSP was even a thing when I wrote this extension so both the client and server have interlinked ~cells~ dependencies on each other that would be painful to try to unpick.

josecanciani commented 6 years ago

Ok, no problem. Too bad, it's nice to have alternatives :) Just have it in mind when you are refactoring here and there, having the server to be standalone would not onlly make your user base bigger, but also simplify integration testing :) Jose