Skip to content

Conversation

@ewired
Copy link

@ewired ewired commented Nov 12, 2025

No description provided.

@ewired ewired force-pushed the autocomplete-ranges branch 4 times, most recently from 58bab57 to d2aa9c8 Compare November 18, 2025 02:17
@ewired ewired force-pushed the autocomplete-ranges branch from 423d1a3 to 20069cf Compare November 22, 2025 02:33
@github-actions github-actions bot force-pushed the dev branch 2 times, most recently from f1dc981 to 3e15a39 Compare November 22, 2025 18:07
@github-actions github-actions bot force-pushed the dev branch 2 times, most recently from df8bdf9 to 0dd5039 Compare November 22, 2025 18:21
@ewired ewired force-pushed the autocomplete-ranges branch 2 times, most recently from da77c5f to 7c0898e Compare November 26, 2025 18:04
@ewired ewired force-pushed the autocomplete-ranges branch from 7c0898e to 79cde59 Compare December 4, 2025 19:19
@ewired ewired force-pushed the autocomplete-ranges branch 3 times, most recently from dc2b400 to f3ef634 Compare December 11, 2025 02:00
@ewired ewired force-pushed the autocomplete-ranges branch 4 times, most recently from 77328b0 to 5c4d8db Compare December 23, 2025 13:38
@ewired ewired force-pushed the autocomplete-ranges branch from 5c4d8db to 975a723 Compare December 23, 2025 19:18
@rekram1-node
Copy link
Collaborator

For line ranges they should be the same format as we have for other things:

@file#11-23

I think that's what vscode extension does correct?

@ewired
Copy link
Author

ewired commented Dec 23, 2025

@rekram1-node Sounds good to me, I changed it over

@rekram1-node
Copy link
Collaborator

/review

...result.data.map(
(item): AutocompleteOption => ({
display: Locale.truncateMiddle(item, width),
...result.data.map((item): AutocompleteOption => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Style suggestion: The let statements for url and filename could be avoided using an IIFE pattern (see packages/opencode/src/util.iife.ts for reference). However, this is minor and the current implementation is still readable - feel free to keep as-is if you prefer the simplicity.

@rekram1-node
Copy link
Collaborator

when I get a chance ill pull it down and try it I think this will be a good addition if its done well

@rekram1-node
Copy link
Collaborator

How do I get it to trigger?

Screenshot 2025-12-26 at 10 52 26 PM

@ewired
Copy link
Author

ewired commented Dec 27, 2025

image

It must be triggered by typing # at any point while the autocomplete is open and showing some files. When you have a valid line range or line number, all the files in the autocomplete selection will have it, and when you accept one it will be included. Given the way mentions work, you couldn't type in line numbers after you inserted the filename mention without numbers. This is consistent with being unable to change the filename, for example, selecting Makefile and then typing .xyz would still mention Makefile and not Makefile.xyz. Maybe this is confusing for people used to the vscode extension and could be fixed, but it would need a lot of extra behavior changes to consistently allow editing mentions after they're selected.

@rekram1-node
Copy link
Collaborator

Hm seems to work intermittently but not reliably

Screenshot 2025-12-26 at 11 11 19 PM

Also it feels kinda weird that I can't autocomplete the file at all and then add line numbers to it in any way

@ewired
Copy link
Author

ewired commented Dec 27, 2025

The intermittent display here is because it only respects valid line ranges where the end is greater than the start. As soon as you type one more digit in the number after the dash there, it will be greater than 11 and show the range on all the files. This could have definitely been better, now it uses only the start value while you're still typing an invalid range. It will reject any non-numeric input besides a trailing dash in any part of the range. This prevents it from being so jumpy while typing now.

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.

2 participants