helix-editor / helix

A post-modern modal text editor.
https://helix-editor.com
Mozilla Public License 2.0
33.84k stars 2.51k forks source link

code hightlight change while editing a python file #6034

Closed Yassine-cheffai closed 1 year ago

Yassine-cheffai commented 1 year ago

Summary

hello, when i edit a python file, other parts of the code change the color, and turn to bold, this happen when i'm in insert mode and while typing, i'm using:

here is a little video showing the issue (notice the initiation of fastapi) https://youtu.be/Ye5i0UYT3KQ

Reproduction Steps

installed helix from source, then installed pyright, and other lsps config.toml

theme = "ayu_dark"

[editor.file-picker]
hidden = false

[editor.cursor-shape]
# insert = "bar"
# normal = "block"
# select = "underline"

[editor]
auto-save = true
auto-completion = false

languages.toml

[[language]]
name = "python"
auto-format = true

roots = ["pyproject.toml"]
language-server = { command = "pyright-langserver", args = ["--stdio"] }
config = {} # <- this is the important line
[[grammar]]
name = "python"
source = { git = "https://github.com/tree-sitter/tree-sitter-python", rev = "9e53981ec31b789ee26162ea335de71f02186003" }
[language.formatter]
# need to lanch helix from inside the virtual env to work
command = "black"
args = [
"-", # stdin
"--quiet",
"--line-length=79",
]

[[language]]
name = "html"
formatter = { command = 'prettier', args = ["--parser", "html"] }

[[language]]
name = "json"
formatter = { command = 'prettier', args = ["--parser", "json"] }

[[language]]
name = "css"
formatter = { command = 'prettier', args = ["--parser", "css"] }

[[language]]
name = "javascript"
formatter = { command = 'prettier', args = ["--parser", "typescript"] }
auto-format = true

[[language]]
name = "typescript"
formatter = { command = 'prettier', args = ["--parser", "typescript"] }
auto-format = true

i tweaked the grammer source but didn't fix the issue

Helix log

2023-02-17T19:37:01.432 helix_term::application [ERROR] Language Server: Method not found client/registerCapability 2023-02-17T19:37:14.065 helix_view::editor [ERROR] editor error: 1 unsaved buffer(s) remaining: ["app/main.py"] 2023-02-17T19:39:14.759 helix_term::application [ERROR] Language Server: Method not found client/registerCapability 2023-02-17T19:42:57.418 helix_term::application [ERROR] Language Server: Method not found client/registerCapability 2023-02-17T19:51:21.025 helix_term::application [ERROR] Language Server: Method not found client/registerCapability 2023-02-17T20:02:06.046 helix_view::editor [ERROR] Failed to initialize the LSP for source.bash { cannot find binary path } 2023-02-17T20:08:33.865 helix_term::application [ERROR] Language Server: Method not found client/registerCapability 2023-02-17T20:13:51.429 helix_term::application [ERROR] Language Server: Method not found client/registerCapability 2023-02-17T20:14:02.127 helix_view::editor [ERROR] editor error: 1 unsaved buffer(s) remaining: ["app/main.py"] 2023-02-17T20:15:05.449 helix_view::editor [ERROR] Failed to initialize the LSP for source.toml { cannot find binary path } 2023-02-17T20:17:05.198 helix_term::application [ERROR] Language Server: Method not found client/registerCapability 2023-02-17T20:18:04.061 helix_view::editor [ERROR] Failed to initialize the LSP for source.toml { cannot find binary path } 2023-02-17T20:20:28.242 helix_term::application [ERROR] Language Server: Method not found client/registerCapability 2023-02-17T20:23:45.672 helix_view::editor [ERROR] Failed to initialize the LSP for source.toml { cannot find binary path } 2023-02-17T20:28:58.058 helix_term::application [ERROR] Language Server: Method not found client/registerCapability 2023-02-17T21:09:03.620 helix_view::editor [ERROR] Failed to initialize the LSP for source.toml { cannot find binary path } 2023-02-17T21:09:38.834 helix_view::editor [ERROR] Failed to initialize the LSP for source.toml { cannot find binary path } 2023-02-17T21:14:58.750 helix_term::application [ERROR] Language Server: Method not found client/registerCapability

Platform

linux

Terminal Emulator

tilix

Helix Version

helix 22.12 (c5c1b5af)

Yassine-cheffai commented 1 year ago

see at second 4, how FastAPI in ligne 8 turned from green and normal to blue and bold https://www.youtube.com/watch?v=Ye5i0UYT3KQ

kirawi commented 1 year ago

Highlighting changing is expected behavior, and the bold is likely because the theme highlights diagnostics as bold.