Skip to content

Implement goto for enum literals - #71

Open
BlankTiger wants to merge 1 commit into
SogoCZE:mainfrom
BlankTiger:enum_literal
Open

Implement goto for enum literals#71
BlankTiger wants to merge 1 commit into
SogoCZE:mainfrom
BlankTiger:enum_literal

Conversation

@BlankTiger

Copy link
Copy Markdown

Implementation handles following goto scenarios for enum literals:

  • procedure calls: SDL_CreateGPUDevice(.SPIRV | .MSL | .DXIL, ...)
  • struct field defaults/declarations: se: Some_Enum = .A
  • variable assignments: flags = .SPIRV | .MSL and ident.parent.kind = .UNARY_OPERATION
  • comparison operations: value == .SOME_ENUM and value != .OTHER_ENUM

@BlankTiger BlankTiger changed the title Implement goto for enum literals WIP: Implement goto for enum literals Sep 5, 2025
@BlankTiger BlankTiger changed the title WIP: Implement goto for enum literals Implement goto for enum literals Sep 5, 2025
@SogoCZE

SogoCZE commented Oct 5, 2025

Copy link
Copy Markdown
Owner

Thank you. I will try to review this PR soon.

@SogoCZE

SogoCZE commented Jan 3, 2026

Copy link
Copy Markdown
Owner

First of all, thank you for the PR!

I am reviewing the changes now, and I think there is a lot of code that essentially performs type inference. Although this is necessary to resolve the type and provide the required functionality, I would like to introduce more general inference into the LSP so it is not specifically hardcoded in the goto logic for enum literals.

I will try to refactor this PR into more general type inference functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants