-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add contents to the Document vertex (#43)
- Loading branch information
Showing
6 changed files
with
105 additions
and
19 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
33 changes: 33 additions & 0 deletions
33
com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/LsifUtils.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,33 @@ | ||
/* -------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
* ------------------------------------------------------------------------------------------ */ | ||
|
||
package com.microsoft.java.lsif.core.internal; | ||
|
||
import java.util.Base64; | ||
|
||
import org.eclipse.core.runtime.Platform; | ||
|
||
public class LsifUtils { | ||
|
||
private LsifUtils() { | ||
} | ||
|
||
/** | ||
* Normalize the URI to the same format as the client. | ||
*/ | ||
public final static String normalizeUri(String uri) { | ||
if (Platform.OS_WIN32.equals(Platform.getOS())) { | ||
if (uri.startsWith("file:///") && uri.length() > 10 && Character.isUpperCase(uri.charAt(8)) | ||
&& uri.charAt(9) == ':') { | ||
return "file:///" + Character.toLowerCase(uri.charAt(8)) + uri.substring(9); | ||
} | ||
} | ||
return uri; | ||
} | ||
|
||
public static String encodeToBase64(String input) { | ||
return Base64.getEncoder().withoutPadding().encodeToString(input.getBytes()); | ||
} | ||
} |
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
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