Comments (5)
We're not a TextDocumentContentProvider
for python files. We just provide URIs that VS code opens using the default content provider. I don't think it would be worth the effort to start doing this as we've had no up votes on this issue.
I think in order for this to work we'd have to create a custom URI scheme for built in files. Then we'd be a content provider for just that scheme.
from pylance-release.
@karthiknadig do you know if it makes sense to transfer this to Pylance, or would it need to be done in vscode-python?
from pylance-release.
hey @isidorn! During housekeeping I transferred this to the Pylance repo and then talked about this with the team. We were thinking whether it wouldn't make more sense for Pylance to return the content with a flag saying it should be read only or not (and then VS Code would handle that appropriately)?
For context, it's not uncommon for users to want to edit their stub files (.pyi
) that are open when they use "Go to references" (folks in our team actually do this all the time). The main exceptions are usually builtins.pyi
like in the float
example, and probably anything under site-packages
.
from pylance-release.
@luabud thanks for discussing with the team.
You understand the needs of the python users much better than me, and if you decided that editing stub files makes sense then we should allow that. As for builtins.pyi
and site-packages
if you can mark them as readonly that would make sense to me. And currently the mechanism to mark something as readonly should be through your document provider. You probably already have a ContentProvider
, and that provider returns TextModels
, and each of those TextModels
can decide if it is readonly
or not. At least, that is how it works in core when I implemented it for debug, and I think the same should be exposed to extensions.
Code pointer https://github.com/microsoft/vscode/blob/isidorn/account-avatar/src/vscode-dts/vscode.d.ts#L1802
Though if this is deemed as not low-hanging fruit feel free to close it as out of scope.
from pylance-release.
thanks all for the additional context! I'll close this as out of scope then 😊
from pylance-release.
Related Issues (20)
- python HOT 1
- Syntax highlighting breaks down if you line break at curly bracket in f-strings
- Can pylance hint the add-to-builtiins vars and libs ? HOT 3
- support type checking in the vscode web extension HOT 1
- How to explicitly specify that Pylance only scans specific a few directories in a large multi-root workspace HOT 5
- Python Intellisense Fails after Forced VS Code Update HOT 5
- notebook cells sometimes get cycle.
- How to set pylance memory max limitation? HOT 6
- Imports refactoring on MOVE/RENAME of the entire package HOT 1
- How to remove unused imports from ALL files as a one-off task
- Protocol subtyping check fails for Protocol-typed argument of Protocol-typed function, provided as argument of another function HOT 6
- Import resolve failures are hard to figure out
- Add imports don't show up on first quick fix HOT 7
- Rename of a derived method renames the base method even if not an override HOT 3
- Symlinking a directory does not cause a reresolve of imports
- parse error on magic statement on ipython mode. HOT 9
- In a virtual workspace find all references ends up with duplicates
- Semantic colorization for quoted type annotations is inconsistent HOT 8
- Virtual workspace has duplicates for show call hierarchy
- Setting `python.analysis.nodeExecutable` in the user settings affects how pylance gets launched on VSCode remote HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pylance-release.