Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,16 @@ public class XMLCompletionSettings {

private boolean autoCloseRemovesContent;

public XMLCompletionSettings(boolean autoCloseTags, boolean autoCloseRemovesContent) {
private boolean fileCompletion;
Copy link
Contributor

@angelozerr angelozerr Mar 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This settings belongs to the file path extension, so please don't add that in this class. I suggest that you see sample like https://github.com/eclipse/lemminx/blob/master/org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/extensions/contentmodel/settings/ContentModelSettings.java

In other words, you should create a settings/FilePathSettings.java in https://github.com/eclipse/lemminx/blob/master/org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/extensions/general

Please rename general to filepath to have org.eclipse.lemminx.extensions.filepath instead of org.eclipse.lemminx.extensions.general package and update too https://github.com/eclipse/lemminx/blob/1a70ccf0434354dee821e5e5f8111277378a57b4/org.eclipse.lemminx/src/main/resources/META-INF/services/org.eclipse.lemminx.services.extensions.IXMLExtension#L9


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) {
Expand Down Expand Up @@ -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 <code>true</code> if the client support snippet and
* <code>false</code> otherwise.
Expand All @@ -101,5 +122,6 @@ public boolean isCompletionSnippetsSupported() {
public void merge(XMLCompletionSettings newCompletion) {
this.setAutoCloseTags(newCompletion.isAutoCloseTags());
this.setAutoCloseRemovesContent(newCompletion.isAutoCloseRemovesContent());
this.setFileCompletionEnabled(newCompletion.isFileCompletionEnabled());
}
}