-
Notifications
You must be signed in to change notification settings - Fork 38.1k
Closed
Labels
apifeature-requestRequest for new features or functionalityRequest for new features or functionalityhelp wantedIssues identified as good community contribution opportunitiesIssues identified as good community contribution opportunitiesverification-neededVerification of issue is requestedVerification of issue is requestedverifiedVerification succeededVerification succeeded
Milestone
Description
#12283 added an api overload to open a new, untitled text document with an optional language mode.
It would be great if this could be augmented to accept content.
Use case: I have an extension that ships with examples. Currently I have to do one of the following:
- Open the "source" file directly which would allow users to clobber it
- Copy the file to a temp file and open that and then remember to clean it up. Users would still have to "save as" to save it in a location that is useful to them
- Use the new overload to open an untitled, empty text document and then use an edit to populate the contents.
The last one is the most viable but seems unnecessary. I would like to see openTextDocument(options?: {language: id, content: text}) so I could do something like
openTextDocument(exampleUri).then(exampleDocument => { const exampleText = exampleDocument.getText(); openTextDocument({language: LANG_ID, content: exampleText})
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
apifeature-requestRequest for new features or functionalityRequest for new features or functionalityhelp wantedIssues identified as good community contribution opportunitiesIssues identified as good community contribution opportunitiesverification-neededVerification of issue is requestedVerification of issue is requestedverifiedVerification succeededVerification succeeded