-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix definition and references uri for virtual documents
Signed-off-by: Aman Prashant <aman.prashant@broadcom.com>
- Loading branch information
Showing
3 changed files
with
44 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
40 changes: 40 additions & 0 deletions
40
server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/handlers/text/HandlerUtility.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,40 @@ | ||
/* | ||
* Copyright (c) 2024 Broadcom. | ||
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Broadcom, Inc. - initial API and implementation | ||
* | ||
*/ | ||
package org.eclipse.lsp.cobol.lsp.handlers.text; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
import lombok.experimental.UtilityClass; | ||
import org.eclipse.lsp.cobol.service.UriDecodeService; | ||
import org.eclipse.lsp4j.Location; | ||
|
||
/** | ||
* Class with utility methods for {@link org.eclipse.lsp.cobol.lsp.LspEvent} handlers | ||
*/ | ||
@UtilityClass | ||
public class HandlerUtility { | ||
/** | ||
* Maps the provided location to the original location which triggered the request. | ||
* @param decodedLocations locations with decoded uri's | ||
* @param service {@link UriDecodeService} | ||
* @return mapped locations | ||
*/ | ||
List<Location> mapToOriginalLocation(List<Location> decodedLocations, UriDecodeService service) { | ||
return decodedLocations.stream().map(loc -> { | ||
loc.setUri(service.getOriginalUri(loc.getUri())); | ||
return loc; | ||
}).collect(Collectors.toList()); | ||
} | ||
} |
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