-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support string constants for embedded languages
- Loading branch information
Showing
3 changed files
with
173 additions
and
2 deletions.
There are no files selected for viewing
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
43 changes: 43 additions & 0 deletions
43
...org/springframework/ide/vscode/boot/java/embedded/lang/StringConstantLanguageSnippet.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,43 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2025 Broadcom, Inc. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Broadcom, Inc. - initial API and implementation | ||
*******************************************************************************/ | ||
package org.springframework.ide.vscode.boot.java.embedded.lang; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import org.springframework.ide.vscode.commons.util.text.IRegion; | ||
|
||
public class StringConstantLanguageSnippet implements EmbeddedLanguageSnippet { | ||
|
||
final private int offset; | ||
final private String value; | ||
|
||
public StringConstantLanguageSnippet(int offset, String value) { | ||
this.offset = offset; | ||
this.value = value; | ||
} | ||
|
||
@Override | ||
public List<IRegion> toJavaRanges(IRegion range) { | ||
return Collections.emptyList(); | ||
} | ||
|
||
@Override | ||
public int toJavaOffset(int offset) { | ||
return this.offset; | ||
} | ||
|
||
@Override | ||
public String getText() { | ||
return value; | ||
} | ||
|
||
} |
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