mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 06:11:21 +00:00
[red-knot] Fix syntax highlighting for pyi files (#17015)
Monaco supports inferring the language based on the file's extension but it doesn't seem to support `pyi`. I tried to patch up the python language definition by adding `.pyi` to the language's `extension` array but that didn't work. That's why I decided to patch up the language in React.
This commit is contained in:
parent
142fe0d29b
commit
f9bc80ad55
1 changed files with 1 additions and 0 deletions
|
@ -81,6 +81,7 @@ export default function Editor({
|
|||
scrollBeyondLastLine: false,
|
||||
contextmenu: false,
|
||||
}}
|
||||
language={fileName.endsWith(".pyi") ? "python" : undefined}
|
||||
path={fileName}
|
||||
wrapperProps={visible ? {} : { style: { display: "none" } }}
|
||||
theme={theme === "light" ? "Ayu-Light" : "Ayu-Dark"}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue