MCPcopy Create free account
hub / github.com/dethcrypto/dethcode / showTextDocument

Function showTextDocument

packages/ethereum-viewer/src/openContractSource.ts:145–161  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

143}
144
145async function showTextDocument(path: string) {
146 // We're trying to open the file even if it doesn't exist yet.
147 // Because the following seems to be very slow:
148 // // onFileChangeOnce(
149 // // context,
150 // // fs,
151 // // mainFile,
152 // // (e) => void showTextDocument(e.uri.path)
153 // // );
154 // It's causing some errors in the console, but in the end it provides better UX.
155 await window.showTextDocument(
156 Uri.from({ scheme: "memfs", path: "/" + path })
157 );
158 await commands.executeCommand(
159 "workbench.files.action.showActiveFileInExplorer"
160 );
161}
162
163const byPathLength = (
164 a: [string, ...unknown[]],

Callers 1

openContractSourceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected