Closed Raydir closed 6 years ago
dunno why but today it seems to work again... i dont get it but okay.
WTF? this did happen again now. I opened several files of the same type and closed VSC for a sec to open it again with a file and "plop" every color in the editor is gone and I look on my file in Dark/White...
Help?
okay... I did find the reason but i can't see why this would make sense:
Steps to reproduce: 1) If i set "files.encoding" : "cp850" in my settings and work on files everything is fine 2) close VSC Insider 3) Start it new and select a file 4) now everything is "Monochrome" 5) remove "files.encoding" : "cp850" 6) Still monochrome 7) Close VSC and start it new --> everything fine again.
This is up to the language grammar. You're using an .FF file which I don't think we support out of the box. It might be your f-script
extension?
What does the language say in the bottom right corner? Notice TypeScript in this screenshot:
yes this is a fileextension out of my extension "f-script" but that did work and it recognizes the extension correctly and also loads the file as CP 850. It is just ignoring the colors as soon i restart vsc with a fixed codepage.
I just checked: the same happens in the "normal" edition of VSC:
I dont get it, extension is loaded, codepage is fixed AND invoked by extension and that makes vsc lose the colors defined in the extension. (in every color theme btw.)
Monokai Dimmed when problem occurs:
Monokai Dimmed when encoding is not fixed to cp 850:
I think those "<<" characters are not the same even though they render the same when opening via different encodings. Can you copy them in each case in a JS repl (like in the browser one F12, Ctrl+Shift+I) and try to see the char code e.g. "<".charCodeAt(0)
(and replace < with your copy-pasted character). Alternatively can you copy-paste the character in the two cases, are the characters really the same?
Hi @alexandrudima I dont have to use "charCodeAt" since i know most of those charaters by heart (kind of a hobby to me due to my work) -.-
It is ASCII-Char 174 (cp850) in my normal case) in UTF-8 it is character « Unicode Number would be U+00AB https://unicode-table.com/de/00AB/
The counterpart (») is ASCII 175 UTF8: » Unicode: U+00BB https://unicode-table.com/de/00BB/
@alexandrudima could it be a problem that the extension is written in UTF8 itself?
Well, could you please copy-paste them out of vscode in order to make sure they are the same code point, and they are not two distinct code points just painted in the same way. i.e.
set "files.encoding" : "cp850"
. close vscode. open file in vscode. copy-paste a "«" and "»" character out of vscode and into a JS repl to read their char code using 'x'.charCodeAt(0)
.
remove "files.encoding" : "cp850"
. repeat and compare char codes.
Compare that in both cases you get '«'.charCodeAt(0) = 171
and '»'.charCodeAt(0) = 187
.
@alexandrudima - i did on my last post (even when i said i know them) and they are exactly the same (171/187).
@Raydir Ok. From some of your screenshots it looks like not just lines starting with « and » are not colorized, but rather the entire file is not colorized (including lines starting with #). This makes me believe that perhaps the file extension (.FF) is not recognized. What does the language mode indicator show in the case when the file is not colorized?
The language mode indicator is this thing at the bottom right (reads TypeScript here):
f-Script is the extension - ff is known by that extension
Well, that is most weird.
I have tried to reproduce but I cannot. In my attempt to reproduce I have taken the grammar from https://marketplace.visualstudio.com/items?itemName=OpaccSoftwareAG.f-script and have created a minimal extension that contributes the grammar:
package.json
:{
"name": "54640",
"publisher": "alex",
"version": "0.0.0",
"engines": {
"vscode": "^1.22.0"
},
"contributes": {
"languages": [
{
"id": "ff",
"aliases": [
"ff"
],
"extensions": [
"ff"
]
}
],
"grammars": [
{
"language": "ff",
"scopeName": "source.f-script",
"path": "./f-script.tmLanguage.json"
}
]
}
}
I have created a file with the contents «/asd»
and saved it to disk as UTF8 and as cp850. The bytes when I save it as UTF8 the bytes are C2 AB 2F 61 73 64 C2 BB
and when I save it as cp850 the bytes are: AE 2F 61 73 64 AF
.
In any case, if I create a folder with the UTF8 file and open it, it opens correctly and the « and » get colorized. If I create a different folder with the CP850 file and set the "files.encoding" : "cp850"
in that folder's settings, I can also open the file without any problem and the « and » get colorized.
So, what I am saying is that I cannot reproduce what you describe. Can you give me more complete steps for me to try to reproduce?
ahm... did you close and reopen the editor after setting files.encoding to cp850?
Thank you, I can reproduce. I had to reopen vscode to fully reproduce. The bug here is that the reading of the grammar files from disk respects the setting "files.encoding"
, which is wrong. The setting "files.encoding"
should only be respected when reading files being edited and not when reading grammar, themes, or other extension files. Files in extensions are always to be read as utf8.
aw cool thanx for fixing that one 👍
Full reproducible steps:
"files.encoding": "cp850"
test_cp850.ff
test_cp850.ff
: «/asd»
That is because the grammar file is opened as cp850 instead of utf8.
works smooth now, thanx!
Issue Type: Bug
A few minutes ago my Version of Visual Studio Code (Insider) went "monochrome" somehow... did something change lately?
I have a specific Extension (Opacc F-Script) which is defining specific colors. But that is also like this if i change to "Monokai".
The only setting that seems to work now is the "Backgroundcolor" of the editor and workspace...
VS Code version: Code - Insiders 1.26.0-insider (adfa9ce9778a6e79197477fcc60cb5420a31979a, 2018-07-10T05:19:09.185Z) OS version: Windows_NT x64 10.0.17134
System Info
|Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz (8 x 2112)| |GPU Status|2d_canvas: enabledflash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: disabled_software
video_decode: enabled
video_encode: enabled
vpx_decode: enabled
webgl: enabled
webgl2: enabled| |Memory (System)|15.93GB (11.54GB free)| |Process Argv|C:\Users\romanvonwil\AppData\Local\Programs\Microsoft VS Code Insiders\Code - Insiders.exe| |Screen Reader|no| |VM|0%|
Extensions (7)
Extension|Author (truncated)|Version ---|---|--- Bookmarks|ale|0.19.1 todo-tree|Gru|0.0.66 easy-icons|jam|0.3.1 vscode-language-pack-de|MS-|1.25.2 PowerShell|ms-|1.7.0 f-script|Opa|16.20.1 opacc-fscript-debug|Opa|16.20.1