Skip to content

fix highlighting enum values in if/when exprs as procs#87

Open
morganholly wants to merge 3 commits intosaem:mainfrom
morganholly:patch-2
Open

fix highlighting enum values in if/when exprs as procs#87
morganholly wants to merge 3 commits intosaem:mainfrom
morganholly:patch-2

Conversation

@morganholly
Copy link
Contributor

No description provided.

@saem
Copy link
Owner

saem commented Apr 18, 2022

Thanks for the PR @morganholly, I'm not sure I necessarily understand the change. Could you explain it so I can compare it with my own understanding?

@morganholly
Copy link
Contributor Author

morganholly commented Apr 18, 2022

so i noticed it within this code. all of the itInt, valString, callbackBool, etc were highlighted as proc calls, but they’re enums

flag = FlagVariantRef(kind: fkShortAndLong,
                                shortName: shortName,
                                longName: longName,
                                datatype: when T is int64: itInt elif T is float64: itFloat elif T is string: itString elif T is bool: itBool elif T is FuzzyBool: itFuzzyBool,
                                ...

@morganholly
Copy link
Contributor Author

however i think it may block highlighting actual proc calls in an object construction

@morganholly
Copy link
Contributor Author

i will see if i need to slightly tweak the regex probably to look for an if, when, elif, else, of, etc

@morganholly
Copy link
Contributor Author

so i didn't work on the regex yet but it doesn't highlight myProc input so i'll have to work on the regex later

@morganholly
Copy link
Contributor Author

so i did some work on the regex, i have something working correctly in regex101 but vscode doesn't seem to like it so i have to do a bit more to get a good regex for this

@morganholly
Copy link
Contributor Author

ok i found a workaround for the issue and added the fixed regex in

@morganholly
Copy link
Contributor Author

it will require fixing merge conflicts at some point so i may do that ahead of time

pull in changes from other PRs
elijahr pushed a commit to elijahr/vscode-nim that referenced this pull request Nov 29, 2025
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