You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
Currently, using "Go to definition" with the MS Language Server will jump you to your import statement, likely at the top of your file, rather than jumping you into the class. I understand from a separate issue #850 that this is the intended behavior. Below is a gif of it.
In my view, "Go to definition" means that you go to where the class is defined. Taking me to the top of the file and showing me the import statement doesn't seem nearly as widely used or necessary as jumping directly to where the class is implemented.
Imagine you were in the full version of Visual Studio coding in C#, "Go to definition" would take you to the definition of your class.
If we insist that we need a separate feature to navigate us to the import statement, it seems that we should make a separate button and keyboard shortcut called "Go to declaration", and leave the "Go to definition" function to be the same behavior as Jedi.
The LSP spec has both definition and declaration as of 3.14.0; perhaps we should implement both and have definition recurse until it hits the true assignment.
Sure. 'Bug' is when something intended to work certain way, but it doesn't. If something is implemented certain way intentionally, with the appropriate test, and it works as designed, it is not technically a bug. Sure, it could be a wrong choice though :-)
Mikhail Arkhipov (@MikhailArkhipov) I don't know about language server implementation, but you also may to look at below issues together as it appears to me to originate from same design (if I am wrong, excuse me for making false noise)
All references are not listed when using ms language server #1174, here not all references are identified (directly imported symbols are only considered for reference, it is not considered as referenced if used as <module>.<symbol>. Sounds like same inconsistency I spoke about in my earlier comment)
import statements are listed as part of reference, though you can argue about this, jedi and other language server implementations (for other languages like java etc.,) doesn't list imports as reference. IMO, imports are not references.
Activity
jakebailey commentedon May 29, 2019
The LSP spec has both definition and declaration as of 3.14.0; perhaps we should implement both and have definition recurse until it hits the true assignment.
MikhailArkhipov commentedon May 29, 2019
#494
jahan01 commentedon Jun 5, 2019
this should be a bug, not the intended behaviour. Going by the name
Go to definitionshould take to definition, not to the import.And even if it is intended behaviour (then it should be called something else, IMO), it is not consistent, like in below situations
constants.pyrun.pyGoto definitionofconstants.a_simple_function()takes toconstants.pydirectly where asa_simple_functiontakes to import and then to definitionJake Bailey (@jakebailey) Mikhail Arkhipov (@MikhailArkhipov)
MikhailArkhipov commentedon Jun 5, 2019
Sure. 'Bug' is when something intended to work certain way, but it doesn't. If something is implemented certain way intentionally, with the appropriate test, and it works as designed, it is not technically a bug. Sure, it could be a wrong choice though :-)
jahan01 commentedon Jun 8, 2019
Mikhail Arkhipov (@MikhailArkhipov) I don't know about language server implementation, but you also may to look at below issues together as it appears to me to originate from same design (if I am wrong, excuse me for making false noise)
<module>.<symbol>. Sounds like same inconsistency I spoke about in my earlier comment)