Git Product home page Git Product logo

Comments (5)

rchiodo avatar rchiodo commented on May 22, 2024 2

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.

luabud avatar luabud commented on May 22, 2024

@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.

luabud avatar luabud commented on May 22, 2024

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.

isidorn avatar isidorn commented on May 22, 2024

@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.

luabud avatar luabud commented on May 22, 2024

thanks all for the additional context! I'll close this as out of scope then 😊

from pylance-release.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.