Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/langium/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"chevrotain-allstar": "~0.3.0",
"vscode-languageserver": "~9.0.1",
"vscode-languageserver-textdocument": "~1.0.11",
"vscode-uri": "~3.0.7"
"vscode-uri": "~3.0.8"
},
"devDependencies": {
"langium-cli": "~2.0.0"
Expand Down
22 changes: 6 additions & 16 deletions packages/langium/src/utils/uri-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,17 @@
* terms of the MIT License, which is available in the project root.
******************************************************************************/

import * as vscodeUri from 'vscode-uri';

// Node.js and some bundlers don't deal well with the type information in `vscode-uri`
// This is a workaround to support all runtimes and bundlers
let uri = vscodeUri;
if ('default' in uri) {
uri = uri.default as typeof uri;
}

type URI = vscodeUri.URI;
const URI = uri.URI;
import { URI, Utils } from 'vscode-uri';

export { URI };

export namespace UriUtils {

export const basename = uri.Utils.basename;
export const dirname = uri.Utils.dirname;
export const extname = uri.Utils.extname;
export const joinPath = uri.Utils.joinPath;
export const resolvePath = uri.Utils.resolvePath;
export const basename = Utils.basename;
export const dirname = Utils.dirname;
export const extname = Utils.extname;
export const joinPath = Utils.joinPath;
export const resolvePath = Utils.resolvePath;

export function equals(a?: URI | string, b?: URI | string): boolean {
return a?.toString() === b?.toString();
Expand Down