Skip to content
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

workspace.openTextDocument works incorectly when passing { content?: string; } as argument #34796

Closed
fi11er opened this issue Sep 22, 2017 · 1 comment
Assignees
Labels
api bug Issue identified by VS Code Team member as probable bug verified Verification succeeded

Comments

@fi11er
Copy link

fi11er commented Sep 22, 2017

calling API method workspace.openTextDocument({content: 'some content'}) or workspace.openTextDocument({}) throws exception, but should work correctly.

The problem lines are in file src\vs\workbench\api\node\extHost.api.impl.ts:

let options = uriOrFileNameOrOptions as { language?: string; content?: string; };
if (!options || typeof options.language === 'string') {
	uriPromise = extHostDocuments.createDocumentData(options);
}

should be something like this:

let options = uriOrFileNameOrOptions as { language?: string; content?: string; };
if (options) {
	uriPromise = extHostDocuments.createDocumentData(options);
}
@vscodebot vscodebot bot added the api label Sep 22, 2017
@jrieken jrieken assigned bpasero and unassigned jrieken Sep 22, 2017
@jrieken jrieken added the bug Issue identified by VS Code Team member as probable bug label Sep 22, 2017
@bpasero bpasero added this to the September 2017 milestone Sep 22, 2017
@bpasero
Copy link
Member

bpasero commented Sep 22, 2017

Good catch!

bpasero added a commit that referenced this issue Sep 25, 2017
@roblourens roblourens added the verified Verification succeeded label Sep 29, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants