Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

Manage SourceMap lacks #3

Open
XVincentX opened this issue Jul 18, 2016 · 2 comments
Open

Manage SourceMap lacks #3

XVincentX opened this issue Jul 18, 2016 · 2 comments

Comments

@XVincentX
Copy link
Owner

XVincentX commented Jul 18, 2016

Actually the source map reference for a particular symbol is done guessing where the reference could be

      /*
        Unfortunately drafter is missing some required sourcemaps, so as a
        temporaney solution, I have to try to lookup into multiple paths.
      */
      let sourceMap = lodash.get(queryResult, 'attributes.sourceMap',
        lodash.get(queryResult, 'meta.title.attributes.sourceMap',
          lodash.get(queryResult, 'attributes.href.attributes.sourceMap',
            lodash.get(queryResult, 'content[0].attributes.method.attributes.sourceMap')
          )
        )
      );

While this actually kind-of-works, it can miss better sourcemaps developed with future drafter version as well not get all cases.

  1. The idea here would be that, when missing sourcemaps on queried element, a refract-query call should be performed with a 1 limit, and use that as nearest sourcemap
  2. Another idea would be take first AND last sourcemaps object from the childs and compute the block from those ones. Mark them as inferred, eventually.

It would be a great idea to signal this thing to VSCode some how, like "Hey, this is not the precise sourcemap, but this is the nearest I was able to find."

@XVincentX
Copy link
Owner Author

This has been partially solved in #4

I still cannot track entire objects, but I do not have to use those horrible fallbacks anymore.

@XVincentX
Copy link
Owner Author

Actually this might really need a modification in the parser. Will see about that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant