How to use the vscode-uri.URI.isUri function in vscode-uri

To help you get started, we’ve selected a few vscode-uri examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jonnyboyC / kos-language-server / server / src / utilities / pathUtilities.ts View on Github external
export const normalizeExtensions = (uri: URI | string): Maybe => {
  const ext = URI.isUri(uri) ? extname(uri.fsPath) : extname(uri);
  const uriString = uri.toString();

  switch (ext) {
    case '.ks':
      return uriString;
    case '.ksm':
      return uriString.replace('.ksm', '.ks');
    case '':
      return `${uriString}.ks`;
    default:
      return undefined;
  }
};