From 335dddb6dd1901393bf21fcc804a86e8c65d3cef Mon Sep 17 00:00:00 2001 From: Alexander Chen Date: Mon, 28 Feb 2022 15:59:57 -0500 Subject: [PATCH] Added setting to disable files in completion settings Signed-off-by: Alexander Chen --- .../settings/XMLCompletionSettings.java | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/settings/XMLCompletionSettings.java b/org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/settings/XMLCompletionSettings.java index f816c5915..cd54cca98 100644 --- a/org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/settings/XMLCompletionSettings.java +++ b/org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/settings/XMLCompletionSettings.java @@ -26,13 +26,16 @@ public class XMLCompletionSettings { private boolean autoCloseRemovesContent; - public XMLCompletionSettings(boolean autoCloseTags, boolean autoCloseRemovesContent) { + private boolean fileCompletion; + + public XMLCompletionSettings(boolean autoCloseTags, boolean autoCloseRemovesContent, boolean fileCompletion) { this.autoCloseTags = autoCloseTags; this.autoCloseRemovesContent = autoCloseRemovesContent; + this.fileCompletion = fileCompletion; } public XMLCompletionSettings() { - this(true, true); + this(true, true, true); } public void setCapabilities(CompletionCapabilities completionCapabilities) { @@ -79,6 +82,24 @@ public boolean isAutoCloseRemovesContent() { return autoCloseRemovesContent; } + /** + * Configure the file completion options in completion + * + * @param fileCompletionEnabled + */ + public void setFileCompletionEnabled(boolean fileCompletionEnabled) { + this.fileCompletion = fileCompletionEnabled; + } + + /** + * Returns true if turning files should be included in completion and false otherwise + * + * @return true if turning files should be included in completion and false otherwise + */ + public boolean isFileCompletionEnabled() { + return fileCompletion; + } + /** * Returns true if the client support snippet and * false otherwise. @@ -101,5 +122,6 @@ public boolean isCompletionSnippetsSupported() { public void merge(XMLCompletionSettings newCompletion) { this.setAutoCloseTags(newCompletion.isAutoCloseTags()); this.setAutoCloseRemovesContent(newCompletion.isAutoCloseRemovesContent()); + this.setFileCompletionEnabled(newCompletion.isFileCompletionEnabled()); } }