You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fn main() raises:
# fn main(): # OK
pass
# Mojo modules
from python import Python
from math import ceil
from testing import assert_true
from time import sleep
Do you have the vscode setting editor.semanticHighlighting.enabled set to true? I only see the weird highlighting when I have it set to true. If I set it to false or "configuredByTheme", then I get normal syntax highlighting. I also see this same behavior in both the nightly and the released versions.
When it is set to true, I think this causes the LSP to be used for syntax highlighting instead of the textmate grammar. And it seems like the syntax highlighting from the LSP is weird.
This issue with the VS Code extension started with version 2024.12.2305. See below for the versions I checked today. I also reconfirmed that the immediately prior version (2105) was still OK.
Per GitHub, commit 2024.12.2305 updated five (5) magic.lock files to point to latest nightly version: 25.1.0.dev2024122305.
Raw Mojo diff: f4b34fc...22aa305
Bug description
The color weirdness shown in the first screenshot appears in the Mojo code after a function uses the raises keyword. In this example
fn main() raises:
appears at the beginning of a file. The colors look OK ifraises
is removed.Asked to create a bug report by @ehsanmok (Ehsan Kermani).
Discord: https://discord.com/channels/1087530497313357884/1224434323193594059/1324229203163615273
Steps to reproduce
Uses the raises keyword - KO
Removed the raises keyword - OK
System information
The text was updated successfully, but these errors were encountered: