Skip to content
This repository was archived by the owner on Mar 7, 2018. It is now read-only.

rls support #12

Merged
merged 10 commits into from
Mar 2, 2017
Merged

rls support #12

merged 10 commits into from
Mar 2, 2017

Conversation

alexsaveliev
Copy link

addresses #11, I have tested the following LSP requests on https://github.com/RalfJung/rust-101:

  • hover
  • go to definition
  • find references

WIP

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
- Windows support
- Some logging
- Installation instructions (WIP)

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
- extracting data to display in "find references" panel. Reading files from FS and extracting Nth line using reference location spans. Caching files read and line offsets
- using symbol name as 'symbol display string' to avoid 'quickinfo' requests

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.

Verified

This commit was signed with the committer’s verified signature.
olback Edwin
# Conflicts:
#	README.md
- to unblock message receiving thread, decorating references (by adding `lineText` attribute) in a separate thread
- added support for `textDocument/hover` w/o range
- `initialize` request should pass path instead of URI as parameter
- errors handling in "find references"
- corrected parameters passed to `textDocument/references`
- thou should not rely on `view.match_selector` because there might be no such selector available (language is not registrered) or language name and aliases do not match extension
Conflicts:
	README.md
	typescript/commands/references.py
	typescript/libs/lsp_client.py
	typescript/libs/view_helpers.py
@alexsaveliev alexsaveliev requested a review from uforic January 26, 2017 20:02
@yodaldevoid
Copy link

What is the current status of getting this support merged in?

Copy link

@uforic uforic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

finally:
if f is not None:
f.close()
class RefsHelper:
Copy link

@uforic uforic Mar 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember we talked about this one before - either approach seems fine, I just worry about the performance implications of this approach.

__lines and __content will be maps that contain every file and every file -> line mapping for all references simultaneously, which seems like it could blow up memory usage.

That being said, it's easier to debug and reason about, so can understand that approach. And, it's just text.

Have you tried on an example with 100 reference files (some stdlib thing)?

@alexsaveliev alexsaveliev merged commit 64d7476 into sourcegraph:master Mar 2, 2017
@alexsaveliev alexsaveliev deleted the rls branch March 2, 2017 07:25
@alexsaveliev
Copy link
Author

I remember we talked about this one before - either approach seems fine, I just worry about the performance implications of this approach.

@uforic sorry for this, your commits addressing this were lost by mistake, I have restored them now.

@alexsaveliev alexsaveliev mentioned this pull request Mar 2, 2017
@sophiajt
Copy link

sophiajt commented Mar 5, 2017

Does anyone have a sec to explain how this works? I tried installing the latest checkout from git and I see this in the console when I try to open a rust file:

2017-03-06 10:26:35,711: 140737142133696: DEBUG: Looking for client for extension rs in /Users/jturner/Source/httparse
2017-03-06 10:26:35,712: 140737142133696: DEBUG: Extension rs is not supported yet

Are there additional steps I need to do for rls support?

@alexsaveliev
Copy link
Author

@jonathandturner please try to:

  • go to "preferences -> Sublime LSP connector -> plugin settings - user"
  • add there the following snippet:
{
    "clients": [
        {
            "binary": "/full/path/to/rls/binary",
            "file_exts": ["rs"]
        }
    ]
}
  • restart Sublime

@sophiajt
Copy link

sophiajt commented Mar 5, 2017

@alexsaveliev - great! I had to do a few workarounds to get it to work, but your tip helped me.

In case anyone was curious, I had to make a script:

#!/bin/sh
cargo run --release --manifest-path /Users/jturner/Source/rls/Cargo.toml

And then add this to my "preferences -> Sublime LSP connector -> plugin settings - user":

{
    "clients": [
        {
            "binary": "/Users/jturner/Source/rls/helper",
            "file_exts": ["rs"],
            "path_additions": ["/Users/jturner/.cargo/bin"]
        }
    ]
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants