-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathlsp_utils.py
More file actions
25 lines (18 loc) · 833 Bytes
/
Copy pathlsp_utils.py
File metadata and controls
25 lines (18 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
"""Extension-specific overrides on top of vscode-common-python-lsp.
Only symbols actually consumed by lsp_server.py are exported here.
``is_stdlib_file`` widens the shared-package classification to match
the original broad semantics (any classified Python file, not just stdlib).
"""
from __future__ import annotations
from vscode_common_python_lsp import classify_python_file
__all__ = [
"is_stdlib_file",
]
def is_stdlib_file(file_path: str) -> bool:
"""Return True if the file belongs to a non-user Python path.
The original implementation included stdlib, system site-packages,
user site-packages, and extensions dir. Matching that broad semantics.
"""
return classify_python_file(file_path) is not None