LuaLS / LuaLS/lua-language-server

[feature request] disable semantic colouring by default

Open
#3,419 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
4.4k
Forks
442
PR merge metrics
No merged PRs in 30d

Description

### How are you using the lua-language-server?

Other

### Which OS are you using?

Windows

### What is the issue affecting?

Other

### Expected Behaviour

我在用Qt creator,昨天用lua编写插件,然后下载了Dracula / oneDark pro 两个主题插件,
结果发现lua的local function return 等关键词老是和注释一样的颜色,见下图

Image

然后禁用主题插件之后,发现也不是主题插件导致的(默认主题下关键词也会跟注释一样颜色)
经过一天的折腾,到了晚上终于发现是lua language server 插件导致的,
一查这个插件,发现是qt 官方出品,

Image

然后我就到qt creator论坛反馈bug, 结果发帖被判定为垃圾信息无法发帖,
然后就通过帮助菜单下找到了反馈bug的地方.

今天突然想到可能是language server导致的,就在本项目issue里搜索,发现了一个类似的issue:
https://github.com/LuaLS/lua-language-server/issues/3318
按照 tomlau10 的方法,
https://github.com/LuaLS/lua-language-server/issues/3318#issuecomment-3678348853
我在 .luarc.json 里禁用了 semantic.enable , 高亮终于正常了.
我看了一下luaLS wiki, semantic.keyword 默认关闭的,我项目也没开启, luaLS居然能影响关键词..

谁能想到一个language server居然能影响语法高亮,
谁能想到一个language server居然把关键词和注释弄成一个颜色,

所以我建议默认关闭 semantic.enable ,😭

### Actual Behaviour

.

### Reproduction steps

.

### Additional Notes

_No response_

### Log File

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the semantic.enable setting and the related discussion in issue #3318, including its linked comment; .luarc.json shows the current user-level workaround. Determine where the default is established and verify that disabling it by default prevents semantic colouring from changing keyword colours while preserving the documented opt-in behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
devtools
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.