pull/5370/head
bunsenstraat 3 years ago committed by GitHub
parent c60f1f4b55
commit ad7ef24010
  1. 8
      libs/remix-ui/editor/src/lib/providers/definitionProvider.ts

@ -39,10 +39,16 @@ export class RemixDefinitionProvider implements monaco.languages.DefinitionProvi
*/
async jumpToPosition(position: any) {
const jumpToLine = async (fileName: string, lineColumn: any) => {
const fileTarget = await this.props.plugin.call('fileManager', 'getPathFromUrl', fileName)
if (fileName !== await this.props.plugin.call('fileManager', 'file')) {
await this.props.plugin.call('contentImport', 'resolveAndSave', fileName, null)
const fileContent = await this.props.plugin.call('fileManager', 'readFile', fileName)
try {
await this.props.plugin.call('editor', 'addModel', fileTarget.file, fileContent)
} catch (e) {
}
}
const fileTarget = await this.props.plugin.call('fileManager', 'getPathFromUrl', fileName)
if (lineColumn.start && lineColumn.start.line >= 0 && lineColumn.start.column >= 0) {
const pos = {
startLineNumber: lineColumn.start.line + 1,

Loading…
Cancel
Save