Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Use problem manager to handle markers from plugins #4178
Use problem manager to handle markers from plugins #4178
Changes from all commits
8c82eda
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
If possible please use https://github.com/theia-ide/theia/blob/master/packages/plugin-ext/src/plugin/type-converters.ts for such conversions.
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.
Again, nope, this is on the "main" side of the API. The conversions in type-converter.ts are in the other direction.
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.
again, yes
type-converter is converting both ways (and the name is generic enough and is in an upper package to be widely used)
example for Position: https://github.com/theia-ide/theia/blob/master/packages/plugin-ext/src/plugin/type-converters.ts#L96-L102
it has
from
andto
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.
Sorry, but no: the file you refer to is in the "plugin" subtree and converts between plugin API objects and the main/ext API. The conversion here happens on the other side of the main/ext API and converts to objects from the module 'vscode-languageserver-types'.
Also, the this file already contains a number of functions that convert from main/ext types to monaco or theia internal types. So my change here conforms to the already existing code.
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.
type-converter is in plug-in subtree and you're converting stuff in the file
packages/plugin-ext/src/main/browser/languages-main.ts
so it's the same subtree.It's converting types coming from `vscode-languageserver-types'
you introduced a local scope
import * as vst from 'vscode-languageserver-types';
to convert data to the same origin,so it should be in
https://github.com/theia-ide/theia/blob/master/packages/plugin-ext/src/plugin/type-converters.ts
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.
Yes, technically, it can, but if the type converter provides services to both the plugin and main side of things, it should be moved to the "common" folder, otherwise, why do we even have the subfolders? I feel that is outside of the scope of this PR.
Anyway, we're having a stylistic difference here we're not going to resolve amicably. How should we proceed?
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.
I agree that managing conversions in one place would be good. But I did not think that the code from main module can access VS Code types, or need to load them at runtime. Does it?
What about getting rid of
MarkerData
? Theia expect LSP diagnostics which are JSON already, so VS Code diagnostics can be converted to LSP in the host plugin process. No need for conversions in the main module.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.
@akosyakov you mean this line https://github.com/theia-ide/theia/blob/master/packages/plugin-ext/src/plugin/type-converters.ts#L27 ? (imports of vscode-types ) ?
or that https://github.com/theia-ide/theia/blob/a83fb71067315159706ab274f31e2fa5c4393644/packages/plugin-ext/src/main/browser/languages-main.ts (language main) can't access
type-converter
?I'm also fine with your proposal
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.
I meant that when we import
type-converters
in main, it pulls JS files liketypes-impl
and other internal code of the host plugin process (even implementations of*Ext
interfaces) which gets bundled by webpack or loaded by main server node process. Is it really necessary, expected?I believe it is not caused by Thomas changes and quite a big separate issue.
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.
I've opened an issue for it - #4271
Thinking more about it, I am not sure that we can do all conversions in one file. There are internal VS Code types for plugin module and internal Monaco types for main module, trying to make conversion between them in one file will always cause such issues. Common converter can only depend on
theia
namespace, LSP and plugin DTO types.