Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Respect option follow_imports in goto_assignments call#404

Merged
gatesn merged 5 commits intopalantir:developpalantir/python-language-server:developfrom
st4lk:add-option-follow-importsst4lk/python-language-server:add-option-follow-importsCopy head branch name to clipboard
Sep 19, 2018
Merged

Respect option follow_imports in goto_assignments call#404
gatesn merged 5 commits intopalantir:developpalantir/python-language-server:developfrom
st4lk:add-option-follow-importsst4lk/python-language-server:add-option-follow-importsCopy head branch name to clipboard

Conversation

@st4lk
Copy link
Contributor

@st4lk st4lk commented Aug 20, 2018

Add an ability to specify follow_imports, follow_builtin_imports options in goto_assignments call: https://jedi.readthedocs.io/en/latest/docs/api.html#jedi.Script.goto_assignments

Copy link
Contributor

@gatesn gatesn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally open to allowing more configuration here, but would like the config documented in package.json.

def pyls_definitions(document, position):
definitions = document.jedi_script(position).goto_assignments()
def pyls_definitions(config, document, position):
expected_settings = {'follow_imports', 'follow_builtin_imports'}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't tend to like defensively checking this.

definitions = document.jedi_script(position).goto_assignments()
def pyls_definitions(config, document, position):
expected_settings = {'follow_imports', 'follow_builtin_imports'}
params = {k: v for k, v in config.settings().items() if k in expected_settings}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Config should be namespaced by the plugin, e.g. pyls.plugins.jedi_definition https://github.com/palantir/python-language-server/blob/develop/vscode-client/package.json#L38

@st4lk
Copy link
Contributor Author

st4lk commented Aug 26, 2018

Updated

@tmc
Copy link

tmc commented Aug 29, 2018

@st4lk there are a couple of test failures: E TypeError: pyls_definitions() takes exactly 3 arguments (2 given)

@st4lk
Copy link
Contributor Author

st4lk commented Aug 29, 2018

@tmc fixed

@tmc
Copy link

tmc commented Sep 4, 2018

@gatesn ping

def pyls_definitions(document, position):
definitions = document.jedi_script(position).goto_assignments()
def pyls_definitions(config, document, position):
params = {k: v for k, v in config.plugin_settings('jedi_definition').items() if k}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does if k do here? Do you mean if v ? If you do, I think it should be if v is not None. Else if someone passes False for a property that jedi defaults to True, then the override won't be applied.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gatesn Fixed

@gatesn gatesn merged commit fb500ae into palantir:develop Sep 19, 2018
@tmc
Copy link

tmc commented Sep 22, 2018

can we get a release cut for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.