Skip to content

Conversation

@gerau
Copy link
Collaborator

@gerau gerau commented Nov 10, 2025

add completion for type casting in the form of a snippet. Right now TypeCast completion is inside FunctionTemplate, which is technically not wrong, but it introduces some complications (like an if statement in the conversion from FunctionTemplate to CompletionItem inside completion/mod.rs). also moved the TypeCast documentation into a separate function to avoid the clippy complaint about too many lines.

add a References feature for functions, which works on a function definition and highlights all calls of that function. It's not highlighting the definition itself, though some language servers do that, so we could implement this too.

add completion for built-in function `<type>::into(input)`
also refactor `completion::types::FunctionTemplate`, removed redundant
field `snippet_base` and add new field `snippet`.
using completion with function kind makes unpleasant overlap with word
`into` and it structure `<Input>::into(input)`, so we used snippet
completion kind for clean visual effect.
Include in description either it built-in or jet before function
signature. Also add after signature `---` for clean separation with it's
description.
@gerau gerau requested a review from KyrylR November 10, 2025 15:48
Initially, `RopeSlice.as_str()` was used because it doesn't create a
copy of the string, but it can fail if the `RopeSlice` is not continuous
in memory. So, we convert the `RopeSlice` to a string, because this will
not throw an error for large lines, and the `references` function is not
called often enough for us to care about copying one line.
also change goto-definition to return range of symbol if we stay on
definition, because this actually triggers reference
@KyrylR KyrylR marked this pull request as ready for review November 12, 2025 09:50
Copy link
Collaborator

@KyrylR KyrylR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@KyrylR KyrylR merged commit 8432ec4 into main Nov 12, 2025
1 check passed
@gerau gerau deleted the dev branch November 12, 2025 14:41
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

Successfully merging this pull request may close these issues.

3 participants