Giter VIP home page Giter VIP logo

vscode-xml's People

Contributors

abemedia avatar dependabot[bot] avatar dotjoshjohnson avatar eliasib13 avatar emericklaw avatar kedar-joshi avatar kweaver87 avatar line-o avatar locationguru-kedarjoshi avatar rdoubleui avatar somelinguist avatar thibsc avatar wade-ryan avatar zawiasam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-xml's Issues

Remove Update Notifier

VS Code now contains a command to view outdated extensions. Because of the manual processes involved on the deployment side, it'd be best to remove the homebrewed update notifier.

Update VSCode API Dependency

Due to a CI build issue, we needed to fork the Microsoft/vscode-extension-vscode repository and propose a fix for microsoft/vscode-extension-vscode#12. The package.json for the vscode-xml extension is temporarily pointing to the commit in the fork containing our proposed fix. Once MS publishes an official fix, we can point back to the registered NPM version.

Update Links in Manifest

The repo links in package.json need to be updated to reflect the move to the TrueCommerce organization.

Move storage.json Logic to New Service

The logic for locating and parsing the VS Code storage.json file should be split out into a new service. It currently resides in the XmlTreeService class.

Clean up Imports

Some of the import statements are becoming unruly. Many of these can be condensed using an alias (import * as vsc from 'vscode').

Extra newlines are added when user the Format Code command

I've found a case in which an extra newline is added when Format Code is called:

Before:

<?xml version="1.0"?>
<!-- TEST COMMENT -->
<text>
    <content />TEST_TEXT
</text>

After:

<?xml version="1.0"?>
<!-- TEST COMMENT -->
<text>
    <content />TEST_TEXT

</text>

If I continue to do Format Code it will continue to add newlines after the <content/> line, like so:

<?xml version="1.0"?>
<!-- TEST COMMENT -->
<text>
    <content />TEST_TEXT








</text>

I know this isn't necessarily a "best practice" when it comes to writing XML files, but it is still valid XML.

"Format code" seems to have stopped working?

I'm opening an XML file in Visual Studio Code 1.5.2, right-clicking on the text, clicking on "Format code" and nothing is happening. XML Tools 1.6.0 is installed.

I'm not sure if a Code update has broken something so I can't be sure when this last worked.

Sorry for not being more helpful.

Update XMLDOM Dependency

I had forked the xmldom library to fix a line numbering issue. This has now been fixed in the main repo and we should switch the package.json dependency back to the NPM package.

Large XML Files Crash Extension

When a large XML file is opened, VS Code will still fire context change events (editor window change and selection change) even if the editor API is not ready for that document. This results in a barrage of TypeErrors due to null references. Adding a guard clause should keep us from tripping over a 500lb XML file.

Iteration Plan

Roadmap Items

  • XML Tree View Feature (issue #32, pull request #38)
  • XML Tree View Documentation (issue #39)

Debt Items

  • Update XMLDOM Dependency (issue #33, pull request #36)

Error when using some Ternary Operators code

On a Nativescript xml coding, when using Ternary Operators with < I got the error above, but not when using something like that !=:

XML formatting failed: at line 13, column 76: expected exclamation mark, question mark or alphabetic tag name.

<StackLayout>
    <Label text="label with just < " visibility="{{ p.status < 1 ? 'visible' : 'collapsed' }}"  />
    <Label text="labe with != " visibility="{{ p.status != 1 ? 'visible' : 'collapsed' }}" />
</StackLayout>

Attributes hardly visible in tree view with dark themes

Consider the following XML fragment

<foo bar="test"/>

which the XML Tree View displays like this in VS Code's Dark+ theme:

image

I can hardly decipher the attribute. Changing the theme to change the background color does help, but this can only be a workaround.

[Re-Implement XML Tree View] - Support Paths with Uppercase Characters on Linux

When trying to get the treeview on Ubuntu, if the path contains an uppercase char, it fails with this message:
Impossible d'ouvrir '' : cannot open file:///home/nicolas/t%C3%A9l%C3%A9chargements/backup-1473699716781.xml. Detail: Fichier introuvable (/home/nicolas/téléchargements/backup-1473699716781.xml).

The right path here is home/nicolas/Téléchargements/backup-1473699716781.xml

Commands Exposed Before Activation

Commands are being exposed prior to the extension being activated. This is causing event listener errors when trying to, for example, format XML before the language is changed from "Plain Text" to "XML". We should check to see if this is due to the way commands are being declared in the extension manifest.

If this is a VS Code bug, we can work around it by activating the extension on any event (using the * activation event).

Format Selection Not Working

When an XML fragment is selected and the Format Code command is issued, the selection is replaced with a formatted copy of the entire document. Only the selection should be formatted.

XPath Namespace Support

The XPath evaluator doesn't seem to resolve default namespaces properly.

This works:
/Root/Child

<Root>
    <Child>value</Child>
</Root>

But this doesn't:
/Root/Child

<Root xmlns="http://mynamespace.com">
    <Child>value</Child>
</Root>

XML Tree View Documentation

Create wiki documentation for the new XML tree view feature (including technical documentation for the new xmltree:// protocol implemented in 801fc5a).

xpath: count support

having xml:

<?xml version="1.0" encoding="UTF-8"?>

<bookstore>

<book>
  <title lang="en">Harry Potter</title>
  <price>29.99</price>
</book>

<book>
  <title lang="en">Learning XML</title>
  <price>39.95</price>
</book>

</bookstore> 

running XPath: count(//book)

Result:

  • expected: 2
  • actual: ERROR something went wrong while evaluating the XPath: Type error

XPath / XQuery back-end for linux?

Hi,

Has anybody successfully ran this extension on Linux? Which xmlTools.xqueryExecutionEngine works for you?

I'm thinking that Saxon might be my best bet here, and am busy trying to formulate a working xmlTools.xqueryExecutionArguments, but a more detailed guide in terms of what this extension expects of such a tool (in terms of inputs / outputs) would be very useful.

Automatically bind namespaces in XQuery and XPath

In MarkLogic, for example, the xdmp and cts namespaces are bound automatically and don’t need to be declared. It would be nice to be able to specify a list of prefix-URI pairs that the linter would assume already exist.

The equivalent of inserting,

import module namespace xdmp = "http://marklogic.com/xdmp";
import module namespace cts = "http://marklogic.com/cts";

manually into your code.

Use the format contribution API

Instead of adding a new command, better add yourself as a formatter provider

vscode.languages.registerDocumentFormattingEditProvider('xml', ...)
vscode.languages.registerDocumentRangeFormattingEditProvider('xml', ...)

You will then get invoked on the built-in Format command.

You can have a look at my css formatter extension:
https://github.com/aeschli/vscode-css-formatter/

Improve XML Formatter

The current XML formatter is a bit messy. It should be rewritten to include more edge cases to avoid messing with CDATA formatting and attribute contents.

Also, the current formatter will take elements that should normally appear like this: <XmlElement></XmlElement> and put a line break between the two tags. This shouldn't happen and should be corrected.

Spaces between tag and first attribute won't be formatted

Before

<node    attr="none"    attr2="lots"    attr3="less"    >    </node>

After

<node    attr="none" attr2="lots" attr3="less"    ></node>

Spaces between node and attr1 should be merged into only one space.
Also, spaces before the closing > aren't treated.

Attributes attr1, attr2 and attr3 were spaced correctly with each other.

[Re-Implement XML Tree View] - Add Tab Stops

Xml tree view is pretty nice.
But I have problem, Treeview has no tab stop, It can not be controlled(ellapsed,collapsed) VIA KEYBOARD

Navigate via keyboard is very important thing to search and observe Tree

Preserve White Space

Hi,

Great extension, but wondering if it can perseve the whitepace inside nodes..

For example:

<root><child>Line 1

Line 2

Line 3</child></root>

Becomes

<root>
  <child>Line 1Line 2Line 3</child>
</root>

Where as it would be great if it could keep the white space inside the nodes..

<root>
  <child>Line 1

Line 2

Line 3</child>
</root>

Keep blank lines when formatting xsl

Hi

Great extension. I use Visual Studio Code and XML Tools for writing my xslt files. Here the formatting of xml comes in handy, but I would like to keep my blank lines which makes it easier to find my way around my code.

Would it be possible to get a setting for this?

Thanks a bunch!
Morten

Default XPath Input to Last Query

The XPath input prompt should default to the last XPath query used against the active document. This feature should be exposed as a user setting so it can be disabled if desired.

XML Formatter always appends a new line

The XML formatter appends always a new line character at the end of the file even when there is already one. This is needless and in my opinon a bug. Please fix this

Don't require an "xml" file extension

Would be nice to just copy and paste some text into an "untitled" page and after selecting all (or portions) of text, simply doing a "Format" command (or alt-shift-f) to format the string with tabs/spaces. Tried this with a sample XML string and it doesn't work until I save that untitled file as a ".xml".

"Indent XML" is a similar Sublime plugin https://github.com/alek-sys/sublimetext_indentxml that works with selection.

Create Bootstrapper Version for Publisher Change

We plan to change the VSCE publisher from DotJoshJohnson to TrueCommerce to reflect the move from a personally-developed extension to an organization-maintained extension. This move will change the extension ID from DotJoshJohnson.xml to TrueCommerce.xml. Prior to making this change, an update will need to be released that contains bootstrapping logic that can move existing users to the "new" extension:

  1. Add logic to DotJoshJohnson.xml to watch the marketplace for TrueCommerce.xml.
  2. When TrueComerce.xml is deployed to the marketplace, DotJoshJohnson.xml should either:
    • Notify the user and ask the user to perform the necessary install/uninstall actions, OR
    • Download the VSIX package for TrueCommerce.xml, install it, then uninstall itself (if possible).

There is more discussion to be had here, and this is not an urgent move. This should be classified as technical debt (in terms of priority) and should not block new features or bug fixes.

remove the \n in the text

the xml as follows:

<result>Test text

text
</result>

after formatting:
<result>Test texttext</result>

The '\n' in element text should not be removed.

Namespaces are placed in a new line

When formatting a document, every namespace attribute is placed on a new line.

Example:

<?xml version="1.0" encoding="UTF-8"?>
<parent xmlns="namespace.url" xmlns:foo="bar">
   <child>Info</child>
</parent>

is converted to

<?xml version="1.0" encoding="UTF-8"?>
<parent 
   xmlns="namespace.url" 
   xmlns:foo="bar">
   <child>Info</child>
</parent>

It will be nice to have at least an option to disable this behaviour and put every node tag on a unique line with all its attributes.

Improper formating

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <s:Header xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" /> <soapenv:Body> <TableResponse xmlns="http://xml.tools/"> <TableResult> <TableLists> <TableList> <TableCode>Tool</TableCode> <TableEntry> <ElementCode>00001</ElementCode> <ElementDescription>1</ElementDescription> </TableEntry> <TableEntry> <ElementCode>0002</ElementCode> <ElementDescription>2</ElementDescription> </TableEntry> </TableList> </TableLists> </TableResult> </TableResponse> </soapenv:Body> </soapenv:Envelope>

Shift+Alt+F format it, but... Body is intended as subchild of Header, should be on the same level.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.