-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Labels
notebookRelated to (Jupyter) notebooksRelated to (Jupyter) notebooksparserRelated to the parserRelated to the parserwishNot on the current roadmap; maybe in the futureNot on the current roadmap; maybe in the future
Description
Taking the following 2 code cells as an example:
Cell 1:
def foo():
print("first")Cell 2:
print("second")Currently, Ruff would concatenate it into a single source and pass it to the parser. This means that the parser would see it as:
def foo():
print("first")
print("second")Which is a valid code. But, actually the indentation before the second print statement is invalid as it is in another cell.
A possible solution, as suggested by @MichaReiser, would be to run the parser per cell, merge the statements, and update the node ranges for all the subsequent cells with the correct offset.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
notebookRelated to (Jupyter) notebooksRelated to (Jupyter) notebooksparserRelated to the parserRelated to the parserwishNot on the current roadmap; maybe in the futureNot on the current roadmap; maybe in the future