scry icon indicating copy to clipboard operation
scry copied to clipboard

Lack of documentation on the scry setup

Open faustinoaq opened this issue 6 years ago • 9 comments

Hi @crystal-lang-tools/scry community!

This project is getting better everyday. I think is cool but some newcomers are getting confused on how to use scry. This is mainly because the lack of documentation on LSP clients configuration:

I propose to write some wiki articles about configuring scry to run on:

:warning: Work In Progress, see the wiki: https://github.com/crystal-lang-tools/scry/wiki/Clients

faustinoaq avatar Mar 07 '18 13:03 faustinoaq

If you have tested scry successfully in some editor , please feel free to contribute to scry wiki :+1:

faustinoaq avatar Mar 07 '18 14:03 faustinoaq

Use with Atom is as simple as installing the ide-crystal package and a consumer package. This can be done using either the Settings GUI, or on the command line with apm install ide-crystal. For the consumer I recommend atom-ide-ui. Facebook's Nuclide and steelbrain's linter (only providers diagnostics, not full IDE functionality) are also viable options for consumers.

keplersj avatar Mar 07 '18 23:03 keplersj

I'm kind of a newcomer again, so maybe I can find some time to re-set things up and I can write some articles from a kind-of newcomer perspective.

kofno avatar Mar 08 '18 12:03 kofno

@faustinoaq I see how @keplersj installs scry through his atom package, would something similar be possible for vscode-crystal-lang?

bmulvihill avatar Mar 08 '18 18:03 bmulvihill

@bmulvihill In fact I used to embed scry in vscode-crystal-lang. I removed it because some time ago scry was some unsable, bigger and slower :sweat_smile:

Currently scry is pretty stable, lightweight and fast, so, maybe I can try to add it again :smile:

https://github.com/crystal-lang-tools/vscode-crystal-lang/blob/229f2e2e3910724e60dc76f3f4fce6ddd652eff0/src/crystalMain.ts#L31-L48

Feel free to open a PR :wink:

CHANGELOG entry

faustinoaq avatar Mar 09 '18 01:03 faustinoaq

I removed embedded scry here: https://github.com/crystal-lang-tools/vscode-crystal-lang/blob/master/CHANGELOG.md#change-8

BTW, I used 7zip because I was trying to ship scry as small as possible. Seems that isn't a problem now :100:

faustinoaq avatar Mar 09 '18 01:03 faustinoaq

@faustinoaq Scry is already available in emacs(lsp-crystal.el). wechatimg47

However, scry has some problems when dealing with didSave.

{"code":-32001,"message":"Couldn't parse (Scry::NotificationMessage | Scry::RequestMessage) from {"jsonrpc":"2.0","method":"textDocument/didSave","params":{"textDocument":{"uri":"file:///home/parallels/program/github/scry/src/scry/log.cr","version":30},"includeText":""}} at 1:1","data":["???","(Scry::NotificationMessage | Scry::RequestMessage)","Scry::Message#parse:(Scry::NotificationMessage | Scry::RequestMessage)","Scry::start:(IO+ | Nil)","__crystal_main","_crystal_main<Int32, Pointer(Pointer(UInt8))>:Nil","Crystal::main_user_code<Int32, Pointer(Pointer(UInt8))>:Nil","Crystal::main<Int32, Pointer(Pointer(UInt8))>:Int32","main","__libc_start_main","_start","???"]}

I made a local change and fixed the above problem.

struct TextDocumentParams
    JSON.mapping({
      text_document: {type: (TextDocumentIdentifier | VersionedTextDocumentIdentifier), key: "textDocument"},
      text:          String?,
      include_text:  {type: Bool, nilable: true, key: "includeText"},  # Add includeText fix didSave bug
    }, true)
  end

brantou avatar Mar 09 '18 08:03 brantou

Besides the setup, the documentation is lacking an explanation about the actual features of Scry. I read the wiki, I still don't know what are the actual features implemented.

KaneRoot avatar Jul 21 '19 11:07 KaneRoot

Hi guys, any hint about nvim setup? It's taking hours and I still can't figure it out. Can anyone provide an init.vim / .vimrc example of the setup function for the lsp?

omerxx avatar Sep 25 '20 13:09 omerxx