-
Notifications
You must be signed in to change notification settings - Fork 107
feat(completions): add textDocument/completion request to LSP + workspace handlers
#164
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
feat(completions): add textDocument/completion request to LSP + workspace handlers
#164
Conversation
psteinroe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few nits, overall lgtm!
|
@psteinroe Update: Replacing the VsCode Extension's If you look at the output, you can see that the returned "JSON" matches our I guess
|
|
@juleswritescode the cli (and the lsp proxy) writes the output also to a logfile. I am not sure it's the same logs as the lsp client but it helps me debugging a lot. You can find the path to the directory in the pg_fs crate. I also have a script that automatically opens the latest log file (rotated every day, new logfile every hour) and subscribes to it. I can send it over later. |
psteinroe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome!! left a few comments :)
Nice! That's useful. I'm still using the Still, please send over the script 🙌 |
e291189 to
4fb71a5
Compare
|
@psteinroe I cleaned up the PR, wrote a description and it should now be reviewable 👍 |
4fb71a5 to
3f7c386
Compare
3f7c386 to
528b78b
Compare
Do not forget to update the username (psteinroe)! # Open latest logfile for the lsp
function open_lsp_log() {
latest_file=$(ls -t /Users/psteinroe/Library/Caches/dev.supabase-community.pglsp/pglsp-logs | head -n 1)
if [ -n "$latest_file" ]; then
tail -f "/Users/psteinroe/Library/Caches/dev.supabase-community.pglsp/pglsp-logs/$latest_file"
else
echo 'No log files found'
fi
} |


This PR adds the
textDocument/completioncapability to the lsp server 🎉ServerCapabilitiesprintlnstatements from theworkspace, since they were writing tostdoutand thus led to crashes for the lsp-clienttracingmacros to the lsp server handlers, changed log levels to "info" for methods that happen infrequently (shutdown, initialize etc.)vscode-languageclientto9.0.1, which made for better log outputThe autocompletions aren't stable right now – completions are sometimes gathered for the wrong statement, and sometimes, the corresponding statement isn't even found. I will fix this in a separate PR 👍
Besides, I wasn't able to start the
pg_cli lsp-proxywith the VSCode extension. I'll fix this in a separate PR, too.