Skip to content

playwright-python's autocomplete support in vscode #240

@b7wch

Description

@b7wch

I use the examplel code of the project, but vscode can not list the autocomplete hints.
Env
python: 3.8
vscode:September 2020 (version 1.50)

import asyncio
from playwright import async_playwright
import time


async def main():
    async with async_playwright() as p:
        browser_type = p.chromium
        browser = await browser_type.launch(headless=False, args=['--start-maximized'])
        page = await browser.newPage()

        await page.goto('http://whatsmyuseragent.org/')
        await page.screenshot(path=f'example-{browser_type.name}.png')

        await asyncio.sleep(100)
        await browser.close()

asyncio.get_event_loop().run_until_complete(main())

And I see the launch method's return type hints is a specific string, is it be supported by vscode?

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions