Skip to content

Commit

Permalink
Make field declarations a source for completion identifiers
Browse files Browse the repository at this point in the history
This only returns field identifiers which are in the current scope.
If a field declaration is in scope, it means that we have access to
it and we should include it as a possible completion identiifer.
  • Loading branch information
ebresafegaga committed Feb 1, 2023
1 parent b930544 commit 3c60ef1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lsp/nls/src/requests/completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,8 @@ fn get_completion_identifiers(
.get_in_scope(item, &server.lin_cache)
.iter()
.filter_map(|i| match i.kind {
TermKind::Declaration(ident, _, _) => Some(IdentWithType {
TermKind::Declaration(ident, _, _)
| TermKind::RecordField { ident, .. } => Some(IdentWithType {
ident,
item: Some(item.clone()),
ty: ty.clone(),
Expand Down

0 comments on commit 3c60ef1

Please sign in to comment.