3
21
Fork
You've already forked zigbrains
2

Add case sensitivity to autocomplete #12

Open
opened 2026年06月08日 20:32:12 +02:00 by pav · 8 comments

Title basically says it all.

With every other language in JetBrains editors, autocomplete is case sensitive, so if I have a struct Thing, and declare const thing: Thing = ..., I then want to call a method on thing and autocomplete shows Thing as the first result.
Similar issue if I have an import from another file and the name of the file is the same as a struct it declares, minus the upper case, and when I start typing the name of the struct and instinctively press tab when it actually first recommends the name of the import, which I don't care about.

This case sensitivity seems like a deliberate choice because I feel like case insensitivity is the default here, as it is with most language support for JetBrains. If that is the case, then I have no idea why anyone would think this is a good idea.

Title basically says it all. With every other language in JetBrains editors, autocomplete is case sensitive, so if I have a struct `Thing`, and declare `const thing: Thing = ...`, I then want to call a method on `thing` and autocomplete shows `Thing` as the first result. Similar issue if I have an import from another file and the name of the file is the same as a struct it declares, minus the upper case, and when I start typing the name of the struct and instinctively press tab when it actually first recommends the name of the import, which I don't care about. This case sensitivity seems like a deliberate choice because I feel like case insensitivity is the default here, as it is with most language support for JetBrains. If that is the case, then I have no idea why anyone would think this is a good idea.
Collaborator
Copy link

its not a choice by us, auto-completions are handled by ZLS

its not a choice by us, auto-completions are handled by ZLS
Author
Copy link

@ENDERZOMBI102 wrote in #12 (comment):

its not a choice by us, auto-completions are handled by ZLS

Pretty sure it isn't. In Neovim or Zed, this doesn't happen, so it must be editor specific. And it would be weird if JetBrains just didn't allow you to change the case sensitivity. But I guess if that's really the case then I should go bother them or the ZLS team.

@ENDERZOMBI102 wrote in https://codeberg.org/FalsePattern/zigbrains/issues/12#issuecomment-16854551: > its not a choice by us, auto-completions are handled by ZLS Pretty sure it isn't. In Neovim or Zed, this doesn't happen, so it must be editor specific. And it would be weird if JetBrains just didn't allow you to change the case sensitivity. But I guess if that's really the case then I should go bother them or the ZLS team.

LSP4IJ has a client-side option for force-enabling case sensitivity at the client end of the LSP, we could use that

LSP4IJ has a client-side option for force-enabling case sensitivity at the client end of the LSP, we could use that

unless theres another option that im missing the LSP4IJ option is... suboptimal. it completely removes completions that are the wrong case rather than just deprioritizing them
image
image

unless theres another option that im missing the LSP4IJ option is... suboptimal. it completely removes completions that are the wrong case rather than just deprioritizing them ![image](/attachments/17e356fa-d08c-4206-9000-08c6cfbb183e) ![image](/attachments/5204c578-4979-4725-b611-0d19e0e64ff1)

I'll look into a way to add custom sorting logic on top of the lsp4ij autocompletion code for zig/zon files.

We plan on ditching lsp4ij in the next major rewrite of zigbrains and doing all of the autocomplete and stuff inside the plugin directly, so that will give us way more control over stuff like this.

I'll look into a way to add custom sorting logic on top of the lsp4ij autocompletion code for zig/zon files. We plan on ditching lsp4ij in the next major rewrite of zigbrains and doing all of the autocomplete and stuff inside the plugin directly, so that will give us way more control over stuff like this.
Author
Copy link

@pentuppup wrote in #12 (comment):

unless theres another option that im missing the LSP4IJ option is... suboptimal. it completely removes completions that are the wrong case rather than just deprioritizing them

That's literally how autocomplete works in JetBrains. That's the behaviour for C with CLion, Rust in RustRover, etc. And I don't see anything wrong with that approach. Just type a capital letter if you want to reference that symbol. Editors like Zed or Neovim show the matching case first but they show the other matches also but personally I don't find that feature to be particularly useful.

@pentuppup wrote in https://codeberg.org/FalsePattern/zigbrains/issues/12#issuecomment-17228615: > unless theres another option that im missing the LSP4IJ option is... suboptimal. it completely removes completions that are the wrong case rather than just deprioritizing them That's literally how autocomplete works in JetBrains. That's the behaviour for C with CLion, Rust in RustRover, etc. And I don't see anything wrong with that approach. Just type a capital letter if you want to reference that symbol. Editors like Zed or Neovim show the matching case first but they show the other matches also but personally I don't find that feature to be particularly useful.

if thats how jetbrains normally does it then i suppose that makes, i guess i havent noticed since basically everything in the c++ STL is snake_case. i just find that to be a pretty poor experience, it means you need to know the case of something to find it which isnt great for exploring unfamiliar code

if thats how jetbrains normally does it then i suppose that makes, i guess i havent noticed since basically everything in the c++ STL is snake_case. i just find that to be a pretty poor experience, it means you need to know the case of something to find it which isnt great for exploring unfamiliar code
Sign in to join this conversation.
No Branch/Tag specified
master
rewrite-3
0.17-compat
251
252
253
dev
241
242
243
feat/use-var-intent
feat/parser-reimpl
experimental
30.0.1
30.0.0
29.1.0
29.0.1
29.0.0
28.3.0
28.2.2
28.2.1
28.2.0
28.1.0
28.0.0
27.3.1
27.3.0
27.2.1
27.2.0
27.1.1
27.1.0
27.0.0
26.3.2
26.3.1
26.3.0
26.2.1
26.2.0
26.1.0
26.0.2
26.0.1
26.0.0
25.5.1
25.5.0
25.4.2
25.4.1
25.4.0
25.3.0
25.2.0
25.1.0
25.0.2
25.0.1
24.0.1
24.0.0
23.1.2
23.1.1
23.1.0
23.0.2
23.0.1
23.0.0
22.0.1
22.0.0
21.1.0
21.0.0
20.3.0
20.2.2
20.2.1
20.2.0
20.1.3
20.1.2
20.1.1
20.1.0
20.0.4
20.0.3
20.0.2
20.0.1
20.0.0
19.3.0-232
19.3.0-233
19.3.0-241
19.3.0-242
19.3.0
19.2.0
19.1.0
19.0.0
18.1.0
18.0.0
17.3.1-dev001
17.3.0
17.2.0
17.1.0
17.0.0
16.1.3
16.1.2
16.1.1
16.1.0
16.0.0
16.0.0-pre2
16.0.0-pre1
15.2.0-241
15.2.0-233
15.2.0-232
15.2.0
15.1.1-241
15.1.1-233
15.1.1-232
15.1.1
15.1.0-241
15.1.0-233
15.1.0-232
15.1.0
15.0.3-241
15.0.3-233
15.0.3-232
15.0.3
15.0.2-241
15.0.2-233
15.0.2-232
15.0.2
15.0.1-241
15.0.1-233
15.0.1-232
15.0.1
15.0.0-241
15.0.0-233
15.0.0-232
15.0.0
14.5.0-241
14.5.0-233
14.5.0-232
14.5.0-231
14.5.0
14.4.0-241
14.4.0-233
14.4.0-232
14.4.0-231
14.4.0
14.3.0-233
14.3.0-232
14.3.0-231
14.3.0
14.2.0-233
14.2.0-232
14.2.0-231
14.2.0
14.1.0-233
14.1.0-232
14.1.0-231
14.1.0
14.0.1-233
14.0.1-232
14.0.1-231
14.0.1
14.0.0-233
14.0.0-232
14.0.0-231
14.0.0
13.2.0-233
13.2.0-232
13.2.0-231
13.2.0
13.1.1-233
13.1.1-232
13.1.1-231
13.1.1
13.1.0-233
13.1.0-232
13.1.0-231
13.1.0
13.0.1-233
13.0.1-232
13.0.1-231
13.0.1
13.0.0-233
13.0.0-232
13.0.0-231
13.0.0
12.1.0-pre01
12.0.0
11.1.0
11.0.0
0.9.0
0.8.1
0.8.0
0.7.0
0.6.0
0.5.2
0.5.1
0.5.0
0.4.0
0.3.1
0.3.0
0.2.0
0.10.0
0.1.0
Labels
Clear labels
Compat/Breaking
Breaking change that won't be backward compatible
Kind/Bug
Something is not working
Kind/Documentation
Documentation changes
Kind/Enhancement
Improve existing functionality
Kind/Feature
New functionality
Kind/Security
This is security issue
Kind/Testing
Issue or pull request related to testing
Priority
Critical
The priority is critical
Priority
High
The priority is high
Priority
Low
The priority is low
Priority
Medium
The priority is medium
Reviewed
Confirmed
Issue has been confirmed
Reviewed
Duplicate
This issue or pull request already exists
Reviewed
Fixed
The bug has been fixed.
Reviewed
Invalid
Invalid issue
Reviewed
Won't Fix
This issue won't be fixed
Status
Abandoned
Somebody has started to work on this but abandoned work
Status
Blocked
Something is blocking this issue or pull request
Status
Need More Info
Feedback is required to reproduce issue or to continue work
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
FalsePattern/zigbrains#12
Reference in a new issue
FalsePattern/zigbrains
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?