Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make IntelliSense work in unsaved files #34

Open
garyking opened this issue Mar 19, 2018 · 4 comments
Open

Make IntelliSense work in unsaved files #34

garyking opened this issue Mar 19, 2018 · 4 comments

Comments

@garyking
Copy link

Right now, SolarGraph only works in unsaved files. But I'd like it if it also worked in unsaved files.

I've attached two GIFs if necessary.

Unsaved file, where extension doesn't work:

ruby - unsaved file

Saved file, where extension works:

ruby - saved file

@castwide
Copy link
Owner

Solargraph usually works on untitled files as long as it knows the language mode, e.g., if you set it to Ruby with the Change Language Mode command. There's at least one edge case where it can fail: starting an untitled file before any other Ruby file has been opened, i.e., before the Solargraph extension has been activated. That can cause the Solargraph server to hit an error when it tries to map the file. I should be able to adjust the server to handle that scenario. (It might already be a non-issue in the version that uses the language server protocol.)

@garyking
Copy link
Author

garyking commented Mar 20, 2018

Yes, I played around with SolarGraph a bit earlier, and here's what I recall:

Open a new VSC window. Open a new file (don't save it). Set language to Ruby (of course, I always did this when testing SolarGraph). IntelliSense doesn't work here.

However if I open a saved Ruby file first, then open a new document, then IntelliSense works fine there. Although for some reason, it still sometimes fails to work here.

This isn't an edge case in my opinion. I definitely frequently open a new window in VSC, then open a new document and hack away at some Ruby code.

Any rough ETA on the language server protocol version, if you don't mind?

@castwide
Copy link
Owner

Thanks for the information. I'll work on this bug for an upcoming release.

I hope to release the LSP version by the end of this month, or possibly the first week of April.

@castwide
Copy link
Owner

castwide commented Apr 5, 2018

There appears to be a limitation (or a bug) in either VSCode or the language client that prevents them from updating the language server when you change an unsaved file's language mode. I'll keep looking for a workaround.

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

No branches or pull requests

2 participants