facebook / starlark-rust

A Rust implementation of the Starlark language
Apache License 2.0
673 stars 53 forks source link

Add string autocomplete & Bazel mode #82

Closed MaartenStaa closed 10 months ago

MaartenStaa commented 11 months ago
ndmitchell commented 11 months ago

Seems we have a conflict with something - not obvious how to resolve quickly, so can you rebase on master?

MaartenStaa commented 11 months ago

@ndmitchell Sure, rebased and force-pushed.

facebook-github-bot commented 11 months ago

@ndmitchell has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

stagnation commented 11 months ago

Trying it out quickly in neovim, go-to-defintion mostly works like expected :tada:, with just a few weird cases where it jumps to the top of the file. Completion seems to work fine, have too many completion sources of stuff to check that it always predicts what should be there. But the end result is good :)

Edit: I assume my error is https://github.com/facebookexperimental/starlark-rust/issues/90

ndmitchell commented 10 months ago

One minor tweak I had to make - StringCompletionResult avoid capturing the &str literal - a clone there doesn't make any real perf difference and it made the implementation of some other LSP traits in Buck2 harder.

facebook-github-bot commented 10 months ago

@ndmitchell merged this pull request in facebookexperimental/starlark-rust@cd0a8fe283ca9a1eec982488da42ed6c0ad8bc8e.

stagnation commented 10 months ago

Again thank you! I just now saw that it auto-loads providers when they are selected from autocompletion :)