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

resourceLangId == 'azcli' not matching untitled file #26873

Closed
chrmarti opened this issue May 18, 2017 · 6 comments
Closed

resourceLangId == 'azcli' not matching untitled file #26873

chrmarti opened this issue May 18, 2017 · 6 comments
Assignees
Labels
*as-designed Described behavior is as designed

Comments

@chrmarti
Copy link
Contributor

  • VSCode Version: Code - Insiders 1.13.0-insider (2fbc979, 2017-05-17T08:10:06.896Z)
  • OS Version: Darwin x64 15.6.0
  • Extensions: Many

The Azure CLI extension is using resourceLangId == 'azcli' to scope keybindings and menu items to the language id it contributes. That works as expected in saved files, but does not work (no menu items, no keybindings) in an untitled file with language mode 'azcli'.

https://github.com/Microsoft/vscode-azurecli/blob/master/package.json#L87

@chrmarti chrmarti added the bug Issue identified by VS Code Team member as probable bug label May 18, 2017
@jrieken jrieken assigned bpasero and unassigned jrieken May 18, 2017
@jrieken
Copy link
Member

jrieken commented May 18, 2017

The resource lang id is derived from the fsPath which is the only thing I have at that point. Tho @chrmarti it also depends on how you create the untitled file? Via API you can associate a language with it, then a correct URI should be used

@jrieken jrieken assigned jrieken and unassigned bpasero May 18, 2017
@jrieken jrieken added the info-needed Issue requires more information from poster label May 18, 2017
@chrmarti
Copy link
Contributor Author

It's created via New File (Cmd+N). Users report they want to use the 'scrapbook' experience in an unsaved file.

@bpasero
Copy link
Member

bpasero commented May 18, 2017

It certainly works e.g. for markdown:

  • new untitled file
  • switch to markdown mode
    => action to open as preview pops up nicely

image

@chrmarti
Copy link
Contributor Author

Using editorLangId in the where condition (like markdown) works. Should resourceLangId also use the language mode of the editor?

@jrieken
Copy link
Member

jrieken commented May 19, 2017

The resourceLangId uses only the URI and is therefore also available in the explorer, e.g for context menu actions. The editorLangId is only available in the editor and has the full editor at its disposal.

@chrmarti When you just want to contribute menu items and keybindings you can use the editorLangId if you want to be in the explorer as well, then we only have the resourceLandId (from which we derive the language using its file path.

@chrmarti
Copy link
Contributor Author

Sounds good, closing this issue 'as designed'.

@chrmarti chrmarti added *as-designed Described behavior is as designed and removed bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster labels May 19, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*as-designed Described behavior is as designed
Projects
None yet
Development

No branches or pull requests

3 participants