Extension cannot override language name anymore
- VSCode Version: 1.0.0
- OS Version: Windows 10
Steps to Reproduce:
- Install VS Code
- Install extension MagicPython, AND / OR
- Install extension Python
This issue has been present for a while, including the previous version. I just uninstalled and reinstalled VS Code, and it's still present.
For MagicPython there's no option to choose it in styling selection. In previous version I could select it, but it just didn't apply.
For Python, intellisense etc just don't work even though the extension is supposed to add them. This may be related to auto-indentation not working for python language. (I don't know javascript, but when I try just messing with stuff on a JS file, there's a hell of a lot of features that do work. The issues are with python.)
This issue was the same for Ubuntu 15.10, VS Code 0.9 but I haven't tried it with the 1.0 release.
I'm having the same problem with my babel es6/es7 extension. The mode doesn't seem to appear anymore in the palette, looks like a regression bug
@dzannotti The issue I had had been there ever since I updated VS Code some months ago. Back when I first installed VSC (around September 2015, give or take a month) auto-indentation and code completion worked by default. It stopped working after updating, but at the time I was busy writing code for a final exam and didn't submit a bug report. The point is, issue with python usability is not new to 1.0 version. Addition of the extensions didn't do anything at all. For python VSC is basically a bare bones text-field.
(I posted this on the other thread too dzannotti, but I meant to post here. Sorry for the double mention.)
The issue I had had been there ever since I updated VS Code some months ago. Back when I first installed VSC (around September 2015, give or take a month) auto-indentation and code completion worked by default.
This is another scenario, let's keep this out of this issue :smile: . This is the interesting scenario.
The babel extension, contributes/overloads the JS extension and contributes a tmGrammar for JS
"languages": [
{
"id": "javascript",
"aliases": [
"Javascript (Babel)"
],
"extensions": [
".js",
".jsx",
".es6"
],
"firstLine": "^#!.*\\bnode",
"mimetypes": [
"text/javascript"
]
}
],
When you open the language menu then javascript (babel) doesn't show up anymore. This has worked in 0.10.11 and looks like a regression. I know we made changes there. CCing some folks
Any ideas what could have caused this change of behaviour @dbaeumer @bpasero @alexandrudima @jrieken
The Magic Python extension does the same and it is popular 10K of installs, the users of Magic Python will be hit by this as well.
@egamma when I revert https://github.com/Microsoft/vscode/commit/fcb8e57b609f068d4bd05cf09f98a89b6be94049 I can get the overwrite to happen. Looks like a regression from that commit...
I am not sure why @alexandrudima added a check here (https://github.com/Microsoft/vscode/blob/master/src/vs/editor/common/services/languagesRegistry.ts#L151) that would prevent the language override.
@jrieken @dbaeumer any clue?
If I take out this if check, it seems to work.
Btw I think the language is picked up, just the label in the status bar and the picker is not changed.
It seems like it was a bad fix for #4360 which was about not seeing the language name in the status bar. The regression is definitely worst than the previous bug
@bpasero doesn't looks like it, if i inspect the code with devtools the tags are the default ones
Verified that the MagicPython extension has the same isseu. Labeling as important.
fcb8e57 affects no functionality whatsoever except the UI language name. The change in that commit forces that the language name (the label that shows in the bottom right corner) is always used from the first time a language was contributed.
Here is what gets contributed when installing MagicPython:
- from our default python extension:
"contributes": {
"languages": [{
"id": "python",
"extensions": [ ".py", ".rpy", ".pyw", ".cpy", ".gyp", ".gypi" ],
"aliases": [ "Python", "py" ],
"firstLine": "^#!/.*\\bpython[0-9.-]*\\b",
"configuration": "./python.configuration.json"
}],
"grammars": [{
"language": "python",
"scopeName": "source.python",
"path": "./syntaxes/Python.tmLanguage"
},{
"scopeName": "source.regexp.python",
"path": "./syntaxes/Regular Expressions (Python).tmLanguage"
}]
- from
MagicPython:
"languages": [
{
"id": "python",
"aliases": [
"MagicPython",
"python"
],
"extensions": [
".py",
".py3",
".rpy",
".pyw",
".cpy",
".SConstruct",
".Sconstruct",
".sconstruct",
".SConscript"
]
}
],
"grammars": [
{
"language": "python",
"scopeName": "source.python",
"path": "./grammars/MagicPython.tmLanguage"
}
]
VSCode correctly respect the overwriting of the grammar (see below screenshots of coloring before & after), also all the additional file extensions added to python. The only thing that gets "stuck" is the language name (the UI label) as Python.
At the time of fcb8e57 I thought that to be a good decision (i.e. why would a single programming language have 2 or more different names or why would they be different). I didn't realize extensions use this as a sort of "branding" for the grammars.
IMHO this issue is not important (no need for backporting) as there is 0 functionality impact, it is a usage of the alias in a way I have not foreseen (as a branding mechanism instead of as an alias to a programming language).
Before installing MagicPython in the Quiet Light theme:

After installing MagicPython and restarting (also in the Quiet Light theme):
