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

Inform when syntax highlighting or word wrap is turned off for large files #44206

Closed
asjJRAutomation opened this issue Feb 22, 2018 · 8 comments
Assignees
Labels
feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@asjJRAutomation
Copy link

Issue Type

Bug

Description

Any XML-based file with a non-xml extension has no syntax highlighting, even if the Language Mode is set to XML. After changing the file extension to .xml without changing any file contents, syntax highlighting works correctly.

VS Code Info

VS Code version: Code 1.20.1 (f88bbf9, 2018-02-13T15:34:36.336Z)
OS version: Windows_NT x64 10.0.16299

System Info
Item Value
CPUs Intel(R) Core(TM) i7-6920HQ CPU @ 2.90GHz (8 x 2904)
Memory (System) 31.94GB (14.67GB free)
Process Argv C:\Program Files\Microsoft VS Code\Code.exe D:\Source\JR\Personal\JR.CadTools\bin\Release\Deployment\product.wxs
Screen Reader no
VM 0%
Extensions: none Reproduces without extensions
@vscodebot
Copy link

vscodebot bot commented Feb 22, 2018

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@vscodebot vscodebot bot added the languages-basic Basic language support issues label Feb 22, 2018
@RMacfarlane
Copy link
Contributor

What extension did the file previously have before you changed it to .xml? Syntax highlighting for xml is being applied when a file has one of these extensions:

".xml",".xsd",".ascx",".atom",".axml",".bpmn",".config",".cpt",".csl",".csproj",".csproj.user",".dita",".ditamap",".dtd",".dtml",".fsproj",".fxml",".iml",".isml",".jmx",".launch",".menu",".mxml",".nuspec",".opml",".owl",".proj",".props",".pt",".publishsettings",".pubxml",".pubxml.user",".rdf",".rng",".rss",".shproj",".storyboard",".svg",".targets",".tld",".tmx",".vbproj",".vbproj.user",".vcxproj",".vcxproj.filters",".wsdl",".wxi",".wxl",".wxs",".xaml",".xbl",".xib",".xlf",".xliff",".xpdl",".xul",".xoml"

or the first line matches (\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)

@asjJRAutomation
Copy link
Author

asjJRAutomation commented Feb 23, 2018 via email

@Tyriar Tyriar assigned aeschli and unassigned Tyriar Feb 28, 2018
@aeschli
Copy link
Contributor

aeschli commented Mar 1, 2018

That's strange: .wxs is already in the list of files associated to the xml mode.
So this just works for me:

  • create a file foo.wxs with content <abc></abc>
  • Open in VSCode. Editor mode shows XML, syntax highlighting works.

This also works for me:

  • create file foo.wxs1 with content <abc></abc>
  • open in VSCode. Editor shows mode 'Plain text'
  • switch mode to 'XML`. XML syntax highlighting works.

Also this works:

  • create file foo.wxs2 with content <?xml version="1.0" encoding="utf-8"?><abc></abc>
  • open in VSCode. Editor shows mode 'XML'. XML syntax highlighting works.

@asjJRAutomation Can you give your steps? Please verify that no other extension redefines the XML mode.

@aeschli aeschli added the info-needed Issue requires more information from poster label Mar 1, 2018
@asjJRAutomation
Copy link
Author

I originally thought I was having a problem with many files, but now I'm only able to recreate the problem with a particular file. The file I'm having an issue with is a .wxs file that was generated by the WiX heat.exe application. It generates a .wxs file from input files. I've attached the file (with a .txt extension, GitHub would not allow upload of .wxs)

It is a very large file (20MB). Maybe the file size is the issue?

product.wxs.txt

@aeschli
Copy link
Contributor

aeschli commented Mar 2, 2018

Oh, yes, there's a 20MB limit where tokenization will be disabled.
@alexandrudima We need to to at least print a warning to the console, even better some kind of notification to the users.

@aeschli aeschli assigned alexdima and unassigned aeschli Mar 2, 2018
@aeschli aeschli changed the title XML Syntax Highlighting No XML Syntax Highlighting for large file Mar 2, 2018
@alexdima
Copy link
Member

alexdima commented Mar 2, 2018

Yes, now that notifications are not so invasive, we could add a passive notification informing about this, and also about the case of a very long line...

@alexdima alexdima changed the title No XML Syntax Highlighting for large file Inform when syntax highlighting is turned off for large files Mar 2, 2018
@alexdima alexdima added feature-request Request for new features or functionality and removed languages-basic Basic language support issues info-needed Issue requires more information from poster labels Mar 2, 2018
@alexdima alexdima added this to the March 2018 milestone Mar 2, 2018
@alexdima alexdima modified the milestones: March 2018, On Deck Mar 28, 2018
@alexdima alexdima changed the title Inform when syntax highlighting is turned off for large files Inform when syntax highlighting or word wrap is turned off for large files Apr 27, 2018
@alexdima alexdima modified the milestones: On Deck, May 2018 Apr 27, 2018
@alexdima alexdima added the verification-needed Verification of issue is requested label May 29, 2018
@alexdima
Copy link
Member

To verify, try opening a very large file.

@isidorn isidorn added the verified Verification succeeded label May 29, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Jun 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

6 participants