Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't mark cell as stale on comments/whitespace changes? #3140

Open
anjiro opened this issue Dec 12, 2024 · 6 comments
Open

Don't mark cell as stale on comments/whitespace changes? #3140

anjiro opened this issue Dec 12, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@anjiro
Copy link

anjiro commented Dec 12, 2024

Description

It would be nice to have cells not get marked as "stale" when I only change comments or add/remove whitespace lines.

Suggested solution

Here's an example. The original cell:

foo=37 #Number of Formal Optimization Operations
bar=99

Changes that I don't want to make the cell marked as stale:

# Define important variables

foo = 37    # Number of Formal Optimization Operations
bar = 99    # Number of Basic Adjustment Repetitions

Alternative

No response

Additional context

No response

@anjiro anjiro added the enhancement New feature or request label Dec 12, 2024
@mscolnick
Copy link
Contributor

This is a good suggestion, I think we can handle this.

Are there any edge cases you can think of? Do any libraries work off comments? I know some work off documentation (like doctests), but those exist in triple quotes.

@dmadisetti
Copy link
Collaborator

AST compilation will leave doc strings, but strip normal comments. Most implementations would work on this.

There are pep ignore and tidy comments, but that shouldn't alter execution

@mscolnick
Copy link
Contributor

mscolnick commented Dec 12, 2024

@dmadisetti it would be nice to figure out "edited" on the frontend instead of a sever request

python AST parsing would be the most reliable. I may try the code-mirror lezer ast parsing on the front end. Any thoughts / issues with that?

@mscolnick
Copy link
Contributor

Actually, we may still want it to be stale since its not "saved" yet. I have a branch exploring this: #3145

Maybe the coloring is different? Could add more confusion

@dmadisetti
Copy link
Collaborator

Could be backlogged until/ if server side model comes along. I agree that it probably doesn't merit its own endpoint

Re save: could use an icon, or vscode uses a little bubble right?

@mscolnick
Copy link
Contributor

yea, we could. right now save only saves what has been run, not what has been written. we could keep that, but then you may have white space that is never gets saved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants