Giter Site home page Giter Site logo

burn-e99 / mybatis-lang-support Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 305 KB

Adds support for mybatis xml in Java projects, helping alleviate typos.

License: Mozilla Public License 2.0

TypeScript 98.63% JavaScript 1.37%
vscode-extension mybatis

mybatis-lang-support's Introduction

mybatis-lang-support

Mybatis Lang Support adds useful error checking to Mybatis mapper XML files, helping alleviate typos and other common issues.

This extension is intended to be used on ibatis and mybatis projects using useStatementNamespaces="true" (details). If your project does not use this, or utilizes references without namespaces, you should enable the legacySupport setting.

Features

  • Verifies that all <, >, and & characters are properly encoded, and provides quickfixes when they are not properly encoded
  • Verifies that all references exist with valid namespaces, and provides quickfixes when a namespace is missing from the reference
  • Verifies that ids are not duplicated
  • Verifies that all tags are properly closed
  • Provides quick links on <include refid tags to quickly jump between the usage and definition
  • Shows definition of the <include refid when holding Ctrl and hovering over a refid
  • Provides tab completion for refids, first suggesting the namespaces, then after pressing ., the sql references
    • !! NOTICE !! Tab completions will not work without the following setting set either in your workspace or user settings:
      "editor.quickSuggestions": {
      	"strings": true
      }
      

Extension Settings

  • mybatis-lang-support.mapperPath: Name of the folder holding your mapper.xml files. Start with ./ to make relative to this workspace.
  • mybatis-lang-support.mapperTag: Name of the tag that defines the mappers.
  • mybatis-lang-support.legacySupport: Enable this setting to support legacy standards. This setting will remove the namespace requirement for <include refid=\"\"/>, allowing ids to be referenced without a namespace.

Installation

Get it direct from the Extension Marketplace.

Release Notes

See CHANGELOG.md

Problems?

Please raise a descriptive issue on this GitHub repo containing examples of the problem you are encountering. The more clear and desciptive the issue, the more likely it will be investigated and fixed quickly.

mybatis-lang-support's People

Contributors

burn-e99 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

mybatis-lang-support's Issues

Namespaces can be shared between files

Namespaces can be shared between files, downgrade to warning and make sure all namespaces are checked before showing an error on refids without a namespace

Create Fix All command

The extension should provide a command (activated by Ctrl+Shift+P) to fix all quick fixable issues.

Add error checking around &

& is an illegal character in xml, but is a legal SQL character (bitwise AND). Add error checking around this character.

Add CDATA as an option to fixing caret issues

There should be an additional quickfix option added to the caret issue that suggests fixing it with the following (example is for NEQ, instead of doing &lt;&gt;

<![CDATA[ <> ]]>

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.