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

Support synthetic decorations in worksheets #862

Merged
merged 2 commits into from Feb 1, 2022

Conversation

tgodzik
Copy link
Contributor

@tgodzik tgodzik commented Jan 30, 2022

Previously, we would have a separate type of decorations for worksheets. Now, we have a separate type for worksheets evaluations and synthetic decorations.

Needed for scalameta/metals#3582

Previously, we would have a separate type of decorations for worksheets. Now, we have a separate type for worksheets evaluations and synthetic decorations.

Needed for scalameta/metals#3582
@tgodzik tgodzik requested a review from kpodsiad January 30, 2022 18:14
@@ -1068,9 +1066,6 @@ function launchMetals(
scalaDebugger.initialize(outputChannel).forEach((disposable) => {
context.subscriptions.push(disposable);
});
client.onNotification(DecorationTypeDidChange.type, (options) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is never used and not sure if it actually should.

Copy link
Member

@kpodsiad kpodsiad left a comment

Choose a reason for hiding this comment

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

I'd love to see some refactor which will reduce extension.ts size, but it isn't obligatory ;)

src/extension.ts Outdated
Comment on lines 1069 to 1071
client.onNotification(DecorationsRangesDidChange.type, (params) => {
const editors = window.visibleTextEditors;
const path = Uri.parse(params.uri).toString();
Copy link
Member

Choose a reason for hiding this comment

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

I've noticed that client.onNotification return Disposable but we're discarding returned value. Maybe it should be added to context.subscriptions (yeah, it's a broader problem)

extension.ts is a very large file, I wonder if we can e.g. create notifications dir and extract all client.onNotification to different files

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added all the disposables from onNotification to subscriptions. Good idea!

Copy link
Member

Choose a reason for hiding this comment

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

Thanks, that's a step into good direction ;)

@tgodzik tgodzik requested a review from kpodsiad February 1, 2022 15:32
@tgodzik tgodzik merged commit f5d76b9 into scalameta:main Feb 1, 2022
@tgodzik tgodzik deleted the support-worksheets branch February 1, 2022 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants