-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Handle markdown in LSP doc popups #10645
Handle markdown in LSP doc popups #10645
Conversation
Signed-off-by: Thomas Mäder <tmader@redhat.com>
Signed-off-by: Thomas Mäder <tmader@redhat.com>
} else { | ||
callback.onSuccess(createAdditionalInfoWidget()); | ||
} | ||
MarkedOverlay.getMarkedPromise() |
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.
Maybe you should provide some sort of abstraction instead using MarkedOverlay
directly.
It's OK to use MarkedOverlay
in Orion module, but in this module we shouldn't have direct dependency on Orion .
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.
You're right, architecturally, but I would propose to merge it like that and to open an issue for it:
- I'm on PTO in around 2 hours and I'd like to get this merged
- Investing in architectural integrity of the gwt ide seems low prio.
*/ | ||
package org.eclipse.che.ide.editor.orion.client.jso; | ||
|
||
/** |
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.
Please, place javadoc after imports.
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.
Strange that the formatter does not reorder that.
|
||
protected MarkedOverlay() {} | ||
|
||
public static Promise<MarkedOverlay> getMarkedPromise() { |
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.
'getReady()` sounds better
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.
Other classes use this pattern, see org.eclipse.che.ide.editor.orion.client.EditorInitializePromiseHolder.getInitializerPromise()
*/ | ||
package org.eclipse.che.ide.editor.orion.client.jso; | ||
|
||
/** |
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.
Should be before class declaration
@@ -566,9 +566,7 @@ public void runActionForTabFromContextMenu(TabActionLocator tabAction) { | |||
* @param text text which should be typed | |||
*/ | |||
public void typeTextIntoEditor(String text) { | |||
loader.waitOnClosed(); |
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.
loader.waitOnClosed();
is needed here to be sure the loader is not displayed in front of editor, or it is gone after the text has been pasted.
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.
loader.waitOnClosed() does at least a one second wait. On this one, I am not sure, but I'd like to try removing it. We can reenable it if the test start failing.
Generally, I think this is the wrong approach. We should be testing for conditions that we need, for example we want the editor to have keyboard focus.
@@ -897,7 +894,7 @@ public void selectItemIntoAutocompleteAndPerformDoubleClick(String item) { | |||
*/ | |||
public void selectAutocompleteProposal(String item) { | |||
seleniumWebDriverHelper.waitAndClick( | |||
By.xpath(format(AUTOCOMPLETE_CONTAINER + "/li/span[text()='%s']", item))); |
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.
Could you, please, explain what text()
was replaced by .
in xpath "/li/span[text()='%s']" for?
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.
. recursively takes the text in all subelements ("foo <span>bar</span>"
is "foo bar", whereas in "text()" it woudl be "foo ".
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 see, thank you for explanation.
webDriverWaitFactory | ||
.get(timeout) | ||
.withMessage( | ||
() -> { | ||
return "expected \n'" + expectedText + "'\nbut was \n'" + actual[0] + "'\n"; |
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.
Great idea!
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 introduced this in order to see why the teste failed. It makes fixing much more convenient.
@@ -290,8 +290,6 @@ public void waitItem(String path) { | |||
* @param timeout waiting timeout in seconds | |||
*/ | |||
public void waitItem(String path, int timeout) { | |||
loader.waitOnClosed(); |
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 need to ensure that there is no loader in front of IDE to make the tests more stable.
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.
No, that makes no sense! In Pseudocode, this would read:
- wait for condition x
- wait for condition y.
if we never do anything with "x", we can just remove the first wait. If the wait is too short, then, we should increase the timeout.
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.
This method is being called from other tests which rely on loader.waitOnClosed()
. If you are removing this wait from the method, you should add loader.waitOnClosed()
to the callers.
* Use Orion's "marked" to support markdown in doc popups Signed-off-by: Thomas Mäder <tmader@redhat.com>
* Use Orion's "marked" to support markdown in doc popups Signed-off-by: Thomas Mäder <tmader@redhat.com>
* Use Orion's "marked" to support markdown in doc popups Signed-off-by: Thomas Mäder <tmader@redhat.com>
* Use Orion's "marked" to support markdown in doc popups Signed-off-by: Thomas Mäder <tmader@redhat.com>
* Use Orion's "marked" to support markdown in doc popups Signed-off-by: Thomas Mäder <tmader@redhat.com>
* Use Orion's "marked" to support markdown in doc popups Signed-off-by: Thomas Mäder <tmader@redhat.com>
* Use Orion's "marked" to support markdown in doc popups Signed-off-by: Thomas Mäder <tmader@redhat.com>
* Use Orion's "marked" to support markdown in doc popups Signed-off-by: Thomas Mäder <tmader@redhat.com>
* Use Orion's "marked" to support markdown in doc popups Signed-off-by: Thomas Mäder <tmader@redhat.com>
* Use Orion's "marked" to support markdown in doc popups Signed-off-by: Thomas Mäder <tmader@redhat.com>
* Use Orion's "marked" to support markdown in doc popups Signed-off-by: Thomas Mäder <tmader@redhat.com>
* Use Orion's "marked" to support markdown in doc popups Signed-off-by: Thomas Mäder <tmader@redhat.com>
* Use Orion's "marked" to support markdown in doc popups Signed-off-by: Thomas Mäder <tmader@redhat.com>
* Use Orion's "marked" to support markdown in doc popups Signed-off-by: Thomas Mäder <tmader@redhat.com>
* Use Orion's "marked" to support markdown in doc popups Signed-off-by: Thomas Mäder <tmader@redhat.com>
* Use Orion's "marked" to support markdown in doc popups Signed-off-by: Thomas Mäder <tmader@redhat.com>
What does this PR do?
Adds handling of markdown in the widgets that show additional doc (i.e. javadoc) for completions and signature help in LSP editors.
What issues does this PR fix or reference?
#10499