-
Notifications
You must be signed in to change notification settings - Fork 93
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
Configure limit for textDocument/documentSymbol #637
Conversation
org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/XMLTextDocumentService.java
Outdated
Show resolved
Hide resolved
org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/services/XMLSymbolsProvider.java
Outdated
Show resolved
Hide resolved
@xorye see my draft PR #638 which should fix all issues that you have noticed. The main idea of my draft PR is to:
public class SymbolInformationsResult extends ArrayList<SymbolInformation> {
private static final long serialVersionUID = 1L;
private transient boolean resultLimitExceeded;
public boolean isResultLimitExceeded() {
return resultLimitExceeded;
}
public void setResultLimitExceeded(boolean resultLimitExceeded) {
this.resultLimitExceeded = resultLimitExceeded;
}
}
Please note I write my PT quickly without testing it, perhaps there are some bugs. I would like to avoid using standard LSP showMessage and I would prefer having a custom LSP notification for that (like JSON LS does), I mean having a custom notification 'xml/resultLimitReached'. Client could react of this notification with other mean than just display a message if he wants. |
org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/client/ExtendedSymbolCapabilities.java
Outdated
Show resolved
Hide resolved
...java/org/eclipse/lemminx/services/extensions/documentSymbol/SymbolsLimitExceededCommand.java
Outdated
Show resolved
Hide resolved
Signed-off-by: David Kwon <[email protected]>
Signed-off-by: David Kwon <[email protected]>
Signed-off-by: David Kwon <[email protected]>
Signed-off-by: David Kwon <[email protected]>
@@ -27,6 +27,7 @@ | |||
import org.eclipse.lemminx.commons.ModelTextDocument; | |||
import org.eclipse.lemminx.commons.ParentProcessWatcher.ProcessLanguageServer; | |||
import org.eclipse.lemminx.customservice.AutoCloseTagResponse; | |||
import org.eclipse.lemminx.customservice.XMLLanguageClientAPI; | |||
import org.eclipse.lemminx.customservice.XMLCustomService; |
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 rename XMLCustomService to XMLLanguageServerAPI please.
* @param wrapper - a function for plugging in additional message | ||
* consumers | ||
*/ | ||
public static Launcher<LanguageClient> createServerLauncher(LanguageServer server, InputStream in, OutputStream out, |
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.
private static
org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/XMLTextDocumentService.java
Outdated
Show resolved
Hide resolved
org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/XMLTextDocumentService.java
Outdated
Show resolved
Hide resolved
@@ -460,6 +492,10 @@ public void updateCodeLensSettings(XMLCodeLensSettings newSettings) { | |||
codeLensSettings.setEnabled(newSettings.isEnabled()); | |||
} | |||
|
|||
public void updateMaxItemsComputed(int maxItemsComputed) { |
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.
Add Javadoc
org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/client/ClientCommands.java
Outdated
Show resolved
Hide resolved
org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/client/ExtendedClientCapabilities.java
Show resolved
Hide resolved
org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/client/ExtendedClientCapabilities.java
Show resolved
Hide resolved
org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/client/ExtendedClientCapabilities.java
Show resolved
Hide resolved
org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/client/ExtendedClientCapabilities.java
Show resolved
Hide resolved
org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/customservice/ActionableNotification.java
Show resolved
Hide resolved
org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/customservice/ActionableNotification.java
Outdated
Show resolved
Hide resolved
org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/customservice/XMLLanguageClientAPI.java
Show resolved
Hide resolved
org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/services/DocumentSymbolsResult.java
Show resolved
Hide resolved
org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/services/DocumentSymbolsResult.java
Outdated
Show resolved
Hide resolved
org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/services/SymbolInformationsResult.java
Outdated
Show resolved
Hide resolved
org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/services/SymbolInformationsResult.java
Outdated
Show resolved
Hide resolved
org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/services/XMLSymbolsProvider.java
Show resolved
Hide resolved
org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/settings/SharedSettings.java
Show resolved
Hide resolved
org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/settings/XMLGeneralClientSettings.java
Outdated
Show resolved
Hide resolved
org.eclipse.lemminx/src/test/java/org/eclipse/lemminx/services/XMLDocumentSymbolsTest.java
Outdated
Show resolved
Hide resolved
org.eclipse.lemminx/src/test/java/org/eclipse/lemminx/services/XMLSymbolInformationsTest.java
Outdated
Show resolved
Hide resolved
org.eclipse.lemminx/src/test/java/org/eclipse/lemminx/services/XMLSymbolInformationsTest.java
Outdated
Show resolved
Hide resolved
This reverts commit d0e7b9c.
org.eclipse.lemminx/src/test/java/org/eclipse/lemminx/services/XMLSymbolInformationsTest.java
Outdated
Show resolved
Hide resolved
@angelozerr for the new javadoc, I am planning to use Would that be good? |
Signed-off-by: David Kwon <[email protected]>
Signed-off-by: David Kwon <[email protected]>
* @param xmlDocument the xml document that symbols were being computed for | ||
* @param symbolSettings the symbol settings | ||
*/ | ||
private void sendSymbolLimitNotification(DOMDocument xmlDocument, XMLSymbolSettings symbolSettings) { |
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 keep track whether the message has already been sent for this URI, for the rest of this JVM session, i.e keep a static Set of impacted URIs. See redhat-developer/vscode-xml#243
This PR is for redhat-developer/vscode-xml#237 . I would appreciate some feedback on it so far.
This PR currently implements the fix only for
SymbolInformations
.Here is the vscode-xml PR that goes along with this PR: redhat-developer/vscode-xml#238
Signed-off-by: David Kwon [email protected]