Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

No completions for requests.Response type #564

Closed
qubitron opened this issue Jan 29, 2019 · 6 comments · Fixed by #546
Closed

No completions for requests.Response type #564

qubitron opened this issue Jan 29, 2019 · 6 comments · Fixed by #546
Assignees
Labels
bug Something isn't working feature: intellisense
Milestone

Comments

@qubitron
Copy link

qubitron commented Jan 29, 2019

A case to test with the new analysis code:
image

requests.get shows it returns a requests.Response type:
image

Jedi:
image

@jakebailey
Copy link
Member

With #546:

image

@qubitron
Copy link
Author

qubitron commented Feb 2, 2019

Nice! We are picking up more completions, and have different icons for properties vs. functions (content is a property, close is a function).

Curious why cookies/elapsed/encoding show as "ABC" vs. the orange icon shown in Jedi. I'm not sure what the icons mean exactly but we might need to double check we're using the right ones in the right places.

@jakebailey
Copy link
Member

It's just a completion item kind choice which we'd change to match the old LS. In typeshed:

class Response: # truncated
    encoding = ...  # type: str
    cookies = ...  # type: RequestsCookieJar
    elapsed = ...  # type: datetime.timedelta
    def iter_content(self, chunk_size: Optional[int] = ...,
                     decode_unicode: bool = ...) -> Iterator[Any]: ...
    def iter_lines(self, chunk_size=..., decode_unicode=..., delimiter=...): ...
    @property
    def content(self) -> bytes: ...
    @property
    def text(self) -> str: ...

The wrench is the VSC icon for property.

@jakebailey
Copy link
Member

Though this unfortunately shows that we need to parse out those type comments to fully support the requests hints.

@MikhailArkhipov
Copy link

#7 currently not GA but can be.

@qubitron
Copy link
Author

qubitron commented Feb 4, 2019

We may not need to block GA on the type hints, but should probably add support for them soon after.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working feature: intellisense
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants