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

LSP: Add autocomplete & hover functionality, and jump to target name #68

Closed
wants to merge 44 commits into from
Closed
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
490c847
feat: first implementation of auto-complete
MaartenStaa Mar 7, 2023
32dfb2d
feat: update existing load when inserting load from same module
MaartenStaa Mar 7, 2023
43ed7b1
chore: tidy up
MaartenStaa Mar 7, 2023
f248479
feat: de-duplicate already loaded symbols in auto-complete
MaartenStaa Mar 7, 2023
16872c9
feat: don't autocomplete variables from other methods
MaartenStaa Mar 7, 2023
fdbdd11
fix: handle windows file paths for inserted load statements
MaartenStaa Mar 7, 2023
b28e1e5
feat: show correct symbol kind when suggesting exported symbol from o…
MaartenStaa Mar 7, 2023
df738bd
fix: correctly set exported symbol kind in both assign and assign mod…
MaartenStaa May 1, 2023
372bdaa
feat: refactor find_symbols_at_location to its own module, including …
MaartenStaa May 1, 2023
60d1491
docs: add comment to show that `ResolvedSpan::contains` means 'entire…
MaartenStaa May 1, 2023
41b66ab
chore: remove commented out code
MaartenStaa May 1, 2023
086c0ba
feat: autocomplete keywords
MaartenStaa May 11, 2023
2370723
Merge remote-tracking branch 'origin/main' into add-autocomplete
MaartenStaa May 11, 2023
369325f
feat: add function to get symbols loaded in a module
MaartenStaa May 30, 2023
e3db1d6
feat: add autocomplete options from symbols loaded in open files
MaartenStaa May 30, 2023
a5694a5
feat: autocomplete global symbols
MaartenStaa May 31, 2023
6bb196c
feat: add `LspContext::render_as_load`
MaartenStaa Jun 1, 2023
cb0fc26
chore: remove old `format_as_load` in LSP and use the new function on…
MaartenStaa Jun 1, 2023
c6b6cc9
fix: correctly handle `render_as_load` and `resolve_load`, and add tests
MaartenStaa Jun 1, 2023
4246c32
fix: resolve load paths when discovering symbols loaded in other open…
MaartenStaa Jun 1, 2023
e518e90
fix: correctly determine workspace root from `LspUrl`
MaartenStaa Jun 1, 2023
78c2e9c
fix: support `resolve_load` for relative paths with subfolder
MaartenStaa Jun 5, 2023
f3af9e3
feat: retrieve info about the build system
MaartenStaa Jun 26, 2023
3d45a62
feat: use build system info to resolve load paths containing reposito…
MaartenStaa Jun 26, 2023
6933b9d
fix: when inserting first load statement, add line breaks after it
MaartenStaa Jun 26, 2023
d05fe29
feat: improve docs rendering and include older `detail`
MaartenStaa Jun 26, 2023
d5cd6c8
fix: make tests work again and clean up old comment
MaartenStaa Jun 26, 2023
47134b4
feat: allow creating `DocItem::Param` variant
MaartenStaa Jun 26, 2023
0778b88
feat: render docs for functions and arguments in the current file
MaartenStaa Jun 26, 2023
3fc4ae0
fix: improve handling of remote repositories during resolving and ren…
MaartenStaa Jun 27, 2023
7a1138b
Merge remote-tracking branch 'origin/main' into add-autocomplete
MaartenStaa Jun 27, 2023
14cb731
feat: jump to definition for labels in build files
MaartenStaa Jun 27, 2023
bacf4d0
chore: move doc item extraction from AST into its own file
MaartenStaa Jun 27, 2023
2a61284
feat: show documentation for completion options exported from open files
MaartenStaa Jun 27, 2023
88824f2
feat: implement rudimentary hover support
MaartenStaa Jun 27, 2023
78cd4a6
test: make tests pass again
MaartenStaa Jun 27, 2023
1415d9e
feat: provide argument names for exported function symbols
MaartenStaa Jun 30, 2023
8497455
feat: add module that inspects AST and decides type of autocomplete
MaartenStaa Jun 30, 2023
e598992
feat: provide more information from build systems
MaartenStaa Jun 30, 2023
fdaa22b
feat: implement hover for string literal & location, and go to string…
MaartenStaa Jun 30, 2023
7200b14
feat: ability to autocomplete all sorts of different things
MaartenStaa Jun 30, 2023
1d745b9
chore: allow parsing incomplete load statements
MaartenStaa Jun 30, 2023
1ec491a
Merge branch 'main' into add-autocomplete
ndmitchell Jul 3, 2023
384b9c1
fix: target for load insertion was incorrect
MaartenStaa Jul 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
531 changes: 509 additions & 22 deletions starlark/bin/eval.rs

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions starlark/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ use dupe::Dupe;
use eval::Context;
use itertools::Either;
use itertools::Itertools;
use starlark::build_system::BuildSystemHint;
use starlark::docs::get_registered_starlark_docs;
use starlark::docs::render_docs_as_code;
use starlark::docs::Doc;
Expand Down Expand Up @@ -102,6 +103,9 @@ struct Args {
)]
json: bool,

#[arg(long = "build-system", help = "Build system to use.")]
build_system: Option<BuildSystemHint>,

#[arg(
long = "docs",
help = "Generate documentation output.",
Expand Down Expand Up @@ -263,6 +267,7 @@ fn main() -> anyhow::Result<()> {
!args.evaluate.is_empty() || is_interactive,
&expand_dirs(ext, args.prelude).collect::<Vec<_>>(),
is_interactive,
args.build_system,
)?;

if args.lsp {
Expand Down
Loading