-
Notifications
You must be signed in to change notification settings - Fork 30.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Continue further adoption of ITextModelResolverService #17073
Comments
/cc @isidorn for adopting resource content provider in debug land. output might be a bit more tricky because we have explicit methods to append and trim values. not sure how much work it would be for debug. |
/cc @sandy081 to adopt resource input also for default keybindings and avoid string editor input (https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/parts/preferences/browser/preferencesService.ts#L141) |
In debug I am extending |
For output we are in similar position, namely output is managing the value of the Let me know if I am missing something here |
@isidorn We want to make the The benefit is to simplify the whole input/resource infrastructure. |
@isidorn I think output already has a model where the output content is in memory and it should be easy to map that to resources. Debug is more tricky: do you have a way to ask the debug adapter for the contents of the debug resource? if so, I would expect it to work like that: when the content provider is asked to return content it asks the debug adapter for it. |
Yes, there is a way for me to ask the deubg adapter for the content of the debug resource. |
@isidorn You're supposed to implement a Check out |
@joaomoreno thanks for the pointer! So now when I go to the editor service and say open this uri resource the editor service will automatically get content from my content provider based on uri schema (of course after I properly register it)? Also should I be in charge of disposing all of the |
My motivation is to get rid of this ugly method here. Namely I would just go to the An additional complication is that I use a special input in an error case. Just writing my thoughts down - will try to connect the dots tomorrow morning. |
Yes that is how it works, all you care about is resource URIs and how they resolve to content.
No, since you are not dealing with inputs anymore, you do NOT dispose. The editor needs to take care of that.
Keep in mind: no more editor inputs. Btw there is a flag called |
Phew I feel freshly showered! Ok things that need to be done:
Since I am out on thursday / friday if something seems badly broken just revert my commit linked here. |
@isidorn how did this work before, did you call this method? we cannot just "call revealLineInCenterIfOutsideViewport" everytime you open an editor, so it can only be a new option that you can pass over (similar how you can pass over line/column selection when opening an editor). |
- Do not use input cache - Let content proivder listen to events and update preview model
Updated replace content provider to handle model updates. Also removed editor input caches since content provider takes care of updating and disposing the model. Content provider disposes the model directly until we have a new and proper dispose strategy. |
@sandy081 there is still the keybindings editor using |
Ah forgot about that. |
Done |
@bpasero |
@joaomoreno adopting it for untitled editor input is something I still wanted to do eventually. It is the only one not using text model references yet. |
Not going to happen. |
We should get rid of
StringEditorInput
in favour of theResourceEditorInput
, such that we benefit from the reference counting. There is also files and untitled which are totally bypassing resolver serviceITextModelResolverService
in one of two ways:Input.resolve
returnIReference<EditorModel>
input.resolve
calls withITextModelResolverService.createReference
callsThe text was updated successfully, but these errors were encountered: