Skip to content
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

What features can we expect from new language server #2259

Closed
purpleP opened this issue Jul 26, 2018 · 1 comment
Closed

What features can we expect from new language server #2259

purpleP opened this issue Jul 26, 2018 · 1 comment

Comments

@purpleP
Copy link

purpleP commented Jul 26, 2018

Official blog post mentioned some form of sophisticated "execution simulation", but I've tried new language server and it seems to work worse than intellij or jedi static analysis. For example it doesn't autocomplete collections.namedtuple keyword arguments and attributes.

C = collections.namedtuple('C', 'foo bar')
c = C() # no autocomplete here for foo or bar
c. # no autocomplete here for foo or bar either 

It doesn't check for unhanded exceptions

def only_foo(arg):
    if arg != 'foo':
        raise ValueError()
    return 'bar'


b = only_foo(arg='bar') #simple constant folding shows that this would raise ValueError, what is your simulation actually simulates?

On the good side. Unlike intellij and jedi you autocomplete partial functions (shame on you intellij)

from functools import partial


def f(baz, bar):
    pass


g = partial(f, baz='a')
g() # shows that g has one argument named bar here

def part(f, *args, **kwargs):
    def wrapper(*args_, **kwargs_):
        return f(*args, *args_, **kwargs, **kwargs_)
    return wrapper


g = part(f, baz='a')
g() # shows that g has one argument named bar here

But then again you don't do quite simple analysis about simple errors

def f(foo):
    pass

f(bar='some') # simple analysis shows that this will raise TypeError about unexpected argument

It would be very nice to know what we can expect from you language server and should we bother to switch.

@brettcannon
Copy link
Member

We actually don't pre-announce anything as a team policy.

To support namedtuple you have to special-case it due to how namedtuple is implemented. As for more error analysis like your calling errors, we simply have not implemented them yet.

If you want to file separate issues for feature requests for error detection then please do.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants