Standardise naming of openDocId as openDocWithId or currentDocumentId (#23307)

GitOrigin-RevId: d71b6d878188c7b916f02a3749976ecd96d648a3
This commit is contained in:
Alf Eaton
2025-02-05 09:05:15 +00:00
committed by Copybot
parent d899144d43
commit 87186eb568
15 changed files with 65 additions and 65 deletions
@@ -12,7 +12,7 @@ import {
export const useIncludedFile = (argumentType: string) => {
const state = useCodeMirrorStateContext()
const { findEntityByPath } = useFileTreePathContext()
const { openDocId } = useEditorManagerContext()
const { openDocWithId } = useEditorManagerContext()
const openIncludedFile = useCallback(() => {
const name = readIncludedPath(state, argumentType)
@@ -21,12 +21,12 @@ export const useIncludedFile = (argumentType: string) => {
for (const extension of ['.tex', '']) {
const result = findEntityByPath(`${name}${extension}`)
if (result) {
return openDocId(result.entity._id)
return openDocWithId(result.entity._id)
}
}
// TODO: handle file not found
}
}, [argumentType, findEntityByPath, openDocId, state])
}, [argumentType, findEntityByPath, openDocWithId, state])
return { openIncludedFile }
}