-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Refactored LanguagesMainImpl and OutputChannelRegistryMainImpl so they could be extended #6148
Conversation
68d37a3
to
de6c89e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should put LanguagesMainImpl
and OutputChannelRegistryMainImpl
in DI context, i.e. they should not receive a container anymore, but be injectable
and inject
required services.
packages/plugin-ext/src/main/browser/plugin-ext-frontend-module.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now the largest change is unrelated to what we're trying to achieve. I would revert that change and focus on the essential.
@@ -105,23 +108,39 @@ export class LanguagesMainImpl implements LanguagesMain { | |||
position: monaco.Position, | |||
context: monaco.modes.SuggestContext, | |||
token: monaco.CancellationToken): Thenable<monaco.modes.ISuggestResult> => | |||
Promise.resolve(this.proxy.$provideCompletionItems(handle, model.uri, position, context, token)).then(result => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I'm not against this refactoring, it's completely unrelated to what you're trying to achieve in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's related, one can subclass LanguagesMainImpl
and override provideCompletionItemsImpl
to wrap it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the idea was to refactor and then subclass that way I can easily wrap the requests while making minimal changes to the code.
That way I can do something like https://github.com/JPinkney/theia-plugin-extension-metrics/blob/master/src/browser/plugin-metrics-languages-main.ts#L40 and have that piece of code be called by https://github.com/eclipse-theia/theia/pull/6148/files#diff-42e21ff47aae4b2d39ad311d392f4a26R109
packages/plugin-ext/src/main/browser/plugin-ext-frontend-module.ts
Outdated
Show resolved
Hide resolved
de6c89e
to
f11ea05
Compare
@JPinkney please rebase again |
ca0e562
to
64142e1
Compare
@akosyakov Done! |
packages/plugin-ext/src/main/browser/plugin-ext-frontend-module.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: Josh Pinkney <joshpinkney@gmail.com>
64142e1
to
f86f305
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactoring looks good to me, also verified that VS Code extensions are still working with Go extension.
@JPinkney you should have the commit rights now, correct? |
@tsmaeder I think I'm supposed to but after signing everything with eclipse I still wasn't granted any extra permissions. I'm going to try to get in contact with someone there to see what I can do |
Emailed the eclipse webmaster so now I have rights for everything. I'll merge if theres no objections |
What it does
This PR introduces LanguagesMainFactory and an OutputChannelRegistryFactory so that we can extend LanguagesMainImpl and OutputChannelRegistryMainImpl in order to provide metrics for the plugin extension.
See: this for the implementation way and this for the whole discussion.
How to test
This PR doesn't include any new functionality, more just a restructuring of everything that enables it to be extended more.
With that said, you can test by installing a vscode extension that has lots of features such as vscode-java and testing whether or not the language features work on a simple project such as: https://github.com/che-samples/console-java-simple.
For reference, I tested auto completion, validation, find all references, go to definition, go to symbol, go to type definition, format document, refactor, rename symbol and everything was working as expected.
Additionally, if you want to see how it's extended you can build and use this theia extension: https://github.com/JPinkney/theia-plugin-extension-metrics
Review checklist
Reminder for reviewers