profile
viewpoint
Jake Bailey jakebailey @Microsoft Python language server team at Microsoft :)

hortbot/hortbot 13

A Twitch IRC bot - the code behind CoeBot, AutoModBot (and of course, HortBot)

dotnet/vscode-dotnet-runtime 10

VSCode extension for acquiring .NET Core Tooling

jakebailey/plugingen 3

Code generator for hashicorp/go-plugin

jakebailey/irc 2

Fast IRC library in Go

jakebailey/tikfirehol 2

firehol blocklist to RouterOS address-list

jakebailey/docker-emby-vaapi 1

dperson/emby, but with repo ffmpeg and vaapi support via /dev/dri

jakebailey/dr 1

ERE derivative-based regex engine

jakebailey/irc-benchmarks 1

Go IRC library benchmarks (w/ IRCv3 tags)

jakebailey/ircold 1

Package irc implements generic support for the IRC protocol in Go.

jakebailey/secreplace 1

Go library for replacing sections of strings

issue commentmicrosoft/pyright

Building the server fails with missing worker_threads dependency

Pyright requires at least Node v12 to run, the first build to include worker threads without experimental flags. Is your node version too old?

rchl

comment created time in 2 days

issue commentmicrosoft/pylance-release

Go to symbol in Workspace very slow and lists non-workspace objects

Ah, I see what you mean by .vscode folders, the actual extension folders. We're returning results from our copy of the typeshed stubs, which isn't intended and likely the same issue as conda. These should be getting filtered to workspace only. Ensuring we only search the workspace would likely also help the performance.

robintw

comment created time in 2 days

pull request commentmicrosoft/vscode-python

Ensure we only have a single isort process running on a single file

Is the following scenario possible and/or something we should consider:

  • isort is triggered, so a promise is added to the map
  • more changes are made to the file, but the first promise hasn't completed yet
  • isort is triggered again, but we are discarding the incoming command since the first promise hasn't completed yet

This may be a scenario that causes microsoft/pylance-release#23 as well, but I don't know how VSC deals with multiple organizers.

karrtikr

comment created time in 2 days

Pull request review commentmicrosoft/vscode-python

Ensure we only have a single isort process running on a single file

 export class SortImportsEditingProvider implements ISortImportsEditingProvider {     public async provideDocumentSortImportsEdits(         uri: Uri,         token?: CancellationToken+    ): Promise<WorkspaceEdit | undefined> {+        if (this.isortPromises.has(uri.fsPath)) {+            if (!this.isortPromises.get(uri.fsPath)!.completed) {+                return;

The upshot here being that even though this code appears to make a promise, it's fully synchronous because it doesn't await any of them (or do a then, which is the same). Eventually, someone will yield and the promise will run, but not during this call.

(At least, that's my interpretation of node's semantics + skimming this function.)

karrtikr

comment created time in 2 days

Pull request review commentmicrosoft/vscode-python

Ensure we only have a single isort process running on a single file

 export class SortImportsEditingProvider implements ISortImportsEditingProvider {     public async provideDocumentSortImportsEdits(         uri: Uri,         token?: CancellationToken+    ): Promise<WorkspaceEdit | undefined> {+        if (this.isortPromises.has(uri.fsPath)) {+            if (!this.isortPromises.get(uri.fsPath)!.completed) {+                return;

Node is single threaded, so the only way to lose control is to do an await, which explicitly yields control back to the event loop to start running something else.

karrtikr

comment created time in 2 days

issue commentmicrosoft/pylance-release

Sort imports is severely bugged with Pylance language server

The race in the core extension will likely be fixed in microsoft/vscode-python#12728, but we didn't intend to enable our own import sorting at release, so it'll be disabled in the next release until we can better work out the dynamic between the different sorting providers.

ErwanDL

comment created time in 2 days

issue commentmicrosoft/pylance-release

Provide a way to search for symbols in libraries

Copy of my comment:

The LSP spec has workspace/symbol which traditionally only searches within the workspace/project: https://microsoft.github.io/language-server-protocol/specification#workspace_symbol

Searching libraries might need an LSP change to make it more clear that this is done (or we optionally do it anyway with some toggle).

Note that we are still restricted by the LSP and what the VS Code UI allows, they still call it "symbol in workspace".

ThiefMaster

comment created time in 2 days

issue commentmicrosoft/pylance-release

Sort imports is severely bugged with Pylance language server

We're still working on what "next release" or "hotfix" will mean, but I expect that this will be disabled in the next version (whichever that is) and we can see if that fixes the race.

ErwanDL

comment created time in 2 days

issue commentmicrosoft/pylance-release

Go to symbol in Workspace very slow and lists non-workspace objects

The LSP spec has workspace/symbol which traditionally only searches within the workspace/project: https://microsoft.github.io/language-server-protocol/specification#workspace_symbol

robintw

comment created time in 2 days

issue commentmicrosoft/pylance-release

Go to symbol in Workspace very slow and lists non-workspace objects

Symbol searching in Pylance is based on the analysis, but the symbol searching in MPLSv1 was a separate index in parallel that didn't involve the analysis (but would get things "wrong" as it has no context).

So there are a few things:

  • It may be slower because it may have to open files to extract symbols, but it shouldn't need to do a full analysis (just "binding" names to the symbol table). Do you have a repo somewhere we can test that shows this behavior?
  • It shouldn't show things in your conda environment, it should be limiting to the workspace, so that appears to be a bug.
  • As for .vscode, does that folder contain python code, or just JSON? If I recall correctly, VS Code's symbol search is done for all languages at once, so it may be searching symbols provided by say, the JSON language server.
robintw

comment created time in 2 days

issue closedmicrosoft/pylance-release

Docstrings

Release mentioned docstring support. Couldn't find anything.

How do you use it?

closed time in 2 days

Samrose-Ahmed

issue commentmicrosoft/pylance-release

Docstrings

Thanks for confirming!

Samrose-Ahmed

comment created time in 2 days

issue commentmicrosoft/pylance-release

Docstrings

It stays open if you open it once, until you repeat the step again to disable it. This is a VS Code behavior, you probably want to ask them to allow it to never be hidden.

I don't know what the key combo is on Mac, but the hover and click method will work to enable it.

Samrose-Ahmed

comment created time in 2 days

issue commentmicrosoft/pylance-release

Docstrings

You have it hidden in VS Code.

Hit Ctrl+Space, or hover over the completion item and click the "(i)" icon on the right.

Samrose-Ahmed

comment created time in 2 days

issue commentmicrosoft/pylance-release

Sort imports is severely bugged with Pylance language server

I think we may just disable the one in Pylance for now, and allow the core extension to continue to offer this using isort.

ErwanDL

comment created time in 2 days

issue commentmicrosoft/python-language-server

Platform-Specific Imports - Ignore 'Unresolved Import' for specific package

If you add # noqa to the line, does the message disappear?

jaymegordo

comment created time in 2 days

issue commentmicrosoft/pylance-release

Sort imports is severely bugged with Pylance language server

Yes, Pylance has its own.

ErwanDL

comment created time in 2 days

issue commentmicrosoft/vscode-python

Include PyRight

Addition; Pylance requires the Python extension as it only provides the LS portion.

dimansf

comment created time in 2 days

issue commentmicrosoft/pylance-release

python.analysis.extraPaths setting supported?

The variables are something that the Python extension does, but isn't in the VS Code API or LSP. (microsoft/python-language-server#1783)

mikelnrd

comment created time in 2 days

issue commentmicrosoft/pylance-release

Resizable Docstring

Unfortunately, the docstring window's dimensions are determined by the editor; a language server can only respond with markdown and it's up to VS Code to display it. We don't get any sort of feedback as to how wide a window the text is going to be rendered in.

For example, you can stretch VS Code across 3 monitors, and it will expand the tooltips just as wide.

This is an ongoing display thing we'd like to try and work out, but it may require LSP changes.

timrid

comment created time in 2 days

issue commentmicrosoft/pylance-release

Sort imports is severely bugged with Pylance language server

Could be, yeah. My thought is that Pylance also potentially doing import sorting itself could be triggering the race much more often (rather than trying to make it race by hand).

ErwanDL

comment created time in 3 days

issue commentmicrosoft/pylance-release

Sort imports is severely bugged with Pylance language server

The logs seem to indicate that sortImports.py is actually called twice at a time for some reason, maybe the two executions conflict with one another ?

This could be something along the lines of:

  • Extension sorts the imports
  • Pylance sorts the imports
  • Extensions sees the file change and sorts again

Or similar race conditions.

ErwanDL

comment created time in 3 days

issue commentmicrosoft/pylance-release

Sort imports is severely bugged with Pylance language server

Transferring this over; do you have isort enabled in the extension, or is Pylance the sole organizer?

We may want to disable our organize import functionality (at least the one that's used on save and such) given we require the core extension.

ErwanDL

comment created time in 3 days

issue commentmicrosoft/pylance-release

Pylance not enabling when using Remote Development

Ah, oops, I should have just mentioned @erinxocon, since they talk about WSL. I believe devcontainers and SSH operate through similar means (but WSL is different and one I know we tested).

cfculhane

comment created time in 3 days

issue commentmicrosoft/pylance-release

Pylance not enabling when using Remote Development

Interesting, we tested this within WSL and it appeared to operate correctly. This setting is declared in VS Code in such a way that it should be getting propagated to the remote host.

I see that the original report was an insiders build of VS Code, is that what you are using @pferreir @erinxocon or just the regular stable build?

cfculhane

comment created time in 3 days

issue commentmicrosoft/pylance-release

*args type checking

When I said "should have type Tuple[Hashable]", I meant the actual type of the dims variable within the function scope, not that you should annotate it as such. *dims: Hashable is a valid declaration.

max-sixty

comment created time in 3 days

issue commentmicrosoft/pylance-release

Issues when `str` is defined as a class variable

Out of curiosity, why update the docstrings to contain the "fake" type? Or are you somehow generating those docs from the type annotations?

max-sixty

comment created time in 3 days

issue commentmicrosoft/pylance-release

*args type checking

Yes, dims should have type Tuple[Hashable] (or similar, I can't recall the exact one used for variadic args as I'm typing this).

I'll likely clone this to check for myself, as this codebase seems to be very annotated (yay!), but if you remove that if block entirely, does the issue go away?

max-sixty

comment created time in 3 days

issue commentmicrosoft/pylance-release

Issues when `str` is defined as a class variable

Ah, that explains a lot. Unfortunate.

max-sixty

comment created time in 3 days

issue commentmicrosoft/pylance-release

Issues when `str` is defined as a class variable

I would also suggest trying to do the method described in https://github.com/microsoft/python-language-server/issues/1732#issuecomment-652620364, though, as it would certainly prevent that aliasing.

max-sixty

comment created time in 3 days

issue commentmicrosoft/python-language-server

Undefined variable: 'str' as part of correct type annotation

microsoft/pylance-release#19

max-sixty

comment created time in 3 days

issue commentmicrosoft/pylance-release

Issues when `str` is defined as a class variable

@erictraut

Maybe I'm misunderstanding the scoping rule, but given str is being declared as a class variable, is it not only accessible by say ClassName.str?

max-sixty

comment created time in 3 days

issue commentmicrosoft/pylance-release

np.errstate triggers error warning

I think there are multiple issues being stated here. I was interested in the signature determined for np.asarray, which I believe is similar to the original issue with "No parameter named ...".

The dims issue is a third thing (separate again), as it's saying that you can't unpack Hashable into a *args parameter, which is true from a type checking point of view. If you believe that message to be wrong, I'd file a separate issue for that one as well, especially if you have the type checking mode set to "off".

dzanaga

comment created time in 3 days

issue commentmicrosoft/pylance-release

np.errstate triggers error warning

@max-sixty Sorry, I should have been more clear, it's the functions themselves I want to see, for the signatures.

dzanaga

comment created time in 3 days

issue commentmicrosoft/pylance-release

np.errstate triggers error warning

@max-sixty

I'd appreciate another issue specifically for that str case. I believe the intention is to declare a class variable named str, and there may be another way to construct that line to help us understand it (but I don't want to clutter this issue about the diagnostic for an unknown param).

dzanaga

comment created time in 3 days

issue commentmicrosoft/pylance-release

np.errstate triggers error warning

Thanks for the screenshots, this would confirm that the signature we find does not contain those things. Feasibly we can hide those messages (by sticking them into the "general type issues" category which is disabled in "off" mode), but there's a tradeoff as that'd prevent any other helpful messages where the signature actually is correct and you want to know the call is wrong. The best thing would be to get these signatures correct.

Is there a way like # NOQA to ignore these warnings?

Yes, you can use # type: ignore.

dzanaga

comment created time in 3 days

issue commentmicrosoft/pylance-release

np.errstate triggers error warning

Numpy in particular is tricky because we need stubs to make it work, due to so much of the code being compiled. Thankfully they merged their stubs directly into their codebase (!!) which I believe will improve things greatly when released.

dzanaga

comment created time in 3 days

issue commentmicrosoft/pylance-release

np.errstate triggers error warning

@max-sixty I'd appreciate a screenshot or two of the hovers on the functions with this message, just to see what signature we are inferring. That'd likely be the quickest way to narrow it down.

There are two things:

  • This message is being reported unconditionally, but might be better suited for the "general type issues" bucket.
  • The type being used may be unintentionally missing the parameter.

And it seems microsoft/python-language-server#1732 causes a total of 57 (!) errors in dataarray.py, because str as a type seems to be mangled. mypy does handle this correctly.

This seems like a separate issue; are you saying that str isn't working as a type in hints?

dzanaga

comment created time in 3 days

issue commentmicrosoft/pylance-release

np.errstate triggers error warning

In both of these cases, if you hover, is it correct that the signature displayed does not include the parameters the diagnostic is warning about?

dzanaga

comment created time in 3 days

issue commentmicrosoft/python-language-server

Many (most?) files don't conform to the project's .editorconfig

This seems like an interplay between git's choice of line endings and the config, where it's checking it out as LF, not CRLF. We've typically worked on Windows in VS, where git by default will use CRLF when pulling down (so VS would not perceive any problems with formatting).

On Linux, it's likely checking it out as LF so the editorconfig is wrong. Arguably the config should just be removed; the tests normalize things or otherwise don't care about the encoding of their files.

leungbk

comment created time in 3 days

issue commentmicrosoft/pylance-release

Pylance doesn't seem to respect python.autoComplete.extraPaths

Yes, we moved this to a new setting as the old one was inconsistently named (for historical reasons). We plan to keep everything under the python.analysis.* grouping from now on.

jarshwah

comment created time in 3 days

issue commentmicrosoft/pylance-release

Pylance not enabling when using Remote Development

As a workaround, you should be able to edit the remote machine's settings and add:

"python.languageServer": "Pylance"

This is moderately related to #16, as we are currently only supporting the extension's prompt to change the setting in this preview.

cfculhane

comment created time in 3 days

issue commentmicrosoft/pylance-release

np.errstate triggers error warning

Is your typeCheckingMode set to the default ("off"), or are you using one of the stricter rulesets?

dzanaga

comment created time in 3 days

issue commentmicrosoft/pylance-release

pylint checks with pylance enabled

Interesting; I would have assumed it was just being disabled by default by the extension. For reference, the extension uses pylint by default (in conjunction with other tools) to provide at least some info like syntax checks without a language server, so I can see why it may disable that tooling if an LS is there to do "live linting" (among everything else an LS does).

yankyhoffman

comment created time in 4 days

issue commentmicrosoft/python-language-server

Class Parameter Hints do not show up when inheriting from NamedTuple

Yep (along with many other things 🙂).

https://devblogs.microsoft.com/python/announcing-pylance-fast-feature-rich-language-support-for-python-in-visual-studio-code/

sbland

comment created time in 4 days

issue commentmicrosoft/python-language-server

Additional typing specialization

FWIW the new LS we released today has full typing support: https://devblogs.microsoft.com/python/announcing-pylance-fast-feature-rich-language-support-for-python-in-visual-studio-code/

MikhailArkhipov

comment created time in 4 days

issue commentmicrosoft/python-language-server

Update typeshed to a more recent version

FWIW the new LS we released today has full typing support (and a new typeshed): https://devblogs.microsoft.com/python/announcing-pylance-fast-feature-rich-language-support-for-python-in-visual-studio-code/

jakebailey

comment created time in 4 days

issue commentmicrosoft/python-language-server

Support function overload with Literal attributes

FWIW the new LS we released today has full typing support: https://devblogs.microsoft.com/python/announcing-pylance-fast-feature-rich-language-support-for-python-in-visual-studio-code/

vemel

comment created time in 4 days

issue commentmicrosoft/python-language-server

Implement typing `Literal` support

FWIW the new LS we released today has full typing support: https://devblogs.microsoft.com/python/announcing-pylance-fast-feature-rich-language-support-for-python-in-visual-studio-code/

jakebailey

comment created time in 4 days

issue commentmicrosoft/python-language-server

Support 'strict typing mode' (mypy compatibility) for improved performance and correctness

This is an old issue, but you'd be interested in checking out Pylance, which uses Pyright for type checking. Announcement here: https://devblogs.microsoft.com/python/announcing-pylance-fast-feature-rich-language-support-for-python-in-visual-studio-code/

matangover

comment created time in 4 days

issue commentmicrosoft/python-language-server

Implement code action for missing imports

For those of you interested in what Pyright provides in VS Code, I would recommend looking at what we just posted today, a new LS based on Pyright that integrates fully with the Python extension.

https://devblogs.microsoft.com/python/announcing-pylance-fast-feature-rich-language-support-for-python-in-visual-studio-code/

Thanks for your patience!

MikhailArkhipov

comment created time in 4 days

startedmicrosoft/pylance-release

started time in 4 days

push eventjakebailey/vscode-python

Mikhail Arkhipov

commit sha e0b80243727c598583a073c981c17958328711eb

Language server name (#12653)

view details

push time in 5 days

push eventmicrosoft/vscode-python

Mikhail Arkhipov

commit sha e0b80243727c598583a073c981c17958328711eb

Language server name (#12653)

view details

push time in 5 days

PR merged microsoft/vscode-python

Language server name skip news
  • [X] Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR).
  • [X] Title summarizes what is changing.

- [ ] Has a news entry file (remember to thank yourself!).

  • [X] Appropriate comments and documentation strings in the code.
  • [X] Has sufficient logging.
  • [X] Has telemetry for enhancements.
  • [X] Unit tests & system/integration tests are added/updated.

- [ ] Test plan is updated as appropriate. - [ ] package-lock.json has been regenerated by running npm install (if dependencies have changed). - [ ] The wiki is updated with any design decisions/details.

+9 -15

1 comment

4 changed files

MikhailArkhipov

pr closed time in 5 days

push eventjakebailey/vscode-python

Timothy Ruscica

commit sha 0734d4ea990b4d4a0352d07117107e93a3cdd4e0

added tests for pdf export (#12548)

view details

Joyce Er

commit sha b24a014b3ec0f5ed5e4fb320b62eec18efde6831

DS: Display 'Trusted' / 'Not Trusted' on notebook load (#12466)

view details

Jake Bailey

commit sha d80bead813b44990173bd347f1ad804b3947bee7

Don't modify LS settings if jediEnabled does not exist (#12551)

view details

Don Jayamanne

commit sha 6afc0839101f2cce1e1073239c237805ad6376a4

Add Telemetry for VSC Notebooks (#12542) * Added some missing telemetry for VS Code Notebooks * Track the type of notebook used in various operations (running cell, interrupting kernels, etc, determine whether user is performing such operations while in Native/Custom/Old editor) * Added a type for INobteookEditor (temporary, until VSC Notebook is stable) * Ensure users cannot opt into VSC Notebook Editor experiment when in VSC Stable.

view details

Joyce Er

commit sha 791d7bed6b7c3f0d2852e32109616674642c1602

DS: Show banner prompting user to trust notebook (#12555)

view details

Pavel Minaev

commit sha fb501ecf321503ab928c98ab3e961a017c63b96f

Fix #12446: Stock launch.json "attach" configs should be using "connect" (#12504) Change RemoteAttachDebugConfigurationProvider to generate configs with "connect".

view details

Kartik Raj

commit sha c88b314d392d133588ce89eaf4c5694c7bc159d9

Skip flaky CI tests (#12566)

view details

Don Jayamanne

commit sha 14389ef979adc5f29494df9bb25a3f691458b850

VS Code Notebook survey (#12558)

view details

Kartik Raj

commit sha 3d1e2f7dde970c3b0f2b5554c5554908a17c09ab

Prompt users that we have deleted pythonPath from their workspace settings when in DeprecatePythonPath experiment (#12536) * Prompt users that we have deleted pythonPath from their workspace settings when in DeprecatePythonPath experiment * Oops * Code reviews * Code reviews

view details

Luciana Abud

commit sha 0b590caff690b96a74ed281255c3b0d64d512e82

Turn pythonPath experiment for 20% of users. (#12549)

view details

Jim Griesmer

commit sha 2f5234a3bdd387d3bb26831cd63f49fce34f3a1a

Update experiments.json (#12573)

view details

Rich Chiodo

commit sha a94c8b8d648034d199046dcd4a83eafb75d1ee06

Jupyter hub preliminary support (#12574) * Move request header generation into password generation * Connecting to token api * Working jupyter hub connection * Use multistep input * Remove token on shutdown * Support certificate checking * Skip waiting on shutdown * Get old unit tests passing again * Fix xsrf token to remove extra cookie crap * Test plan changes and new unit test * Fix linter and input box result * Fix sonar warning * Review feedback * Actually cookie not sent back for hub

view details

Kartik Raj

commit sha 2dbe02ba7619d4eaa147d31e37dfb55ef0edcaa8

Skip more flaky CI tests (#12577) * Skip more flaky CI tests * Oops * Special hook

view details

Rich Chiodo

commit sha 7003ead107165ee459c318a017cfec4de8674ebe

Run by line telemetry (#12583) * Run by line telemetry * Add hover telemetry

view details

Kartik Raj

commit sha 6b80c943857fab4a648e4553bc6b087b6d0a96a1

Skip failing Python Daemon Pool unit test (#12568)

view details

Kartik Raj

commit sha f0153fc43b10ab4a33ec1ab759c94c6dc9e5a1cc

Skip another flaky Python daemon test (#12598)

view details

Timothy Ruscica

commit sha ba587d3eac3880c0f13a5d9456f8901f9fc0de17

Refactored importing jupyter notebook as python file (#12575) * refactored import notebook * added wait for status * added wait for status * fixed tests * added export stuff to serviceContainer * made exported python document dirty * fixed tests

view details

Timothy Ruscica

commit sha c70d8be555ff809ae0e3300d786e129ccd96f923

moved interfaces to types (#12599)

view details

Don Jayamanne

commit sha 6a5246013e31c31903f50e677d18ad8610d1a250

Fix missing events and hooks from INotebookEditor (#12570) * Ensures a number of events have been wired up properly * Added a number of tests (for these events)

view details

Don Jayamanne

commit sha 5eb5e1ae1736b1b8195e70ab280e06b8b0ff6e4e

Start restart session after first cell execution (#12600) Found that we weren't starting the restart kernel in the right place. We used to start restart kernel after first cell has been executed else this impact time to execute first cell. Moved code to base class as it applies to both.

view details

push time in 5 days

issue commentmicrosoft/vscode-python

Change public API for execution to return an object and provide a callback which is called when interpreter setting changes

Seems good. I would have maybe had the event include the new info, but maybe it's too expensive and users should just requery if needed.

@erictraut For awareness.

karrtikr

comment created time in 5 days

issue commentmicrosoft/python-language-server

numpy packages misses **all** functions after recent update

Have you tried on 0.5.51 (which I believe is in our beta channel)?

"python.analysis.downloadChannel": "beta"
AeneasZhu

comment created time in 5 days

issue commentmicrosoft/python-language-server

How to set up debugging on Linux/Mac

You want "Extension". Then when it's loaded, the output panel should have an output channel for "Python Language Server" which should provide some more info about if it's working or not.

You can also technically use the stable build of the Python extension, and copy the languageServer folder to its directory (with the same downloadLanguageServer set to false), if you want to eliminate an extra debug step. There's an "open extensions folder" item in the command pallete to quickly find where it lives.

leungbk

comment created time in 8 days

issue commentmicrosoft/python-language-server

How to set up debugging on Linux/Mac

Step 6 means in the vscode-python repo; so just in the root next to src.

jediEnabled was removed very recently, so we haven't changed the docs yet. Microsoft is correct.

leungbk

comment created time in 8 days

issue commentmicrosoft/pyright

Cannot find module 'worker_threads' in v1.1.46 using GitHub action

Eric typically closes these on release (hence the label to ensure it's in the changelog), since that'll be the place that enforces the version.

Borda

comment created time in 8 days

issue commentmicrosoft/pyright

Cannot find module 'worker_threads' in v1.1.46

Since the minimum version was bumped, we can probably skip that for now (other than for code cleanliness reasons).

Borda

comment created time in 8 days

issue closedmicrosoft/python-language-server

False Positive Warning: "Inheriting 'Protocol', which is not a class."

<!-- Read the guidelines for filing an issue first.

https://github.com/microsoft/python-language-server/blob/master/TROUBLESHOOTING.md#filing-an-issue -->

Environment data

<!-- To find your version:

Select "View: Toggle Output" from the command palette (Ctrl+Shift+P on Windows/Linux, Command+Shift+P on macOS), then select "Python" in the dropdown on the right ("Python Language Server" if running Insiders build of VS Code). Look for the line Microsoft Python Language Server version X in the console. -->

  • Language Server version: 0.5.50.0
  • OS and version: Ubuntu 19,10
  • Python version (& distribution if applicable, e.g. Anaconda): conda 3.7.6

Expected behaviour

No warning raised on

from typing_extensions import Protocol

class Proto(Protocol):
    ...

Actual behaviour

"Inheriting 'Protocol', which is not a class." warning is raised

Logs

<!-- Enable trace logging by adding "python.analysis.logLevel": "Trace" to your settings.json configuration file.

Adding this will cause a large amount of info to be printed to the Python output panel. This should not be left long term, as the performance impact of the logging is significant. -->

Analysis of safe_runner (User) queued. Dependencies: logging, collections, dataclasses, itertools, math, gym, numpy, torch, typing_extensions, estimates.model_learning, line_search.log_search, rl_types, rlpyt.agents.base, rlpyt.algos.base, rlpyt.runners.minibatch_rl, rlpyt.samplers.base, rlpyt.samplers.collections, rlpyt.utils.logging, rlpyt.utils.logging.logger, utils.probability, utils.rlpyt, utils.torch, utils.trajectory, utils.trajectory_builder
Analysis version 7167 of 1 entries has started.
Analysis of safe_runner (User) on depth 0 completed in 8.16 ms.
Analysis version 7167 of 1 entries has been completed in 8.45 ms.
Analysis of safe_runner (User) queued. Dependencies: logging, collections, dataclasses, itertools, math, gym, numpy, torch, typing_extensions, estimates.model_learning, line_search.log_search, rl_types, rlpyt.agents.base, rlpyt.algos.base, rlpyt.runners.minibatch_rl, rlpyt.samplers.base, rlpyt.samplers.collections, rlpyt.utils.logging, rlpyt.utils.logging.logger, utils.probability, utils.rlpyt, utils.torch, utils.trajectory, utils.trajectory_builder
Analysis version 7168 of 1 entries has started.
Analysis of safe_runner (User) on depth 0 completed in 14.19 ms.
Analysis version 7168 of 1 entries has been completed in 14.52 ms

closed time in 8 days

jordan-schneider

issue commentmicrosoft/pyright

Cannot find module 'worker_threads' in v1.1.46

Looks like it worked, thanks for checking!

Borda

comment created time in 8 days

issue commentmicrosoft/pyright

Cannot find module 'worker_threads' in v1.1.46

Change this:

      - name: Set up node
        uses: actions/setup-node@v1

To this:

      - name: Set up node
        uses: actions/setup-node@v1
        with:
          node-version: '12'
Borda

comment created time in 8 days

issue commentmicrosoft/pyright

Handle `python.pythonPath` deprecation in the Microsoft Python extension

Odd, doesn't say anything about just "python". Could be that it's the "default" setting being picked up (the extension has that notion internally, and it might be "python"). Unfortunately the logs don't state the reason an interpreter was chosen.

You should probably set your python.languageServer setting to "None" so that MPLS doesn't run; it'd be redundant.

sambhare

comment created time in 8 days

issue commentmicrosoft/pyright

Cannot find module 'worker_threads' in v1.1.46

We can set an engine with the supported node versions, which will error out on install if the node version isn't supported: https://docs.npmjs.com/files/package.json#engines

e.g. { "engines" : { "node" : ">=12.0.0" } } (but I haven't tested)

Borda

comment created time in 8 days

issue commentmicrosoft/pyright

Cannot find module 'worker_threads' in v1.1.46

The LogTracker could be passed in the constructor, and the foreground/background analysis pass in new LogTracker(console, 'FG') and new LogTracker(console, 'BG') respectively.

But I'll also note that our node types and testing environment are on v14 and v12 respectively; I don't think we are trying to support these older builds. VS Code is v12 so we target that at the top end (which means the node types should be v12 too, but...).

Borda

comment created time in 8 days

issue commentmicrosoft/pyright

Cannot find module 'worker_threads' in v1.1.46

As for why this is happening now, 5b5cd448a57b69c58364238d21f2f4eaeae7288d added an isMainThread check to to the analysis, whereas before the threading checks were only limited to the LS side (where there are two threads).

Borda

comment created time in 8 days

issue commentmicrosoft/pyright

Cannot find module 'worker_threads' in v1.1.46

That CI pipeline is using Node v10, which only offers worker threads with the --experimental-worker flag. It's available by default in v11+. I think pyright assumes a pretty new version.

I don't think your pipeline use node for anything but pyright; can you upgrade to a newer (supported) version, like 12 or 14?

Borda

comment created time in 8 days

issue commentmicrosoft/pyright

Handle `python.pythonPath` deprecation in the Microsoft Python extension

Could be the auto interpreter picking; I'd be curious to see the Python extension's logs to see if it's picking the default and then changing it after.

sambhare

comment created time in 8 days

push eventjakebailey/pyright

Aditya Thakral

commit sha 7c8706fb1387237c075348110566dfd1bb424f38

Add severity level enum to package.json (#766)

view details

Eric Traut

commit sha 8bb571b0256f956a61ae332dd24c83260a07adeb

Published 1.1.46

view details

push time in 9 days

issue commentmicrosoft/vscode

Support file watching outside of the workspace

This'd be useful for Python where we have to set up file watchers for search paths to detect package installs, which are often not within a workspace (pipenv, conda, global installs).

stamblerre

comment created time in 9 days

push eventjakebailey/pyright

Eric Traut

commit sha afceb82f60d9e5971e9f48b724e3d78a34502602

Fixed bug in code that scans for source files within the project that caused an infinite loop if it encountered a symbolic link that created a cycle.

view details

Eric Traut

commit sha 88305fca456c47d48b8c2b8f9ae8fe3736681890

Changed logic that computes union types to strip out NoReturn types if they are combined with other types. A "NoReturn" should always appear by itself, never in a union.

view details

Eric Traut

commit sha 0a96855951af4c78c85ca084a9b4246f2692f49d

Improved error messages for argument type mismatches.

view details

Eric Traut

commit sha b4785175579a8585fac75427559bf613457a5568

Fixed bug that caused code to be marked as "unreachable" if a lambda declaration involves a call to a NoReturn function.

view details

Eric Traut

commit sha f28cf16fa1859daf203763d99b00ea8ba97ef5b8

Added missing support for `__rmatmul__` (reverse matrix multiply) operator overload method.

view details

Jake Bailey

commit sha 5b187d19fae1d11c94a64f9017593e689bafc5c9

Upgrade dependencies, fix first line code actions, progress bar tweak, logging, package scanning (#743) Rollup of: - Upgrade dependencies, including an LSP bump for new features. - Fix code actions that appear on the first line. - Tweak progress bar displaying to display less often for behind-the-scenes analysis. - Make leveled logging more consistent, configurable. - Add package scanner for auto-importing top-level package names. - Fix docstring fetching in relative import cases, `-stub` packages.

view details

Eric Traut

commit sha cf794e30d54c04b4cbc36232d620a638f40a9d01

Added documentation for python.analysis.logLevel setting.

view details

Eric Traut

commit sha e0398feb131b60d89666f46f200afcc0df620117

Fixed bug that caused an internal error when typing certain decorators at the module scope.

view details

Eric Traut

commit sha 5692a74045dda2f110a16bf57a0f386556dea43d

Added support for unpacking of tuples with specified element types within argument lists. The type checker now properly expands these tuples and matches individual element types against corresponding parameters in the callee.

view details

Eric Traut

commit sha 431aba69c41484d43f533d58014137597fc5c03f

Improved error messages for TypeVar mismatches (e.g. invariance).

view details

Eric Traut

commit sha 5b13685428b62f25c4100ecaedc494edb3458382

Extended bidirectional type inference to function call expressions where the callee has a declared return type that is generic.

view details

Eric Traut

commit sha 2cb1844842e01ec5aff6b1794e7d37ae8e4b8e21

Simplified referencesProvider.

view details

Eric Traut

commit sha 240cc4c50599e82a2125d5215ce12ee74f24e08b

Added call hierarchy provider, which allows client to display all callers of a function or all calls made by a function.

view details

Eric Traut

commit sha 2085a6fceea409684eacfa9402ae9cc0ab4d9bfa

Updated docs to cover call hierarchy provider.

view details

Eric Traut

commit sha 99929afcd40af5b6944077e033e88586507b9815

Published 1.1.44

view details

Eric Traut

commit sha cc947468ef1c6eeb75396de7c4d92748711fa74d

Fixed bug in call hierarchy provider that caused aliased symbols to be reported incorrectly. Added support in call hierarchy provider for properties.

view details

Eric Traut

commit sha af624e66100811358ef5eadcc9b905e4f9cfdc65

Updated all dependencies to latest versions. The update to eslint required a small change to the .eslintrc.json config files for compatibility.

view details

Eric Traut

commit sha a190f7a10152cfc006e123d05a6c5479d912f4e7

Improved handling of dataclass entries that use "field(init=False)" to specify that the field should not be included in the synthesized `__init__` method's parameter list.

view details

Justin Hutchings

commit sha 80222e04eb2ceec28724106c39fe286bb03a4196

Add CodeQL security scanning (#711)

view details

Eric Traut

commit sha 863721687bc85a54880423791c79969778b19a3f

Added support for the new Python extension setting for pythonPath. This mechanism replaces the soon-to-be-deprecated "python.pythonPath" setting.

view details

push time in 9 days

push eventmicrosoft/pyright

Heejae Chang

commit sha 5b5cd448a57b69c58364238d21f2f4eaeae7288d

added more logging and fixed hover bug (#765)

view details

push time in 9 days

issue commentmicrosoft/python-language-server

How to have parameters and docs showing for code installed with codan develop or pip -e .

Please, provide logs. The page I linked has the settings to enable trace logging and where to find it in VS Code.

brando90

comment created time in 9 days

issue commentmicrosoft/python-language-server

How to have parameters and docs showing for code installed with codan develop or pip -e .

You used the question template, the issue template asks for a lot more info. The trace logs would be important to look at, for the paths being used. https://github.com/microsoft/python-language-server/blob/master/TROUBLESHOOTING.md#filing-an-issue

brando90

comment created time in 9 days

issue commentmicrosoft/python-language-server

unresolved imports

This is an old closed issue. You have already opened an issue (#2088); there's no need to paste you messages in multiple places.

karrtikr

comment created time in 9 days

delete branch jakebailey/vscode-python

delete branch : fix-jedi-enabled-1

delete time in 10 days

push eventmicrosoft/vscode-python

Jake Bailey

commit sha d80bead813b44990173bd347f1ad804b3947bee7

Don't modify LS settings if jediEnabled does not exist (#12551)

view details

push time in 10 days

PR merged microsoft/vscode-python

Reviewers
Don't modify LS settings if jediEnabled does not exist skip news

For #12429

Not sure if I can add a news for this, given it's a bugfix for a bugfix...

<!-- If an item below does not apply to you, then go ahead and check it off as "done" and strikethrough the text, e.g.: - [x] ~Has unit tests & system/integration tests~ -->

  • [x] Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR).
  • [x] Title summarizes what is changing.
  • [ ] Has a news entry file (remember to thank yourself!).
  • [x] Appropriate comments and documentation strings in the code.
  • [x] ~Has sufficient logging.~
  • [x] ~Has telemetry for enhancements.~
  • [x] Unit tests & system/integration tests are added/updated.
  • [x] ~Test plan is updated as appropriate.~
  • [x] ~package-lock.json has been regenerated by running npm install (if dependencies have changed).~
  • [x] ~The wiki is updated with any design decisions/details.~
+44 -21

2 comments

2 changed files

jakebailey

pr closed time in 10 days

PR opened microsoft/vscode-python

Don't modify LS settings if jediEnabled does not exist

For #12429

Not sure if I can add a news for this, given it's a bugfix for a bugfix...

<!-- If an item below does not apply to you, then go ahead and check it off as "done" and strikethrough the text, e.g.: - [x] ~Has unit tests & system/integration tests~ -->

  • [x] Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR).
  • [x] Title summarizes what is changing.
  • [ ] Has a news entry file (remember to thank yourself!).
  • [x] Appropriate comments and documentation strings in the code.
  • [x] ~Has sufficient logging.~
  • [x] ~Has telemetry for enhancements.~
  • [x] Unit tests & system/integration tests are added/updated.
  • [x] ~Test plan is updated as appropriate.~
  • [x] ~package-lock.json has been regenerated by running npm install (if dependencies have changed).~
  • [x] ~The wiki is updated with any design decisions/details.~
+44 -21

0 comment

2 changed files

pr created time in 10 days

push eventjakebailey/vscode-python

Jake Bailey

commit sha 80868a2de8bb0cb24534d37dfba776970ef8e689

Cleanup

view details

push time in 10 days

create barnchjakebailey/vscode-python

branch : fix-jedi-enabled-1

created branch time in 10 days

push eventjakebailey/vscode-python

Jim Griesmer

commit sha 53c3fc6231adc2dd4edd8deeca207f4943f4d044

Update experiments.json (#12524) All required steps passed.

view details

David Kutugata

commit sha 88f3b432bbe93474cc29e413b6a831050a056beb

Remove kernel change on the Interactive Window (#12439) * add 'select kernel' handle message on the interactive window * remove kernel toolbar from the interactive window if th user uses a local jupyter server * add setting to enable it back * add news file * oops * Add the experiment, as well as IExperimentService on everything that extends WebViewHost * removed setting * add setting back

view details

Don Jayamanne

commit sha df69c426433fb0e26bb5596f8e1d51ea70242f9d

Fixes related to execution & clearing output of Native Notebooks (#12490) * Do not run cells if empty * Clearing output should clear status, exec times, cell execution count (added tests, to ensure execution_count is null) * When running a cell/nb we should set status of cell as running early on * Clearing output should mark document as dirty * Restoring running tests on CI (forgot to revert some changes)

view details

Joyce Er

commit sha bea5e97d3573b2492dc1699c2e3fd75d4c3766bd

Make node install version in contributing docs match ci.yml (#12528) * Make node version in docs match ci.yml * Update .nvmrc

view details

Ian Huff

commit sha 2cc6c95db59c71b14275b53d43a6f1eca0c93850

Fully handle iopub comm messages (#12512)

view details

Joyce Er

commit sha 3bb92e12a316601a4307feaf811cf6aaceef0109

DS: Ensure atomic key creation for use with trusted notebooks (#12515)

view details

Timothy Ruscica

commit sha 036621a3be73b8d7fb5f31d7acebd4a3b1106b55

Added export notebook to PDF (#12517) * temp work * started working on dependency checking * good start on pdf * removed space from label * added to command pallete * changed pdf method to TeX * fixed pdf title * removed unecessary changes * changed back package-lock.json * cleaned up dependency checker * made changes and add telemetry * changed from 2 to 1 error message * changed name for temp directory * removed duplicate import * removed mardown prefix * deleted temp file

view details

Joyce Er

commit sha 94ca7f73f2293b239b5380af79866b478cc365cf

DS: Compute and store trusted digests for notebooks (#12479)

view details

push time in 10 days

issue closedmicrosoft/python-language-server

Function documentation colored red when a parameter name contains an underscore

Environment data

  • VS Code version: 1.46.1
  • Extension version: 2020.6.89148
  • OS and version: MacOS 10.15.5 (but same on Windows 10)
  • Python version: 3.7.7
  • Type of virtual environment used: None
  • Value of the python.languageServer setting: Microsoft

Expected behaviour

Display function documentation normally when the name of a parameter contains an underscore.

Actual behaviour

Displays the name of a parameter containing an underscore and following text colored red:

screen

Steps to reproduce:

Write a function where one of the parameter names contains an underscore and document that parameter in a docstring.

def foo(param, a_param):
    """
    This is a function.

    Parameters
    ----------
        param (int): A parameter.
        a_param (int): And another.
    """
    pass

closed time in 10 days

epetrovski

issue commentmicrosoft/python-language-server

Function documentation colored red when a parameter name contains an underscore

Duplicate of #613, which covers this extra syntax that is neither markdown or ReST. That block is indented and is getting loosely translated into a code block (since indention in markdown means a code block).

epetrovski

comment created time in 10 days

issue commentmicrosoft/pyright

Pyright doesn't recognize the `__members__` attribute of enumeration class

Typeshed's definition of enum includes it in the metaclass: https://github.com/python/typeshed/blob/master/stdlib/3/enum.pyi

MapleCCC

comment created time in 10 days

push eventjakebailey/vscode-python

Eric Snow

commit sha def0966b71a75ec73dd844b161a0fc14a0c688f5

Logging cleanup. (#11606) For #9837

view details

Kartik Raj

commit sha f1ba4908c3d6427c66412e5e2417011826d09b4c

Moved all logging into the Python output channel (#11695) * Added support * Correction * Only use console when environment variable is set * Code reviews * Added doc comments

view details

Kartik Raj

commit sha 9bedf2d350d2f9f41ce0ba6770cd2dbc5577aa7d

Added setting `python.logging.level` which carries the logging level value the extension will log at (#11698) * Added setting * Code reviews * Fix unit tests * Code reviews * Put config.level back * Added commnet * Code review * More code reviews * Fix tests

view details

Kartik Raj

commit sha fe1a91a234281263014323ffe123849048d8386b

Monkeypatch console.* calls on CI if we are asked to (#11897) * Move console.* monkeypatching to src/test/testLogging.ts * Use monkeypatching in all tests launched using testBootstrap.ts * Use monkeypatching in single workspace and multiroot tests * News entry * Don't do monkeypatching for smoketests * Modify gulp task to not delete 'out/client/logging' directory * Undo smoke test ccheck * Import only from ./out/client/logging in test logger * Added comment * More corrections * Add comments * Correct smoke tests * Oops

view details

Karthik Nadig

commit sha da85a769070ee785643e7929c8e82db0bd5e1f4a

Restore DebugAdapter experiment (#12483)

view details

Karthik Nadig

commit sha 17e317b7a48f5d83691e543db6aef23d2f6d80e0

Merge pull request #12432 from ericsnowcurrently/logging-changes-only Pull in the logging-related changes from the "logging-changes-and-drop-old-debugger" branch.

view details

Kim-Adeline Miguel

commit sha 65f9709b295547de29e9448ca955e015b63d35c1

Fix `linting.pylintEnabled` setting check (#12444) * Fix `linting.pylintEnabled` setting check * Use stub instead of handspun variable

view details

Pavel Minaev

commit sha b2d2ec34bb7c0816b6f94da64f403169da54988c

Fix #11678: Add "argsExpansion" debug property to launch.json schema (#12445)

view details

Eric Snow

commit sha 5e194c50e5d00d016029a83228a40eb538e53ce1

Fix an errant import. (#12488)

view details

Don Jayamanne

commit sha e396bfa9fdaccdd3f72360158ad16041f176d17c

Trigger changes in VSC Notebook when executing cells (#12489)

view details

Ian Huff

commit sha 29bf396c23df0f4c6c589624c585e8903e838fef

Mac keyboard undo and redo need to look for meta, not ctrl (#12487)

view details

David Kutugata

commit sha 1bec89bee8730ad42ce9a0d0d319915e3a299778

discard changes when the user clicks don't save (#12492)

view details

Brandon White

commit sha 3eb13259657e37c052ab8ba216ca1277a2d6c7e8

Added `workspaceContains:pyproject.toml` to activationEvents (#12056) (for #4765) This PR adds triggering off of 'pyproject.toml' in the workspace root to load the extension. Other recognizable file triggers (like setup.py) may be added later.

view details

Eric Snow

commit sha e39860742d2e704444b47beb934dd5a2ba73f8da

Move interpreter-info-related code to the py-envs component tree. (#12398) This change is part of the work to isolate a "component" for Python environments. The focus here is on pulling code related to getting interpreter info out of unrelated modules and into the py-envs component.

view details

Brett Cannon

commit sha e41681faf6435be5b3b93e02fd02b768936e809c

Drop `jediEnabled` from the issue template

view details

push time in 11 days

issue commentmicrosoft/python-language-server

unresolved-import after adding package to repository (Poetry/Venv)

This is currently expected behavior; to detect installed packages we need to watch files, and it proved more problematic than useful. You can enable this behavior manually with a setting: https://github.com/microsoft/python-language-server/blob/master/TROUBLESHOOTING.md#completions-do-not-update-andor-import-is-still-being-reported-as-unresolved-after-pip-install

Kyitrai

comment created time in 11 days

issue closedmicrosoft/python-language-server

unresolved-import after adding package to repository (Poetry/Venv)

I'm using poetry for managing the environment and dependencies.

The behavior is that: any new packages added to the project (poetry add <package>) after starting up VSCode are not found (unresolved_import). Running the code from the terminal inside VS Code or a detached terminal with the venv activated does not encounter any import errors.

image

Restarting VS Code entirely will resolve the problem after the language server re-initializes.

Poetry is set to instantiate the virtualenv in the project folder, so .vscode/settings.json has the setting "python.pythonPath": ".venv/bin/python". The environment selection according to the status bar is also correct.

image

I am using the Microsoft language server:

{
    "python.jediEnabled": false,
    "python.languageServer": "Microsoft",
}

Originally posted by @Kyitrai in https://github.com/microsoft/vscode-python/issues/11934#issuecomment-647727468

closed time in 11 days

Kyitrai

issue commentmicrosoft/pyright

Handle `python.pythonPath` deprecation in the Microsoft Python extension

I think this is what happens when you just run bare "python" on Windows; "python" is this magic binary which points the user to install something on the Windows Store, then is replaced once that's done.

I've noticed this in testing in CI where I can see it printing out "Python 2.7.15" or similar in tests because "python" is being executed; I'd be curious if it's still being over-run when things are unset (where the most recent fixes were intended to only run Python if pythonPath was set).

sambhare

comment created time in 11 days

push eventmicrosoft/pyright

Hugues Valois

commit sha 600cd7ab43c79ba87fd3882de7b3e22cc94c50c4

eslint/prettier fixes, platform and version detection (#749)

view details

push time in 12 days

issue commentmicrosoft/vscode-python

The Python Tools server crashed 5 times in the last 3 minutes. The server will not be restarted.

This seems like an extraction failure or a corrupt download. If the LS is deleted and redownloaded, does it work?

MarekOzana

comment created time in 12 days

issue commentmicrosoft/python-language-server

When can I get the code completion and smart prompt experience like pycharm?

What is "smart completion" or "smart prompt"? We offer completion (that's the core thing in an LS), but can you clarify what you mean?

CatNofishing

comment created time in 12 days

issue commentmicrosoft/vscode-python

jediEnabled = false isn't automatically migrated to languageServer = Microsoft

Who is removing jediEnabled? You, or the extension?

If jediEnabled is false, then that imples the language server should be used, so the setting is moved. If it's unset, then that means Jedi, though as the default it should not be set at all. IntelliCode is a plugin for the language server, so asks the setting to be changed from Jedi (since it doesn't work with that setup).

If python.languageServer is set at all, it won't be touched, and nothing will change.

fireattack

comment created time in 15 days

more