Skip to content

ATL-1106: Made all non-workspace editors read-only. #264

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

Merged
merged 1 commit into from
Mar 25, 2021

Conversation

kittaakos
Copy link
Contributor

What it does:

This PR makes all editors that are not in the current workspace (sketch folder) read-only.

Try the Peek > Peek Definiton functionality on Serial#begin and bar. (Note the cursor location: <|>):

Sketch.ino:

#include "other.h"
void setup() {
  ba<|>r();
  Serial.begi<|>n(9600);
}
void loop() { }

Other.h:

void bar() {}

Serial#begin should open in a read-only embedded editor. You should be able to edit in the embedded editor if you peek at the definition of bar. Opening an editor should behave the same as the embedded peek editor. Please review. Thank you!

Signed-off-by: Akos Kitta [email protected]

@kittaakos kittaakos requested a review from per1234 March 24, 2021 11:40
@kittaakos kittaakos force-pushed the atl-1106--readonly-on-monaco-peek branch from 4ba8bb9 to c6a1db4 Compare March 24, 2021 11:48
@kittaakos kittaakos requested a review from fstasi March 24, 2021 11:49
Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really great Akos. Thanks!

I did find a related problem, which is that the tab control menu allows me to delete or rename the files opened via "Go to Definition". I could see a user using "delete" to remove what appears to be an unwanted file from their sketch. But I'm guessing that is out of scope for this PR, so I'm giving a resounding thumbs up on this.

@ubidefeo
Copy link

Downloading now, but I share @per1234 's opinion that non-workspace files should not be deleted.
I see one problem ahead: are files in the Sketch's src folder considered Workspace file?
Those ones should be editable and deletable.
Can of worms, anyone?

@kittaakos
Copy link
Contributor Author

kittaakos commented Mar 25, 2021

opinion that non-workspace files should not be deleted.

I open a follow-up.

are files in the Sketch's src folder considered Workspace file?

Yes. They're part of the Theia/VS Code workspace (== current sketch folder.)

Those ones should be editable and deletable.

You should be able to delete and modify them. If no, it's a bug.

@kittaakos
Copy link
Contributor Author

opinion that non-workspace files should not be deleted.

I open a follow-up.

Here is the follow-up: #274

Copy link

@ubidefeo ubidefeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and working

@kittaakos kittaakos merged commit f712ec9 into main Mar 25, 2021
@kittaakos kittaakos deleted the atl-1106--readonly-on-monaco-peek branch March 25, 2021 15:45
@per1234 per1234 added topic: code Related to content of the project itself type: enhancement Proposed improvement labels Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants