lean4-htt/src/Lean/Server/Completion
Markus Himmel fa5d08b7de
refactor: use String.Slice in String.take and variants (#11180)
This PR redefines `String.take` and variants to operate on
`String.Slice`. While previously functions returning a substring of the
input sometimes returned `String` and sometimes returned
`Substring.Raw`, they now uniformly return `String.Slice`.

This is a BREAKING change, because many functions now have a different
return type. So for example, if `s` is a string and `f` is a function
accepting a string, `f (s.drop 1)` will no longer compile because
`s.drop 1` is a `String.Slice`. To fix this, insert a call to `copy` to
restore the old behavior: `f (s.drop 1).copy`.

Of course, in many cases, there will be more efficient options. For
example, don't write `f <| s.drop 1 |>.copy |>.dropEnd 1 |>.copy`, write
`f <| s.drop 1 |>.dropEnd 1 |>.copy` instead. Also, instead of `(s.drop
1).copy = "Hello"`, write `s.drop 1 == "Hello".toSlice` instead.
2025-11-18 16:13:48 +00:00
..
CompletionCollectors.lean refactor: move operations on String.Pos.Raw to the String.Pos.Raw namespace (#10735) 2025-10-18 12:12:55 +00:00
CompletionInfoSelection.lean refactor: discipline around arithmetic of String.Pos.Raw (#10713) 2025-10-09 07:47:45 +00:00
CompletionItemCompression.lean fix: textedit completions (#10286) 2025-09-07 09:44:16 +00:00
CompletionResolution.lean chore: rename String.Pos to String.Pos.Raw (#10624) 2025-10-01 07:45:24 +00:00
CompletionUtils.lean fix: pre-filter completion items mod ascii casing (#11140) 2025-11-11 14:11:05 +00:00
EligibleHeaderDecls.lean feat: improve auto-completion performance (#10249) 2025-09-05 08:55:49 +00:00
ImportCompletion.lean refactor: use String.Slice in String.take and variants (#11180) 2025-11-18 16:13:48 +00:00
SyntheticCompletion.lean chore: rename String.Range to Lean.Syntax.Range (#10852) 2025-10-21 07:32:25 +00:00