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

normalize lsp line number, fix definition info for namespaced imports #86

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

minedeljkovic
Copy link

This fixes a bug that vscode refuses to go to definition of a namespaced import such as this based on information received from LSP server.

The problem is that LSP server returns negative line number. This comes up because:

  1. flow returns a line number 0 from get-def in this case
  2. nuclide's flow service (used by LSP server) decrements line number on this line

I am aware this could be treated as an upstream issue, but:

  1. flow has a test for this, so it seems that this behavior is by design.
  2. it seems that atom/nuclide does not mind negative line number, so the nuclide team might not be interested in this.

Based on this, I concluded this is the best place to fix this.

@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

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

Successfully merging this pull request may close these issues.

2 participants