MCPcopy
hub / github.com/foambubble/foam / createVSCodeUri

Function createVSCodeUri

packages/foam-vscode/src/test/vscode-mock.ts:220–259  ·  view source on GitHub ↗
(foamUri: URI)

Source from the content-addressed store, hash-verified

218
219// Adapter to convert Foam URI to VS Code Uri
220export function createVSCodeUri(foamUri: URI): Uri {
221 const uri: Uri = Object.defineProperties(
222 {
223 scheme: foamUri.scheme,
224 authority: foamUri.authority,
225 path: foamUri.path,
226 query: foamUri.query,
227 fragment: foamUri.fragment,
228 fsPath: foamUri.toFsPath(),
229 },
230 {
231 with: {
232 value(change: Parameters<Uri['with']>[0]) {
233 return createVSCodeUri(foamUri.with(change));
234 },
235 enumerable: false,
236 },
237 toString: {
238 value() {
239 return foamUri.toString();
240 },
241 enumerable: false,
242 },
243 toJSON: {
244 value() {
245 return {
246 scheme: foamUri.scheme,
247 authority: foamUri.authority,
248 path: foamUri.path,
249 query: foamUri.query,
250 fragment: foamUri.fragment,
251 fsPath: foamUri.toFsPath(),
252 };
253 },
254 enumerable: false,
255 },
256 }
257 ) as Uri;
258 return uri;
259}
260
261/**
262 * Convert VS Code Uri to Foam URI

Callers 11

valueFunction · 0.85
fileFunction · 0.85
parseFunction · 0.85
fromFunction · 0.85
joinPathFunction · 0.85
entriesMethod · 0.85
findFilesFunction · 0.85
openTextDocumentFunction · 0.85
applyEditFunction · 0.85
initializeWorkspaceFunction · 0.85

Calls 1

toFsPathMethod · 0.80

Tested by

no test coverage detected