forked from redhat-developer/quarkus-ls
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vscode-quarkus should not be a Java formatter
Fixed redhat-developer/vscode-quarkus#166 Signed-off-by: azerr <azerr@redhat.com>
- Loading branch information
1 parent
475d3a1
commit ea29f08
Showing
3 changed files
with
96 additions
and
11 deletions.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
...rc/main/java/com/redhat/microprofile/settings/capabilities/FormattingRegisterOptions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/** | ||
* Copyright (c) 2020 Red Hat, Inc. and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v2.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v20.html | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Red Hat Inc. - initial API and implementation | ||
*/ | ||
package com.redhat.microprofile.settings.capabilities; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
import java.util.stream.Stream; | ||
|
||
/** | ||
* Formatting options to inform to the client that only properties file are | ||
* supported for formatting. | ||
* | ||
* <pre> | ||
* | ||
* "registerOptions": { | ||
"documentSelector": [ | ||
{ "language": "microprofile-properties" }, | ||
{ "language": "quarkus-properties" } | ||
] | ||
} | ||
* </pre> | ||
* | ||
*/ | ||
public class FormattingRegisterOptions { | ||
|
||
public static class DocumentFilter { | ||
|
||
private String language; | ||
|
||
public DocumentFilter(String language) { | ||
this.language = language; | ||
} | ||
|
||
public String getLanguage() { | ||
return language; | ||
} | ||
} | ||
|
||
private final List<DocumentFilter> documentSelector; | ||
|
||
public FormattingRegisterOptions(String... languages) { | ||
this.documentSelector = Stream.of(languages).map(language -> new DocumentFilter(language)) | ||
.collect(Collectors.toList()); | ||
} | ||
|
||
public List<DocumentFilter> getDocumentSelector() { | ||
return documentSelector; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters