-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve link handling in markdown links #120
Conversation
- Extend EditorManager to have more flexible selection resolution - Allow adopters to register selection resolvers -- Provide selection resolver for GitHub location syntax -- Provide selection resolver for TypeDoc symbol navigation -- Provide selection provider for fragment textual search - Fix minor issue in editor-manager where URI is not passed properly Fixes eclipsesource/osweek-2024#18
cd464f4
to
452bb05
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks pretty good to me and works well to me. I have only two tiny remarks/questions inline :)
const input = uri.toString(); | ||
const hashIndex = input.indexOf('#'); | ||
return hashIndex === -1 ? undefined : input.substring(hashIndex + 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'm missing something but couldn't you just use uri.fragment
to get the fragment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! I was starting with string manipulation and only later moved it into the editor manager where we already have the URI, thank you!
const input = uri.toString(); | ||
const hashIndex = input.indexOf('#'); | ||
return hashIndex === -1 ? undefined : input.substring(hashIndex + 1).split('.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'm missing something but couldn't you just use uri.fragment to get the fragment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above, good catch, thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks ✨
What it does
-- Provide selection resolver for GitHub location syntax
-- Provide selection resolver for TypeDoc symbol navigation
-- Provide selection provider for fragment textual search
Fixes https://github.com/eclipsesource/osweek-2024/issues/18
How to test
file://<path>#<location>
where location isL<start-line>C<start-column>-L<end-line>C<end-column>
(end position is optional and all columns are optional as well)file://<path>#<symbol-path>
where symbol path can be just the symbol name (e.g., a function name in TypeScript) or a nested path in the form ofparent.child
(e.g., a function nested in a namespace). Ensure symbols are actually provided for your document by checking the Outline or triggering the command 'Go to Symbol...` (not Go to Symbol in Workspace...).file://<path>#<text>
Follow-ups
Review checklist
Reminder for reviewers