Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax Highlighting color shifts for variable.parameter based on code in viewport #10057

Closed
tauseefk opened this issue Mar 30, 2024 · 1 comment
Labels
C-bug Category: This is a bug R-duplicate Duplicated issue: please refer to the linked issue

Comments

@tauseefk
Copy link

Summary

The syntax highlighting for variable.parameter changes based on whether the function declaration (specifically the parameter) is visible in the viewport or not.

Correct Color Incorrect Color
Screenshot 2024-03-30 at 2 59 21 PM Screenshot 2024-03-30 at 2 59 33 PM

My guess is that the editor doesn't look at variables declared outside the viewport as an optimization, however the UX is somewhat jarring.

.toml

...
"variable" = "pine"
"variable.parameter" = { fg = "sand" }
"variable.other.member" = { fg = "sand" } # accessed fields of structs
"variable.builtin" = { fg = "pine" }
...

[palette]
bright-pine = '#7AA697'
pine = '#3D8C8C'
dim-pine = '#747D6A'
dark-pine = '#354247'
sand = '#FFF4BA'

Reproduction Steps

I tried this:

I've been able to reproduce this on several repos (some rust, and some typescript).
asciicast

Observe that the color of the variable tx_callback is different depending on whether the function declaration is in the viewport or not.

Repo that can be used to reproduce: https://github.com/tauseefk/streamformers

  1. git clone [email protected]:tauseefk/streamformers.git
  2. cd streamformers
  3. hx src/main.rs
  4. scroll to function infer line 75

I expected this to happen:

  1. variable tx_callback to be colored #FFF4BA

Instead, this happened:

  1. variable tx_callback to be colored #7AA697

Helix log

~/.cache/helix/helix.log
please provide a copy of `~/.cache/helix/helix.log` here if possible, you may need to redact some of the lines

2024-03-30T14:30:47.278 helix_view::editor [ERROR] Failed to initialize the language servers for source.toml - taplo { cannot find binary path }
2024-03-30T14:41:25.192 helix_view::editor [ERROR] editor error: No configured language server supports range formatting
2024-03-30T14:55:13.214 helix_view::editor [ERROR] Failed to initialize the language servers for source.toml - taplo { cannot find binary path }
2024-03-30T15:03:23.671 helix_view::editor [ERROR] Failed to initialize the language servers for source.toml - taplo { cannot find binary path }
2024-03-30T15:18:55.920 helix_view::editor [ERROR] Failed to initialize the language servers for source.css - vscode-css-language-server { cannot find binary path }
2024-03-30T15:19:08.618 helix_term::application [ERROR] received malformed notification from Language Server: Unhandled
2024-03-30T15:19:08.731 helix_term::application [WARN] Received unregistration request for unsupported method: workspace/didChangeConfiguration
2024-03-30T15:19:08.731 helix_term::application [WARN] Received unregistration request for unsupported method: textDocument/rangeFormatting
2024-03-30T15:19:08.731 helix_term::application [WARN] Received unregistration request for unsupported method: textDocument/onTypeFormatting
2024-03-30T15:19:08.731 helix_term::application [WARN] Received unregistration request for unsupported method: textDocument/rename
2024-03-30T15:19:08.731 helix_term::application [WARN] Received unregistration request for unsupported method: textDocument/formatting
2024-03-30T15:19:08.731 helix_term::application [WARN] Ignoring a client/registerCapability request because dynamic capability registration is not enabled. Please report this upstream to the language server
2024-03-30T15:19:08.731 helix_term::application [WARN] Ignoring a client/registerCapability request because dynamic capability registration is not enabled. Please report this upstream to the language server
2024-03-30T15:19:08.731 helix_term::application [WARN] Ignoring a client/registerCapability request because dynamic capability registration is not enabled. Please report this upstream to the language server
2024-03-30T15:23:41.876 helix_view::editor [ERROR] Failed to initialize the language servers for source.toml - taplo { cannot find binary path }

Platform

MacOS Sonoma (14.2.1 (23C71))

Terminal Emulator

Alacritty version 0.13.1

Installation Method

brew

Helix Version

helix 23.10 (f6021dd)

@tauseefk tauseefk added the C-bug Category: This is a bug label Mar 30, 2024
@the-mikedavis
Copy link
Member

Duplicate of #1151

@the-mikedavis the-mikedavis marked this as a duplicate of #1151 Mar 30, 2024
@the-mikedavis the-mikedavis closed this as not planned Won't fix, can't repro, duplicate, stale Mar 30, 2024
@the-mikedavis the-mikedavis added the R-duplicate Duplicated issue: please refer to the linked issue label Mar 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug R-duplicate Duplicated issue: please refer to the linked issue
Projects
None yet
Development

No branches or pull requests

2 participants