Skip to content

Language server compilation error and no syntax highlighting in vscode when code is valid on Windows #1251

Closed
@markphillips100

Description

@markphillips100

1. Minimal reproduce step (Required)

I've added a minimal repro sample here that triggers error popups in VSCode along with no syntax highlighting, even though the code is valid (I think).

It "feels" like the server has a problem with the filter statement but this could be just a false observation on my part.

Whenever the issue arises and I make some change to rectify, I always have to restart VSCode to test if the server is okay again.

2. What did you expect to see? (Required)

Syntax highlighting should work even if there is a compilation error and indicate what the error is to the user.

If I comment the code in resources/contributorAssignees.k and restart VSCode, main.k shows the following expected highlighting and no errors from language server.

image

3. What did you see instead (Required)

I see errors under the kcl language server output window:

[Info  - 7:47:28 PM] on did open file: AbsPathBuf("d:\\Dev\\github\\kcl-test\\main.k")
thread '<unnamed>' panicked at sema\src\core\global_state.rs:514:66:
called `Option::unwrap()` on a `None` value
[Info  - 7:47:29 PM] Compile failed: "Compile failed: Any { .. }"
[Error - 7:47:29 PM] Request textDocument/documentSymbol failed.
  Message: Internal bug: Path d:\Dev\github\kcl-test\main.k analysisDatabase not found, maybe compile failed
  Code: -32603 
[Error - 7:47:29 PM] Request textDocument/semanticTokens/full failed.
  Message: Internal bug: Path d:\Dev\github\kcl-test\main.k analysisDatabase not found, maybe compile failed
  Code: -32603 

main.k shows no coloured highlighting.

image

4. What is your KCL components version? (Required)

kcl --version: 0.8.6
kcl-language-server: 0.8.5
VSCode extension "KCL" by kcl_extension_publisher v0.1.6
VSCode v1.88.1
Windows 11

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinglsp

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions